Error Handling
How the Ever Gauzy API handles errors and how to interpret error responses.
Error Response Format
All error responses follow a consistent structure:
{
"statusCode": 400,
"message": "Error description",
"error": "Bad Request"
}
For validation errors, message may be an array:
{
"statusCode": 400,
"message": [
"firstName must be a string",
"firstName should not be empty",
"email must be an email"
],
"error": "Bad Request"
}
HTTP Status Codes
Client Errors (4xx)
| Code | Name | Description | Common Cause |
|---|---|---|---|
| 400 | Bad Request | Invalid request body or parameters | Validation failure, malformed JSON |
| 401 | Unauthorized | Authentication required or failed | Missing/invalid JWT token |
| 403 | Forbidden | Authenticated but not authorized | Insufficient role/permissions |
| 404 | Not Found | Resource does not exist | Wrong ID, deleted resource |
| 405 | Method Not Allowed | Wrong HTTP method | Using GET instead of POST |
| 409 | Conflict | Duplicate or conflicting resource | Unique constraint violation |
| 422 | Unprocessable Entity | Valid syntax but semantic error | Business logic violation |
| 429 | Too Many Requests | Rate limit exceeded | Too many API calls |
Server Errors (5xx)
| Code | Name | Description |
|---|---|---|
| 500 | Internal Server Error | Unexpected server error |
| 502 | Bad Gateway | Upstream service unavailable |
| 503 | Service Unavailable | Server overloaded or maintenance |
Common Error Scenarios
Authentication Errors
Invalid credentials:
{
"statusCode": 401,
"message": "Incorrect email or password",
"error": "Unauthorized"
}
Expired token:
{
"statusCode": 401,
"message": "Token has expired",
"error": "Unauthorized"
}
Missing token:
{
"statusCode": 401,
"message": "Unauthorized"
}