Architecture
Errors
The API provides details for each failed request.
Error response
An error object is returned when a request fails.
{
"success": false,
"message": "Required values are missing.",
"payload": {
"app_id": "app_1234567890",
"request_method": "post",
"type": "user",
"code": 400,
"fields": {
"username": "This value is required.",
"password": "This value is required."
},
"dev_message": ""
}
}
The payload.fields
is an array of field names and their associated error messages for display in your UI.
The message
is always suitable for user feedback. When the error type is user
, details are provided to assist the user in recovery. Otherwise, the default "An error occurred. Please try again later." is provided.
The error.dev_message
is a detailed error message for debugging purposes.
Error types
user
- An error occurred as a result of user provided values (e.g. invalid password, required data missing).codebase
- The request was invalid or missing required parameters that could not be provided by the user (e.g. uri, api keys, record IDs).system
- System errors indicate there was a problem on our end.
FYI
Codebase error logs are made available in the dashboard for your review and resolution.
Error codes
400
- Bad request. The request was unacceptable, often due to missing a required parameter.401
- Unauthorized. Invalid API initialization.403
- Forbidden. The API key doesn't have permissions to perform the request.404
- Not found. The requested resource doesn't exist.429
- Too many requests hit the API too quickly.500
- Something went wrong on our end.