Signatures

Envelope Sign

Markdown for LLMs
POST
/signatures/envelope/sign

Applies the field values of the recipient a tid identifies and completes their part of the envelope. Take the field ids from signatures-envelope-open, and send one fields entry for each field assigned to the recipient that they fill, including every field whose isRequired is true.

The value of a signature, digitalsignature, initial, stamp or drawing field is an image as raw Base64-encoded PNG or JPEG data, without a data: prefix — the form savedSignatures[].data takes on open. A value in another form, a data URI included, is rejected with FIELD_IMAGE_INVALID, naming the field id in innerErrors[].urn.

The recipient must have accepted the legal terms with signatures-envelope-accept first (LEGAL_TERMS_NOT_ACCEPTED otherwise) and, when their isMfaEnabled is true, verified a multi-factor authentication code (401 MFA_SESSION_INVALID otherwise). A recipient who has already signed is rejected with SIGNER_OR_GROUP_ALREADY_COMPLETED. A required field left out of fields, or sent with an empty value, is rejected with REQUIRED_FIELD_MISSING, and an id that is not one of the recipient's fields with INVALID_SIGNER_FIELDID_OR_MISSING_FIELDS; both name the field id in innerErrors[].urn. Leaving fields out is the same as sending an empty array, so it is rejected with REQUIRED_FIELD_MISSING whenever the recipient has a required field.

When the last mandatory recipient signs, the envelope's documents are processed in the background. Until that finishes, signatures-envelope-get and signatures-envelope-document-download return 409 ENVELOPE_DOCUMENTS_PROCESSING; signatures-envelope-check reports the envelope's status as Completed once processing succeeds, or Failed if it does not.

For an in-person signer, the host must be a logged-in user matching the recipient's hostEmail (HOST_USER_NOT_MATCHING otherwise). A request that carries digitalsignature fields takes a further client-side step: the call returns 202 instead of 200 with the partial-hash response in result.data.fields. The field values are saved, but the recipient's part is not complete until the client finishes the hash exchange, sending the field's certificate and signedData.

No bearer token is required. This operation is open to guest callers — a recipient with no Doctavian account, acting from the link in their email — who are identified by the tid from that link instead of a token. The API key is still required, as on every operation: send it in the X-Api-Key header or the x-api-key query parameter. When the call carries no bearer token, the caller is anonymous and the response carries no userId.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Query Parameters

tid*string

Transaction token identifying one recipient position on one envelope. It reaches the recipient in the link of their notification email — or, for an inpersonsigner, reaches the host named in hostEmail — and signatures-envelope-list returns it as transactionTokenId on entries for positions the caller holds.

Mandatory, and checked even when the call also carries a bearer token. A value that is not a GUID, or a GUID that matches no token, is rejected with 401 INVALID_TRANSACTION_TOKEN, and an empty value (?tid=) with 401 MISSING_TRANSACTION_TOKEN. Leaving the parameter out matches no operation and is answered with 404 NOT_FOUND from the gateway.

Formatuuid

Request Body

application/json

Mandatory in practice: fields carries the values to apply. A request with no body, or one that is not valid JSON, is rejected with 400 REQUEST_BODY_INVALID.

TypeScript Definitions

Use the request body type in TypeScript.

Request body for signing an envelope.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/signatures/envelope/sign?tid=6c82c35c-ded7-4b49-83a1-e5fed49a0e69" \  -H "Content-Type: application/json" \  -d '{    "fields": [      {        "id": "1f970361-4db0-4b3d-96ba-a1ecf45c217c",        "value": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="      },      {        "id": "01c27964-6b11-4356-ad1d-90a12eeafbdb",        "value": "PO-4471"      }    ],    "externalContext": {      "id": "12345"    }  }'
{  "result": {    "statusCode": 200,    "message": "OK",    "data": {      "envelope": {        "id": "407a5449-8e45-48c5-bfee-9642c17a0d3d"      }    }  },  "externalContext": {    "id": "12345"  },  "origin": "POST https://api.doctavian.com/v1/signatures/envelope/sign",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "14a655d1761495a881ac65db22579a4e"}
{  "result": {    "statusCode": 202,    "message": "Accepted",    "data": {      "fields": [        {}      ]    }  },  "externalContext": {    "id": "12345"  },  "origin": "POST https://api.doctavian.com/v1/signatures/envelope/sign",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "b801b204836bbf6257561267c0cb1198"}
{  "error": {    "statusCode": 400,    "message": "Bad Request",    "innerErrors": [      {        "code": "REQUIRED_FIELD_MISSING",        "message": "Required field is empty.",        "userMessage": "Required field is empty.",        "urn": "1f970361-4db0-4b3d-96ba-a1ecf45c217c"      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/signatures/envelope/sign",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "d75700fb03fba3a67c5d417834658d33"}
{  "error": {    "statusCode": 401,    "message": "Unauthorized",    "innerErrors": [      {        "code": "INVALID_TRANSACTION_TOKEN",        "message": "Transaction token identifier is invalid or does not exist in the database.",        "userMessage": "Transaction token identifier is invalid. Please make sure that you are accessing this page via the link from your email."      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/signatures/envelope/sign",  "dateTime": "2026-10-15T09:51:05.000Z",  "operationId": "d50c8560f9abcfcf05909d64a6ed568a"}
{  "error": {    "statusCode": 404,    "message": "Not Found",    "innerErrors": [      {        "code": "NOT_FOUND",        "message": "OperationNotFound",        "userMessage": "Unable to match incoming request to an operation."      }    ]  },  "origin": "",  "dateTime": "2026-10-16T07:34:38.000Z"}
{  "error": {    "statusCode": 500,    "message": "Internal Server Error",    "innerErrors": [      {        "code": "FUNCTION_EXECUTION_ERROR",        "message": "An error occurred during function execution.",        "userMessage": "An error occurred during function execution.",        "eventId": "3914bcfd-fb75-47fe-a94d-40bf22bf02d3"      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/signatures/envelope/sign",  "dateTime": "2026-10-20T10:41:27.000Z",  "operationId": "7b3d0a2d409fb31652fb3917cab4b83d"}