This document outlines the schema and endpoints for our public API. It provides detailed information on available resources, request parameters, and response structures. Please adhere to this schema for seamless integration.
All API requests must be authenticated. Use your provided API key,
passed in the Authorization
header as a Bearer token.
Example: Authorization: Bearer YOUR_API_KEY
.
Retrieves the API schema documentation.
Retrieves a list of all users. Supports pagination.
Name | Type | Description | Required | Default |
---|---|---|---|---|
page | integer | The page number for pagination. | No | 1 |
limit | integer | The number of items per page. | No | 20 |
role | string | Filter users by role. | No |
Status Code | Description | Content |
---|---|---|
200 OK | Successfully retrieved users. |
|
401 Unauthorized | Authentication failed. |
|
500 Internal Server Error | An unexpected error occurred. |
|
Creates a new user.
{
"username": "charlie",
"email": "charlie@example.com",
"password": "securepassword123",
"role": "user"
}
Status Code | Description | Content |
---|---|---|
201 Created | User successfully created. |
|
400 Bad Request | Invalid request payload. |
|
409 Conflict | User with this email or username already exists. |
|
Retrieves a specific user by their ID.
Name | Type | Description | Required |
---|---|---|---|
userId | string | The unique identifier of the user. | Yes |
Status Code | Description | Content |
---|---|---|
200 OK | Successfully retrieved the user. |
|
404 Not Found | The specified user ID was not found. |
|
Updates an existing user by their ID.
Name | Type | Description | Required |
---|---|---|---|
userId | string | The unique identifier of the user to update. | Yes |
{
"email": "alice.updated@example.com",
"role": "editor"
}
Status Code | Description | Content |
---|---|---|
200 OK | User successfully updated. |
|
404 Not Found | The specified user ID was not found. |
|
Deletes a user by their ID.
Name | Type | Description | Required |
---|---|---|---|
userId | string | The unique identifier of the user to delete. | Yes |
Status Code | Description | Content |
---|---|---|
204 No Content | User successfully deleted. | |
404 Not Found | The specified user ID was not found. |
|
Common data types used in the API:
1
, -5
).1.23
, 42
).true
or false
.["apple", "banana"]
)."2023-10-27T10:00:00Z"
).Values that are restricted to a specific set:
The role
field can take one of the following values:
admin, user, editor, guest