Products

SIGN UPLOG IN

API / Errors

API error codes and responses

Overview

Sightengine uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate a request error (such as an issue with the request parameters or content), and codes in the 5xx range indicate an error with Sightengine's servers.

In addition to the HTTP status code, error responses include a JSON body with additional details about the error.

Response body

The response body will contain a JSON object with the following structure:

                    
                    
{
  "status": "failure",
  "request": {
    "id": "req_jBS589QCnfWJmBKFZ1z71",
    "timestamp": 1763657604.988901,
    "operations": 0
  },
  "error": {
    "type": "argument_error",
    "code": 1,
    "message": "Incorrect API user or API secret"
  }
}
                    
                

The error object contains more details about the error:

FieldTypeDescription
typestringThe type of error (see list below)
codeintegerAn error-specific code, that can be used to communicate with support
messagestringA human-readable message describing the error

Error types

The error.type field describes the type of error that occurred. The following error types are defined:

TypeDescription
api_errorThere was a problem with the API
argument_errorThere was a problem with one of the arguments provided in the request
callback_errorThere was a problem with the callback URL provided
credentials_errorThere was a problem with the authentication credentials provided
media_errorThere was a problem with the media provided in the request
plan_errorThere was a problem with the plan associated with the API key
request_errorThere was a problem with the request
unknown_errorAn unknown error occurred
usage_limitThe usage limit for the account has been exceeded

Was this page helpful?