Errors
Every error has the same JSON body. code is stable and comes with the HTTP status listed below; message is for people and may change, so branch on code. details carries extra facts for some codes.
json
{
"error": {
"code": "VALIDATION",
"message": "recipients[0].email is not a valid email address",
"details": {
"issues": [
{
"path": "recipients[0].email",
"message": "recipients[0].email is not a valid email address"
}
]
}
}
}With the Node.js client every failure is a SignApiError carrying code, status, details and requestId. When no response arrived at all, status is 0 and code is NETWORK, TIMEOUT or ABORTED.
Codes
| Code | Status | Meaning |
|---|---|---|
VALIDATION | 400 Bad Request | The request is malformed. details.issues lists each problem as { path, message }. |
UNAUTHORIZED | 401 Unauthorized | The API key is missing or not valid. |
TOKEN_INVALID | 401 Unauthorized | The signing link is unknown, already used, expired or withdrawn. |
OTP_INVALID | 401 Unauthorized | The one-time code is wrong (details.attemptsLeft), or the signing session is missing (details.otpRequired). |
OTP_EXPIRED | 401 Unauthorized | The one-time code timed out, or none was sent. |
FIELD_NOT_YOURS | 403 Forbidden | A value names a field that belongs to another recipient. |
FORBIDDEN | 403 Forbidden | The credential may only read; only GET routes are allowed. |
ENVELOPE_NOT_FOUND | 404 Not Found | No envelope with this id in the caller's workspace. |
RECIPIENT_NOT_FOUND | 404 Not Found | No recipient with this id on the envelope. |
NOT_FOUND | 404 Not Found | No route, document or template at this address. |
INVALID_STATE | 409 Conflict | Not allowed in the envelope's current status (details.status). |
NOT_YOUR_TURN | 409 Conflict | Sequential routing, and an earlier recipient has not acted yet. |
CONFLICT | 409 Conflict | Another request changed the envelope, or one with the same Idempotency-Key is still running. Try again. |
ESIGN_UNAVAILABLE | 409 Conflict | Aadhaar eSign cannot be used for this envelope right now (details.reason), for example because it is not set up. |
ENVELOPE_EXPIRED | 410 Gone | The envelope is past its expiry date. |
DOCUMENT_TOO_LARGE | 413 Content Too Large | A PDF or the whole request is over the size limit (details.maxBytes). |
REQUIRED_FIELDS_MISSING | 422 Unprocessable Content | Required fields were left empty. |
INVALID_FIELD_VALUE | 422 Unprocessable Content | A value does not suit its field, for example a signature that is not a PNG or a date that does not parse. |
DOCUMENT_INVALID | 422 Unprocessable Content | A file is not a readable PDF. |
PDF_ALREADY_SIGNED | 422 Unprocessable Content | A file already carries digital signatures. Upload the unsigned original. |
OTP_LOCKED | 423 Locked | Too many wrong guesses, or too many codes for this envelope (details.reason). |
RATE_LIMITED | 429 Too Many Requests | Too many requests. Wait the number of seconds in Retry-After. |
PLAN_LIMIT | 403 Forbidden or 429 Too Many Requests | Hosted plans only. A plan limit was reached (details.limit, details.used, details.max). 429 with Retry-After for the monthly or daily API request count, 403 for every other limit. |
SEAL_FAILED | 500 Internal Server Error | The sealed PDF could not be produced. Safe to retry with the same Idempotency-Key. |
INTERNAL | 500 Internal Server Error | An unexpected server error. Safe to retry with the same Idempotency-Key. |
PROVIDER_ERROR | 502 Bad Gateway | An outside provider, such as an Aadhaar eSign service, failed or answered with something unexpected. |
WEBHOOK_INVALID | 502 Bad Gateway | A provider's callback could not be verified. |
Retrying
429 RATE_LIMITED: wait the number of seconds in theRetry-Afterheader, then retry.429 PLAN_LIMIT: the plan's API request count is used up. It starts again at the time inRetry-After; retrying sooner is refused.403 PLAN_LIMITdoes not change by waiting: remove something or move to a bigger plan.500and502: retry with backoff, sending the sameIdempotency-Keyso nothing is created twice.409 CONFLICT: another request got there first. Fetch the envelope again and retry if it still makes sense.- Every other
4xx: fix the request first. Sending it again unchanged gets the same answer.