Errors

In this guide, we will talk about what happens when something goes wrong while you work with the API. Mistakes happen, and mostly they will be yours, not ours. Let's look at some status codes and error types you might encounter.

You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging (before contacting support).


HTTP status codes

Here is a list of the different categories of status codes returned by the API gateway. Use these to understand if a request was successful.

Code Message Description
200 OK The request was successful and the response contains the requested content.
201 Created The request was successful and the resource was created.
204 No Content The request was successful and the response contains no content.
400 Bad Request The request was malformed or missing required parameters.
401 Unauthorized

The request was denied due to invalid credentials. Check that you are sending your API key correctly.

403 Forbidden

The request was denied due to insufficient permissions. Check your API key and make sure you have the correct permissions.

404 Not Found The requested resource was not found.
405 Method Not Allowed

The request method is not allowed for the requested resource. For example, when using the GET method to create a resource.

409 Conflict

The request could not be processed because of a conflict in the request. For example, you may not be able to delete a resource that has children. Likewise, you may encounter a conflict when creating a resource that already exists.

429 Too Many Requests

The request was rejected because the API Gateway has received too many requests in a given amount of time. This is usually a temporary error and can be retried.

500 502 503 504

Internal Server Error

The server encountered an error while processing the request. This is usually a temporary error and can be retried.


Error messages

Whenever a request is unsuccessful, the API Gateway will return an error response with an error message. You can use this information to understand better what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.

Error response

{
    "errors": [
        {
            "message": "Not found"
        }
    ]
}