Core Concepts

Errors

The API uses conventional HTTP response codes to indicate the failure of a request. Codes in the 4xx range indicate a request failed (i.e. a required parameter was omitted). Codes in the 5xx range indicate a system error.

The API returns an error object with each unsuccessful request.


Response

// error object
{
  "error": {
    "url": "/v1/auth/login",
    "request_method": "post",
    "type": "user",
    "code": 400,
    "message": "Required values are missing.",
    "fields": {
      "username": "This value is required."
      "password": "This value is required."
    },
    "dev_message": "Unknown resource."
  }
}
PropertyTypeDescription
error.urlstringThe URL the error was generated from.
error.request_methodstringThe request method.Use this to evaluate your response message.
error.typestringThe error type. (See error type definitions for more information.)
error.codeintegerThe error code. (See error code definitions for more information.)
error.messagestringThe error message. This value is always suitable for user feedback. When the error type is user, details are provided to assist the user in recovery. Otherwise, the generic "An error occurred. Please try again later." is provided.
error.fieldsarrayAn array of field names and their associated error messages for display in your form.
error.dev_messagestringA message that better explains the issue.

Error types

You can also evaluate the error by checking the error.type. All errors are categorized by one of the following types.

TypeDescription
userAn error occurred as a result of user provided values (e.g. invalid password, required data missing).
codebaseThe request was invalid or missing required parameters that could not be provided by the user (e.g. uri, api keys, record IDs).
systemSystem errors indicate there was a problem on our end.

Error codes

CodeTypeDescription
400Bad RequestThe request was unacceptable, often due to missing a required parameter.
401UnauthorizedInvalid API initialization.
403ForbiddenThe API key doesn't have permissions to perform the request.
404Not FoundThe requested resource doesn't exist.
429Too Many RequestsToo many requests hit the API too quickly.
500Server ErrorsSomething went wrong on our end.
Previous
Pagination