API reference documentation
Comprehensive API endpoint documentation with complex parameter descriptions and examples.
REST API endpoints
| Endpoint | Method | Parameters | Response | Authentication |
|---|---|---|---|---|
/api/v2/users | GET | Query params:
| 200 OK
| API key required |
|
|
GET |
Path params:
Query params:
|
200 OK 404 Not Found User does not exist |
Bearer token or API key |
|
|
POST |
Request body: Validation:
|
201 Created 400 Bad Request Validation errors 409 Conflict Email already exists |
API key (admin only) |
|
|
PATCH |
Path params:
Request body: All fields optional (partial update) |
200 OK Updated user object 403 Forbidden Insufficient permissions 404 Not Found User does not exist |
Bearer token (self or admin) |
|
|
DELETE |
Path params:
Query params:
|
204 No Content Deletion successful 403 Forbidden Cannot delete own account 404 Not Found User does not exist |
Bearer token (admin only) |
MDX source
<ListTable headerRows={1} headerColumns={1} caption="User management API v2">
- - Endpoint
- Method
- Parameters
- Response
- Authentication
- - `/api/v2/users`
- GET
- **Query params:**
- `page` (integer): Page number (default: 1)
- `limit` (integer): Items per page (default: 20, max: 100)
- `sort` (string): Sort field (name, email, created_at)
- `order` (string): Sort direction (asc, desc)
- `role` (string): Filter by role (admin, user, guest)
- `active` (boolean): Filter by active status
- **200 OK**
```json
{
"users": [...],
"total": 150,
"page": 1,
"pages": 8
}
```
- API key required
- - `/api/v2/users/:id`
- GET
- **Path params:**
- `id` (UUID): User identifier
**Query params:**
- `include` (string): Related resources to include (profile, settings, permissions)
- **200 OK**
```json
{
"id": "uuid",
"name": "...",
"email": "..."
}
```
**404 Not Found**
User does not exist
- Bearer token or API key
...
</ListTable>
GraphQL schema reference
| Type | Fields | Description | Example query |
|---|---|---|---|
User | Fields:
| Represents a registered user in the system |
|
Post | Fields:
| Blog post or article content |
|
Comment | Fields:
| User comment on a post (supports threading) |
|
MDX source
<ListTable headerRows={1} caption="GraphQL type definitions" validation="strict">
- - Type
- Fields
- Description
- Example query
- - `User`
- **Fields:**
- `id: ID!`
- `name: String!`
- `email: String!`
- `role: Role!`
- `createdAt: DateTime!`
- `updatedAt: DateTime!`
- `posts: [Post!]!`
- `comments: [Comment!]!`
- Represents a registered user in the system
- ```graphql
query {
user(id: "123") {
name
email
posts {
title
}
}
}
```
...
</ListTable>
Webhook event reference
| Event | Payload | Triggers when | Retry policy |
|---|---|---|---|
user.created |
| New user registration completed | 3 retries with exponential backoff (1s, 2s, 4s) |
user.updated |
| User profile or settings changed | 3 retries with exponential backoff |
user.deleted |
| User account permanently deleted | 5 retries (critical event) |
payment.succeeded |
| Payment processed successfully | 5 retries (critical event) |
payment.failed |
| Payment processing failed | 5 retries (critical event) |
MDX source
<ListTable headerRows={1} headerColumns={1} caption="Webhook event types" validation="strict">
- - Event
- Payload
- Triggers when
- Retry policy
- - `user.created`
- ```json
{
"event": "user.created",
"user": {
"id": "uuid",
"name": "...",
"email": "..."
},
"timestamp": "ISO8601"
}
```
- New user registration completed
- 3 retries with exponential backoff (1s, 2s, 4s)
...
</ListTable>