A document must be uploaded to Doctavian Storage before it can be included in an envelope — there is no way to send document content inline with the envelope. Upload returns a storage id, which you reference as the document's urn in the envelope create body. Each document in the envelope then carries the signing fields — the placeholders that define where and how each recipient must interact with it.
Documents are uploaded via POST /signatures/document/upload as multipart/form-data. Send one or more PDF or DOCX files in the file part; the response returns one storage id per file, in the order sent.
POST https://api.doctavian.com/v1/signatures/document/upload
Authorization: Bearer <token>
x-api-key: <api-key>
Content-Type: multipart/form-data
file: <nda-agreement.pdf>"files": [
{ "id": "af567f07-cafa-4d5c-830c-0f24af7555df", "fileName": "nda-agreement.pdf" }
]Accepted formats and size limits are in Supported File Formats.
An uploaded document is held in Storage for 24 hours. Creating an envelope or Envelope Template from it moves the file into the envelope, so each id can be used once. To use the same file in another envelope, or when you update a draft, upload it again. See Storage and File IDs.
Any other Storage file id also works as a urn — for example the urn of a document generated with Document Generation using deliveryMethod Storage, which lets you generate a contract and send it for signature without downloading it in between.
"documents": [
{
"referenceDocumentId": 1,
"name": "NDA Agreement",
"loadMethod": "Storage",
"urn": "af567f07-cafa-4d5c-830c-0f24af7555df",
"externalContext": { "contractId": "NDA-2026-0187" }
}
]referenceDocumentId is an integer you choose, unique within the request, that fields use to say which document they sit on. It is not echoed back.name is the document's display name within the envelope.loadMethod is always Storage, and urn is the storage id from upload.externalContext is your own object, stored with the document and echoed back by create, get and status callbacks. Use it to match a returned document id to the document you sent.Signing operates on PDF only, so a .docx document is converted to PDF while the envelope is created. The converted PDF is what recipients see and sign, and anchor text is resolved against it. The envelope keeps the source file too, listed under originalDocuments when you get the envelope.
Fields define where and how each recipient must interact with a document — where to sign, where to initial, where to enter a date or a text value. Each field is linked to its document via referenceDocumentId, and to its owner via referenceSignerId (a recipient) or referenceSignGroupId (a sign group). It is positioned either by anchor text found in the document or by page, X/Y coordinates and dimensions in pixels.
Fields also carry optional styling and behaviour — font, size, colour, alignment, placeholder, validation pattern — that control how the completed value is rendered and how the recipient is guided.
See the Signature Fields Reference for all supported field types, placement rules and properties.
A digitalsignature field requires a PKI certificate for validation, producing a certificate-backed signature embedded in the PDF. This is distinct from standard signature fields, which the recipient can type, draw, upload or apply from a saved signature. Your subscription must include digital signatures. See Digital Signatures and Signing for how they work during the signing session.
Ready to put this into practice? See Place Document Fields for a step-by-step guide to positioning fields on a document.
Once a document is in an envelope, address it by its envelope document id (documents[].id on the envelope), not by the storage id you uploaded with. Download it with GET /signatures/envelope/{envelopeId}/document/{documentId}/download; after the last signature this returns the signed document. Right after completion it returns 409 ENVELOPE_DOCUMENTS_PROCESSING for a short while; retry shortly.
Envelope document download also accepts a recipient's tid instead of a bearer token, so a signing interface can show the document to a recipient without a Doctavian account.
To copy, move or convert a file between Storage, OneDrive and Google Drive, see Convert, Copy and Move Documents. See the full set of document endpoints in the API Reference.