← Back to Documentation

API Reference

Complete REST and GraphQL API documentation with request/response examples.

REST Endpoints
HTTP REST API endpoints for platform operations

Users

GET
/api/users

Get all users

// Response
{
  "users": [
    {
      "id": "1",
      "name": "John Doe",
      "email": "john@example.com",
      "role": "admin",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ],
  "total": 1
}
GET
/api/users/:id

Get user by ID

// Response
{
  "id": "1",
  "name": "John Doe",
  "email": "john@example.com",
  "role": "admin",
  "posts": []
}
POST
/api/users

Create new user

// Request Body
{
  "name": "Jane Smith",
  "email": "jane@example.com",
  "password": "securepassword"
}
// Response (201 Created)
{
  "id": "2",
  "name": "Jane Smith",
  "email": "jane@example.com",
  "role": "user"
}
PATCH
/api/users/:id

Update user

// Request Body
{
  "name": "Jane Doe"
}
DELETE
/api/users/:id

Delete user

Posts

GET
/api/posts

Get all posts (paginated)

// Query Parameters
?page=1&limit=10&sort=createdAt&order=desc
POST
/api/posts

Create new post

{
  "title": "My First Post",
  "content": "This is the content...",
  "published": true
}