Status & Error Codes

To ensure you can respond appropriately when our API gives unexpected output, we maintain a consistent set of API response and error codes. The general design of these will be discussed inside this chapter.

Authorization image

API Response Codes

Our API uses the following response status codes, as defined in the RFC 2616 and RFC 6568;

Status
Description
200

The request succeeded. The client can read the body.

201

The request is created. A new resource will be created.

202

The request is accepted. The client has to wait until it’s done processing.

204

The request has succeeded but returns no message body.

304

Not Modified.

400

The request could not be understood by the server due to malformed syntax.

401

The request requires authentication.

403

The server understood the request, but is refusing to fulfill it.

404

The requested resource could not be found.

429

Too Many Requests.

500

Internal Server Error. If you catch one, report your issue here.

502

Bad Gateway.

503

Service Unavailable.

API Error Objects

Apart from the response codes, unsuccessful responses return their generic GraphQL error described here alongside some additional fields. The additional fields can be found inside the extensions object. The most important one here is the exception object. This contains all the information about the error and looks as follows;

  • response string

    Your project id with the corresponding configuration

  • status int

    The status code of the response reflecting the API response codes

  • message string

    The message describing the error

  • code string

    A unique error code that can be used for localization

  • If we want to reflect this as a curl it would look like this;

    Error / Error objects
    {  "errors": [    {      "message": "The car was not found in the database",      "locations": [        {          "line": 2,          "column": 3        }      ],      "path": [        "addReview"      ],      "extensions": {        "exception": {          "response": "CAR_NOT_FOUND",          "status": 500,          "message": "No car was found with the provided ID",          "code": "CAR_NOT_FOUND"        }      }    }  ],  "data": null}

    Navigate to our API reference to get a more detailed look at the possible errors per request.