Every Doctavian operation answers in one of two shapes: a success envelope carrying result, or an error envelope carrying error. This page shows how to tell them apart, which fields to branch on, when a retry helps and when it doesn't, and what to send support. The Error Codes Reference lists the codes themselves.
A success response wraps its payload in result.data:
{
"result": {
"statusCode": 201,
"message": "Created",
"data": { ... }
},
"externalContext": { "orderId": "SO-10442" },
"operationId": "b5629806f22477783837ba2c1137f33d",
...
}An error response carries error in place of result:
{
"error": {
"statusCode": 400,
"message": "Bad Request",
"innerErrors": [
{
"code": "INVALID_LOAD_METHOD_SPECIFIED",
"message": "The specified load method Storages is invalid or not supported. Please verify the method and try again.",
"userMessage": "There was an issue with the load method specified Storages. Please check the method and ensure it is valid",
"eventId": "3a281851-ecd2-4112-904d-01e7cb63cd8b"
},
{
"code": "GENERATE_FUNCTION_FAILED",
"message": "Failed to generate the document.",
"userMessage": "There was an issue generating the document. Please check the input data and try again.",
"eventId": "647b46fa-1d8d-4e5f-94a9-efc6ec3da07c"
}
],
"externalErrors": []
},
"externalContext": { "orderId": "SO-10442" },
"origin": "POST https://api.doctavian.com/v1/documents/document/generate",
"dateTime": "2026-10-14T08:42:18.0000000Z",
"operationId": "2a9542e00d4c0c5e720bfae6e66a9858",
...
}This one request failed two checks, so innerErrors has two entries: the specific cause first, then the general generation failure.
Decide success by the HTTP status and the presence of
result, not byresult.statusCodealone — the two don't always match.
error.innerErrors[].code. It is stable once published. message and userMessage are prose and can be reworded.userMessage to people, log message. userMessage is safe to display verbatim. message may include internal detail.externalErrors as diagnostics only. Log it; don't parse it.externalContext. Any externalContext object you send is echoed back unchanged, on success and on failure alike.Log the full error body. Two identifiers in it matter most:
operationId identifies the request in Doctavian's logs. It is returned on success and failure alike, and is the primary reference to quote to support.eventId identifies the logged failure behind the error, at the top level or on individual innerErrors entries. It is not always present.A response with no operationId came from the gateway before the request reached Doctavian — usually a 401 for a bad credential. Fix the request; there is nothing for support to trace.
| Response | What to do |
|---|---|
400 | Don't retry unchanged. Fix the request using the codes in innerErrors. |
401 | Re-acquire or correct the credential, then retry. See Troubleshooting. |
403 LIMIT_BREACH | Retrying won't help until the period named in the message rolls over or the limit is raised. |
403 (other) | You lack access to the resource. Check who owns it. |
409 ENVELOPE_DOCUMENTS_PROCESSING | Retry after a short wait; the signed documents are still being processed. |
500 with a *_NOT_FOUND code | Don't retry. The id you sent matches nothing; see Not found. |
500 (other), 502 | Retry with backoff. If it persists, contact support with the identifiers above. |
Storage uploads are single-use. The first generation, envelope or Envelope Template that consumes a file removes it, whether that call succeeds or fails, so upload the file again before you retry. See Storage and File IDs.
Some failures never come back as an HTTP error on the call you made:
200 with an empty body once the request is queued. A failure during processing, including LIMIT_BREACH, is delivered to your callback URL as an error envelope. See Receive Callbacks.Failed with an errorMessage on GET /documents/request/{documentRequestId}/get. A failed document request is not retried automatically; create a new one.Failed after they are sent. Read the status with GET /signatures/envelope/{envelopeId}/get, or receive it as a status callback.Always include:
operationId, and every eventId in the responseorigin has both)dateTime)An unhandled error that recurs consistently is worth reporting immediately; it likely indicates a bug rather than a configuration issue. Reach out via support.doctavian.com.