Welcome to the documentation for our v2 API. This section outlines the available endpoints, their parameters, and expected responses.
All API requests must be authenticated. Please include your API key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEY
If you do not have an API key, please contact support.
Retrieves a list of all users.
| Name | Type | Description | Required |
|---|---|---|---|
limit |
Integer | Maximum number of users to return. | No |
offset |
Integer | Number of users to skip. | No |
{
"status": "success",
"data": [
{"id": 1, "username": "alice", "email": "alice@example.com"},
{"id": 2, "username": "bob", "email": "bob@example.com"}
],
"count": 2
}
Retrieves a specific user by their ID.
| Name | Type | Description | Required |
|---|---|---|---|
userId |
Integer | The unique identifier of the user. | Yes |
{
"status": "success",
"data": {"id": 1, "username": "alice", "email": "alice@example.com"}
}
Creates a new user.
{
"username": "string",
"email": "string",
"password": "string"
}
{
"status": "success",
"data": {"id": 3, "username": "charlie", "email": "charlie@example.com"}
}
Retrieves a list of available products.
| Name | Type | Description | Required |
|---|---|---|---|
category |
String | Filters products by a specific category. | No |
sortBy |
String | Sort order (e.g., 'price', 'name'). | No |
{
"status": "success",
"data": [
{"id": 101, "name": "Wireless Mouse", "price": 25.99, "category": "Electronics"},
{"id": 102, "name": "Mechanical Keyboard", "price": 79.99, "category": "Electronics"}
],
"count": 2
}
API errors are returned with a status of error and a descriptive message.
{
"status": "error",
"message": "Resource not found."
}
{
"status": "error",
"message": "Invalid or missing API key."
}
To ensure fair usage, the API enforces rate limits. Your current rate limit status can be found in the response headers:
X-RateLimit-Limit: The total number of requests allowed in the current window.X-RateLimit-Remaining: The number of requests remaining in the current window.X-RateLimit-Reset: The time in UTC epoch seconds when the rate limit window resets.If you exceed the rate limit, you will receive a 429 Too Many Requests error.
Need to manage your pet rocks? Check out Pet Rock Management.