API Reference

GET /api/v1/users

Retrieve a paginated list of users.

curl -X GET "https://api.example.com/api/v1/users?page=1&limit=20" \
  -H "Authorization: Bearer <token>"

POST /api/v1/users

Create a new user account.

curl -X POST "https://api.example.com/api/v1/users" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "securePass123"
}'

GET /api/v1/users/:id

Retrieve details for a specific user.

curl -X GET "https://api.example.com/api/v1/users/42" \
  -H "Authorization: Bearer <token>"

PUT /api/v1/users/:id

Update user information.

curl -X PUT "https://api.example.com/api/v1/users/42" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "name": "Jane Smith",
    "email": "jane.smith@example.com"
}'

DELETE /api/v1/users/:id

Remove a user from the system.

curl -X DELETE "https://api.example.com/api/v1/users/42" \
  -H "Authorization: Bearer <token>"

GET /api/v1/posts

Retrieve a list of blog posts.

curl -X GET "https://api.example.com/api/v1/posts?author=42" \
  -H "Authorization: Bearer <token>"

POST /api/v1/posts

Create a new blog post.

curl -X POST "https://api.example.com/api/v1/posts" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "title": "My First Post",
    "content": "Hello world!",
    "authorId": 42
}'

GET /api/v1/posts/:id

Retrieve a specific post.

curl -X GET "https://api.example.com/api/v1/posts/100" \
  -H "Authorization: Bearer <token>"

PUT /api/v1/posts/:id

Update an existing post.

curl -X PUT "https://api.example.com/api/v1/posts/100" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "title": "Updated Title",
    "content": "Revised content."
}'

DELETE /api/v1/posts/:id

Delete a post.

curl -X DELETE "https://api.example.com/api/v1/posts/100" \
  -H "Authorization: Bearer <token>"

GET /api/v1/comments

Retrieve comments for a post.

curl -X GET "https://api.example.com/api/v1/comments?postId=100" \
  -H "Authorization: Bearer <token>"

POST /api/v1/comments

Add a comment to a post.

curl -X POST "https://api.example.com/api/v1/comments" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "postId": 100,
    "authorId": 42,
    "content": "Great post!"
}'

DELETE /api/v1/comments/:id

Remove a comment.

curl -X DELETE "https://api.example.com/api/v1/comments/555" \
  -H "Authorization: Bearer <token>"