Error Handling
esimtida API uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, authentication failed). Codes in the 5xx range indicate an error with our servers.
Standard Error Format
All API errors are returned as JSON, containing a descriptive message and an optional set of field-specific errors.
Validation Error Payload (422)
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email has already been taken."
]
}
}
"message": "The given data was invalid.",
"errors": {
"email": [
"The email has already been taken."
]
}
}
HTTP Status Codes
| Code | Name | Meaning |
|---|---|---|
| 200 - OK | Success | Everything worked as expected. |
| 400 - Bad Request | Invalid Request | Your request was invalid. Review the payload. |
| 401 - Unauthorized | Auth Failure | No valid API key provided. |
| 403 - Forbidden | Access Denied | The API key doesn't have permissions to perform the request. |
| 404 - Not Found | Missing | The requested resource doesn't exist. |
| 422 - Unprocessable | Validation Error | Parameters were invalid. See the "errors" array. |
| 429 - Too Many Requests | Rate Limited | Too many requests hit the API too quickly. Slow down. |
| 500, 502, 503, 504 | Server Error | esimtida API runtime error. Contact support. |