Errors
The Stables API returns error objects with a consistent structure.
Error Object Schema
{
"statusCode": 404,
"error": "Not Found",
"message": "string",
"code": "NOT_FOUND"
}Validation errors (400 Bad Request) may also include a fields array with per-field details:
{
"statusCode": 400,
"error": "Bad Request",
"message": "string",
"code": "string",
"fields": [
{
"field": "string",
"message": "string"
}
]
}Fields
| Field | Type | Description |
|---|---|---|
statusCode | number | HTTP status code |
error | string | HTTP reason phrase (e.g. "Not Found", "Bad Request") |
message | string | Human-readable explanation. It can change, so do not parse it, except for the code prefixes described under each endpoint |
code | string | (optional) Machine-readable error code, safe to branch on (e.g. NOT_FOUND, UNPROCESSABLE_ENTITY). Some endpoint-specific errors omit it and prefix the code to message instead |
fields | array | (optional, validation errors only) Field-level errors: { field, message } |
Common Error Responses
400: Bad Request / Validation Error401: Unauthorized402: Payment Required (your balance cannot cover a fee charged for the request)403: Forbidden404: Not Found409: Conflict422: Unprocessable Entity500: Internal Server Error502: Bad Gateway503: Service Unavailable (retry shortly)504: Gateway Timeout
For unexpected 5xx errors message is a generic description and code is the status name (for example INTERNAL_SERVER_ERROR).
(More specific error messages appear under each endpoint's response schema.)