The Doctavian API uses standard HTTP status codes. Every failure also returns a JSON body, the error envelope, whose error.innerErrors[].code names the exact problem. Branch on that code in your integration, not on the HTTP status or the message text: messages are prose and may be reworded, but a published code keeps its meaning.
This page covers the envelope, what each HTTP status means, and the codes integrators commonly hit. Each operation in the API reference lists every code it can return. For what to log and when to retry, see Error Handling. For authentication failures, go straight to Authentication → Troubleshooting.
{
"error": {
"statusCode": 400,
"message": "Bad Request",
"innerErrors": [
{
"code": "VALIDATION_ERROR",
"message": "Name is required.",
"userMessage": "Name is required."
}
]
},
"origin": "POST https://api.doctavian.com/v1/documents/datasource/create",
"dateTime": "2026-10-14T08:42:17.0000000Z",
"userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",
"operationId": "e9954e98a24941278d6742af639eddde"
}
| Field | What it tells you |
error.statusCode, error.message | The HTTP status and its category text, such as Bad Request, repeated in the body. |
error.innerErrors[] | One entry per distinct problem. A request that fails several checks reports each separately, so read the whole array. |
innerErrors[].code | Stable, machine-readable code. Branch on this. |
innerErrors[].message | Technical explanation for developers and logs. Not meant for end users. |
innerErrors[].userMessage | The same failure phrased for an end user, safe to display. |
operationId, eventId | Identify the request and the logged failure. Quote them to support. |
externalContext | Your own externalContext, echoed back unchanged. |
Two kinds of failure look different. A missing or invalid credential is answered by the gateway with an error envelope that has no operationId. A path id that is not a GUID matches no operation and gets a 404 with no body at all.
| Code | Name | When it occurs |
200 | OK | The request succeeded. Async document operations also answer 200, with an empty body: that only means the request was queued, and the result arrives at your callback URL. |
201 | Created | A resource was created: an upload, envelope, template, data source, solution or document request. |
202 | Accepted | A recipient signed digitalsignature fields: the values are saved, but their part is not complete until the client finishes the hash exchange. |
400 | Bad Request | The request failed validation, or (on the Signatures API) a well-formed id matched nothing. Nothing was changed. |
401 | Unauthorized | A credential, or a recipient's transaction token (tid), is missing, expired or invalid. See Authentication errors. |
403 | Forbidden | You are authenticated but may not do this: the resource belongs to someone else, or a usage limit has been reached. |
404 | Not Found | A path id that is not a GUID (no body), or, on some operations, an id that resolves to nothing. See Not found. |
409 | Conflict | The envelope's final documents are still being processed after the last signature. See ENVELOPE_DOCUMENTS_PROCESSING below. |
500 | Internal Server Error | A server-side failure. On the Documents API, some "not found" conditions are also reported as 500 with a specific code; see Not found. |
502 | Bad Gateway | A connected service, such as the drive holding a data source, failed while being read. Nothing is changed; try again later. |
| Status and code | Cause and fix |
401 UNAUTHORIZED, AUTHORIZATION_ERROR | The bearer token or API key is missing, expired or invalid. Get a new token or correct the key. |
400 X_CLIENT_AUTH_ERROR | X-Client-Authorization is missing on an async document operation, or is not a client token from POST /common/client/token. |
401 MISSING_TRANSACTION_TOKEN, INVALID_TRANSACTION_TOKEN | A recipient operation has no tid, or one that does not belong to this envelope. |
401 MFA_SESSION_INVALID | The recipient has multi-factor authentication enabled and no verified session. Send a code with POST /signatures/mfa/initiate, verify it with POST /signatures/mfa/verify, then retry. |
| Code | Meaning and what to do |
VALIDATION_ERROR, REQUEST_BODY_INVALID | The body is missing, is not valid JSON, or fails a validation rule. Read message for the rule and fix the request. |
FORM_DATA_EXPECTED | An upload was not multipart/form-data, or carried no file part. |
INVALID_TEMPLATE_FORMAT, INVALID_DATA_FORMAT | An uploaded file has an extension the endpoint does not accept. See Supported File Formats. |
LIMIT_BREACH (403) | A usage limit has been reached and nothing was done. message names the limit and period. On async document operations this arrives at your callback. |
FILE_UPLOAD_FAILED (500) | An upload could not be stored. A file over the size limit also surfaces as a 500. |
| Code | Meaning and what to do |
TEMPLATE_NOT_FOUND | The template could not be resolved. A storage template is single-use and kept for 24 hours, so a retry with the same id fails: upload it again. |
CONNECTOR_REQUIRED, CONNECTOR_RECONNECT_REQUIRED | The operation needs your connected Microsoft or Google account, and there is none, or it must be reconnected. An account admin manages connectors in the portal under Self-service → Connectors. |
GENERATE_FUNCTION_FAILED (500) | Generation failed. A more specific entry usually comes first in innerErrors, such as LOCALE_DOWNLOAD_FAILED for a locale outside the supported list; see Locales and Timezones. |
CREATE_DOCUMENT_REQUEST_ERROR (500) | A document request could not be created. Check that its time zone, and its Configuration's, is an IANA name — see Locales and Timezones. |
¶ Envelopes and signing
| Code | Meaning and what to do |
DRAFT_ID_INVALID | The envelope is not a Draft, for example because it has already been sent. Only a draft can be updated, sent or deleted. |
ANCHOR_NOT_PROVIDED_POSITION_REQUIRED, ANCHOR_PROVIDED_POSITION_NOT_REQUIRED | Place each field either by anchorString or by a full set of coordinates, never both. See Place Document Fields. |
DUPLICATE_FIELD_NAME | Field names must be unique across the whole envelope, not only within one document. |
MFA_NOT_ALLOWED, ATTACHMENT_FIELD_NOT_ALLOWED, DIGITAL_SIGNATURE_FIELD_NOT_ALLOWED, VIEWER_ROLE_NOT_ALLOWED, INPERSON_ROLE_NOT_ALLOWED | The request is well formed, but your subscription does not include that feature. |
LEGAL_TERMS_NOT_ACCEPTED | A recipient tried to open or sign before accepting the envelope's legal terms. Call accept first. |
ENVELOPE_ACCESS_DENIED (403) | You are not permitted to act on this envelope. Sending, for example, is open only to the envelope's creator. |
ENVELOPE_DOCUMENTS_PROCESSING (409) | Envelope get or document download right after the last signature, while the signed documents are still being processed. Retry after a short wait. |
"Not found" is not reported the same way across the API. Check the status and the code:
| Situation | Response |
| A path id that is not a GUID, on any operation | 404 with no body |
| An envelope, envelope document or Envelope Template id that matches nothing | 400 ENVELOPE_ID_INVALID, DOCUMENT_ID_INVALID or TEMPLATE_ID_INVALID |
| A data source, document template, solution, configuration, document request or document record id that matches nothing | 500 with a …_NOT_FOUND code, such as DATA_SOURCE_NOT_FOUND or DOCUMENT_TEMPLATE_NOT_FOUND |
| A storage file id that has expired or never existed, on document download | 404 NOT_FOUND_BY_ID |
| A storage id that no longer resolves when creating an envelope or Envelope Template | 500 FILE_NOT_EXISTS_IN_STORAGE. Each upload id can be used once, and expires after 24 hours |
| A folder id that matches none of your folders | 404 FOLDER_NOT_FOUND |
The most common "not found" is an id from the wrong field. A document record's id is not the file's urn: GET /documents/document/{documentId}/get takes the record id, while GET /documents/document/{documentId}/download takes the urn. See Three kinds of identifier.
A 500 is a server-side failure, and nothing is persisted. The innerErrors code still tells you what failed. Unless the code says an id matched nothing, retry with backoff. If a 500 persists, contact support via the Support Portal with the operationId, any eventId, and the full response body. See Error Handling for the checklist.