Error Codes¶
This page documents all possible error responses from the LexgoSign API.
Error Response Format¶
HTTP failures generally use the following format. Envelope validation is a separate response layer:
HTTP Status Codes¶
200 OK¶
Creation returns HTTP 200 when the envelope is valid. Fetch/update can return
an existing envelope with status: ERROR and nonempty errors; inspect
envelope.status, envelope.errors, and envelope.warnings before sending.
{"envelope":{"id":"envelope-id","status":"ERROR","errors":["Validation error"],"warnings":[]},"request_id":"request-id"}
202 Accepted¶
PUT /v1/envelopes/:id/send queues asynchronous processing and returns an
envelope with status: SENDING. It does not prove invitations were delivered
or signing completed. Follow webhooks and reconcile with
GET /v1/envelopes/:id for IN_PROGRESS, SUCCESS, VOIDED, or
ERROR. Do not blindly retry create/send after a timeout; inspect the
known envelope first.
401 Unauthorized¶
Missing Authorization Header¶
Invalid API Key¶
Deactivated API Key¶
404 Not Found¶
Envelope Not Found¶
Recipient Not Found¶
422 Unprocessable Content¶
Invalid Envelope Metadata¶
POST /v1/envelopes with a metadata value that is not a JSON object or exceeds the
documented size, depth or key limits. No envelope is created, so there is no envelope ID
to correct. This also covers a nonzero number outside the 64-bit float range (for example 1e400 or 1e-400), an object larger than 8,192 bytes after storage (many large exponents), and a string containing the NUL character. See Envelope metadata.
{
"error": "Invalid metadata",
"message": "metadata is 9004 bytes when serialized; the maximum is 8192",
"request_id": "req_abc123"
}
405 Method Not Allowed¶
Invalid Envelope State¶
422 Unprocessable Entity¶
Creation validation failures return HTTP 422 with envelope.id,
status: ERROR, and the existing actionable envelope.errors array.
Keep the ID and repair the envelope with PUT /v1/envelopes/:id before sending.
Envelope Creation Validation¶
{
"envelope": {
"id": "envelope-id",
"status": "ERROR",
"errors": ["Validation error"],
"warnings": []
},
"request_id": "request-id"
}
Verification Code¶
429 Too Many Requests¶
Rate Limit Exceeded¶
Max Attempts Exceeded¶
500 Internal Server Error¶
Error Handling Best Practices¶
- Check HTTP status and the envelope lifecycle, errors, and warnings
- Log request_id for support tickets
- Implement exponential backoff for rate limits
- Show user-friendly error messages
- Monitor error rates