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.
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:
| Field | Type | Description |
| type | string | The type of error (see list below) |
| code | integer | An error-specific code, that can be used to communicate with support |
| message | string | A human-readable message describing the error |
The error.type field describes the type of error that occurred. The following error types are defined:
| Type | Description |
| api_error | There was a problem with the API |
| argument_error | There was a problem with one of the arguments provided in the request |
| callback_error | There was a problem with the callback URL provided |
| credentials_error | There was a problem with the authentication credentials provided |
| media_error | There was a problem with the media provided in the request |
| plan_error | There was a problem with the plan associated with the API key |
| request_error | There was a problem with the request |
| unknown_error | An unknown error occurred |
| usage_limit | The usage limit for the account has been exceeded |
Was this page helpful?