Errors
All error responses use a consistent JSON structure.
Error Response Format
{
"error": {
"code": "not_found",
"message": "Product with ID a1b2c3d4-... was not found"
}
}
| Field | Type | Description |
|---|---|---|
error.code | string | Machine-readable error code |
error.message | string | Human-readable description of the error |
HTTP Status Codes
| Status | Name | Description |
|---|---|---|
200 | OK | The request succeeded. Response body contains the result. |
201 | Created | A resource was successfully created. Response body contains the new resource. |
204 | No Content | The request succeeded with no response body (used for DELETE). |
400 | Bad Request | The request body or parameters are invalid. Check error.message for details. |
401 | Unauthorized | The API key is missing, invalid, or expired. |
404 | Not Found | The requested resource does not exist. |
500 | Internal Server Error | An unexpected server error occurred. Contact support if this persists. |
Common Error Codes
| Code | HTTP Status | Description |
|---|---|---|
unauthorized | 401 | API key missing or invalid |
not_found | 404 | Resource does not exist |
validation_error | 400 | Request body failed validation |
invalid_parameter | 400 | A query parameter has an invalid value |
internal_error | 500 | Unexpected server error |
Example: Validation Error
When you send a POST /v1/products with a missing required field:
{
"error": {
"code": "validation_error",
"message": "Field 'name' is required"
}
}
Example: Not Found
When you request a product that does not exist:
{
"error": {
"code": "not_found",
"message": "Product with ID a1b2c3d4-e5f6-7890-abcd-ef1234567890 was not found"
}
}