Handle Responses
HTTP 200 Ok
Successful request.
{
"success": true
// ... Response data
}HTTP 400 Bad request
The request cannot be processed because it contains invalid or malformed input data. This status is returned when one or more request fields fail basic validation such as missing required fields, invalid formats, incorrect data types, or constraint violations. We use Zod library to validate the request. Check out https://zod.dev/ERROR_HANDLING?id=zodissue
Response:
{
"success": false,
"errors": [...] // ZodError list
}HTTP 402 - Payment Required
Remaining credit is not enough to process request.
Response:
{
"success": false,
"reasons": ["E0001:Remaining credit is not enough to process document. Please top up first."]
}HTTP 401 - Unauthorized
Reason by invalid or expired api key.
Response:
{
"success": false,
"reasons": ["Unauthorized"]
}HTTP 403 - Forbidden
This could be one of these reasons:
- Your IP was not whitelisted
- For some internal reasons we block your api usage
Response: No response
HTTP 422 - Unprocessable Content
The server successfully received and understood the request, but cannot process it because the request contains logical or semantic validation errors. This status is returned when the request structure is valid, but the data violates business rules or domain constraints. We always include detail at the end of general error message. Error message start with Error Code E1000. For e.g: E1000:General error - ….
Response:
{
"success": false,
"reasons": [] // Array of string with format: [error code]:[message].
// For e.g: E1000:General Error - Invalid pdf file
}HTTP 429 - Too many request
You sent more requests to the server than allowed within a certain time frame. Checkout Docs » Api Reference » Rate limit section to the limitation.
Response: No response
HTTP 500 - Internal server error
Response: No response or
{
"success": false,
"reasons": ["Internal Server Error"]
}HTTP 503 - Service Unavailable
The server is currently unable to handle the request due to temporary overload, maintenance, or dependency unavailability. This condition is expected to be temporary and may be resolved by retrying the request later. Checkout service status at https://nique.instatus.com/
Response: No response
HTTP 522 - Connection Timed Out
The request could not be completed because the gateway or proxy was unable to establish a timely connection with the origin server. This condition is expected to be temporary and may be resolved by retrying the request later.
Response: No response