Errors
How the API reports failures, and what each status code means.
Use the Status Code
Every failure has a 4xx or 5xx HTTP status. Branch on the status code; the body explains what went wrong but its exact shape varies (below), and message text is meant for humans and may change.
Error Body
Most errors return a JSON object with the status and a message. Some also include an error field with the status name:
{
"statusCode": 404,
"message": "Part [clx1abc2def3ghi4jkl5mno6] not found",
"error": "Not Found"
}
{
"statusCode": 401,
"message": "Unauthorized"
}
Validation Errors
Request bodies and path parameters (and the query strings of some endpoints) are type-checked against the schemas in this reference before your request is handled. A body that does not match returns 400 with a list of problems instead of a statusCode field. Each entry names the offending location ($input is the body or query object), the type that was expected, and the value that was sent:
{
"errors": [
{
"path": "$input.fileUris",
"expected": "Array<string> & MinItems<1>",
"value": []
}
],
"message": "Request body data is not following the promised type."
}
Type-checked query strings fail the same way with the message Request query data is not following the promised type. An invalid path parameter (for example an ID in the wrong format) reports a single problem:
{
"path": "$input",
"reason": "Error on …: invalid type on $input, expect to be string & Pattern<\"^[a-z0-9]{24}$\">",
"expected": "string & Pattern<\"^[a-z0-9]{24}$\">",
"value": "not-an-id",
"message": "Invalid URL parameter value on \"id\"."
}
Unknown properties in a request body are dropped rather than rejected, so a misspelled optional field is silently ignored. Check the field names against this reference.
Status Codes
sort, fields, include or limit value was invalid (see Querying Data), or the request breaks a business rule — the message says which.x-printago-storeid header is missing or doesn't match the key; or the request came from an IP address outside the key's allowlist. See Authentication.Insufficient permissions; each endpoint lists what it requires), or the store's plan doesn't include the feature (message This feature requires the '…' entitlement).Retry-After header. Back off exponentially. See rate limits.{"statusCode": 500, "message": "Internal server error"}). Retry with backoff — but for writes, see Retry Safely first, because the change may already have been applied.