API Error Handling

HTTP status codes the API returns and what a client should do with each.

The Cutwise API answers with standard HTTP status codes, as defined in RFC 7231. This page shows the body of an error response, so that a client can read the error message.

Example

{"error": ["error message", "another error message"]}

Common errors

When a request fails, the response body has the structure shown in the example. The error field is an array of error messages.

Authentication errors

When an authentication request fails, the response body looks like this:

{"error":"invalid_client","error_description":"The client credentials are invalid"}

Here error is a string code, and error_description explains it.

Status codes on other pages

Status code Meaning Described on
204 No diamonds match the filters of a list request. Diamonds API v4
301, 302 Redirect. Follow the Location header. Conventions
401 The access token is missing or has too few rights. Authorization
403 The access token has no right to read or change the resource. Authorization

Related pages