Responses & errors
JSON response envelopes, HTTP statuses, and machine-readable errors.
Response envelope
Most JSON endpoints return the envelope below. The data field contains the endpoint-specific payload. File downloads, streams, and the OpenAPI specification have their own response formats.
{
"success": true,
"message": "Request successful",
"data": {},
"error": false,
"error_message": null,
"error_code": null
}Error contract
Use the HTTP status and error_code to handle failures. error_message provides the human-readable explanation. Check the endpoint reference for its documented response statuses.
INVALID_API_KEY indicates an invalid API credential (401). INVALID_ACCOUNT_TOKEN indicates missing or invalid account authentication (400). Permission failures typically return 403. Rate-limited requests return 429.
{
"success": false,
"message": "Invalid API key",
"data": [],
"error": true,
"error_message": "Invalid API key",
"error_code": "INVALID_API_KEY",
"errors": [
{
"code": "INVALID_API_KEY",
"detail": "Invalid API key",
"status": 401
}
]
}Pagination
Pagination is endpoint-specific. For GET /api/user/servers, page defaults to 1 and limit defaults to 10 with a maximum of 100. search filters by server name or description. Use the pagination metadata in the response rather than assuming every endpoint has the same shape.
GET /api/user/servers?page=1&limit=10&search=minecraft