This guide covers how to position signature fields on a document within an envelope — choosing field types, placing them by coordinates or by anchor text, assigning them to recipients, and styling and validating them. It builds on the Create and Send Envelope guide: everything here goes in the fields array of POST /signatures/envelope/create (or PUT /signatures/envelope/{envelopeId}/update while the envelope is still a draft, or the Envelope Template operations).
Every field needs four things:
type — what the recipient does;name — unique across every field in the request, not just one document;referenceDocumentId — which document it sits on;referenceSignerId (a recipient) or referenceSignGroupId (a sign group);…and a placement: either coordinates or an anchor string.
Fields are placed using X/Y coordinates measured in pixels from the top-left corner of the page: positionX runs left to right and positionY top to bottom, so larger positionY values move the field down the page. page is 1-based. Width and height are also in pixels.
Supply all five of page, positionX, positionY, width and height together — a partial set counts as no coordinates.
To find exact coordinates, open the document in a PDF viewer or browser and inspect the position visually. Most PDF viewers display cursor coordinates in points — multiply by 1.333 to convert to pixels at 96 DPI.
Instead of coordinates, a field can be positioned with anchorString — a distinctive piece of text placed in the document itself. When the envelope is created, Doctavian finds that text and places the field on it, taking the size of the matched text: the length of the anchor determines the width of the field. A .docx is converted to PDF first, and anchors are resolved against the converted PDF.
{
"type": "signature",
"name": "signature_party_a",
"isRequired": true,
"referenceSignerId": 1,
"referenceDocumentId": 1,
"anchorString": "@sig_party_a@"
}Things to know about anchors:
signature_party_a__1, signature_party_a__2 — so read values back and match fields in responses by those suffixed names.@sig_party_a@ rather than Sign here:. The delimiter is a convention, not syntax; any distinctive wrapper works if you use it consistently.A field is positioned by
anchorStringor by coordinates — not both, and not neither. Either mistake is rejected with400.
The type property determines what the recipient sees and does. The most commonly used types are:
| Type | What the recipient does |
|---|---|
signature | Signs by typing, drawing, uploading, or applying a saved signature |
initial | Provides initials rather than a full signature |
date | Pre-populated with the signing date where available |
text | Enters freeform text |
checkbox | Checks or clears a box |
radio | Picks one option from a group |
See the Signature Fields Reference for all 16 types, including digitalsignature and attachment, which your subscription must include.
Include all fields in the fields array. Each needs its own unique name:
"fields": [
{
"type": "signature",
"name": "signature_party_a",
"isRequired": true,
"referenceSignerId": 1,
"referenceDocumentId": 1,
"page": 1,
"positionX": 100,
"positionY": 650,
"width": 200,
"height": 60
},
{
"type": "date",
"name": "date_party_a",
"isRequired": true,
"referenceSignerId": 1,
"referenceDocumentId": 1,
"page": 1,
"positionX": 350,
"positionY": 650,
"width": 120,
"height": 30,
"properties": { "isSignedDate": true }
},
{
"type": "initial",
"name": "initial_page2",
"isRequired": false,
"referenceSignerId": 1,
"referenceDocumentId": 1,
"page": 2,
"positionX": 450,
"positionY": 780,
"width": 80,
"height": 40
}
]properties.isSignedDate: true fills the date field with the date on which the recipient signed.
Each option of a choice is its own radio field. Give every option the same properties.selectionGroup so only one can be selected, and set properties.selectionValue to the text written into the final document when that option is chosen:
{ "type": "radio", "name": "term_12m", "referenceSignerId": 1, "referenceDocumentId": 1,
"page": 2, "positionX": 80, "positionY": 300, "width": 16, "height": 16,
"properties": { "selectionGroup": "contract_term", "selectionValue": "12 months" } },
{ "type": "radio", "name": "term_24m", "referenceSignerId": 1, "referenceDocumentId": 1,
"page": 2, "positionX": 80, "positionY": 330, "width": 16, "height": 16,
"properties": { "selectionGroup": "contract_term", "selectionValue": "24 months" } }The optional properties object controls how the completed value renders — font, size, colour, alignment — and how the field guides the recipient. regexValidation takes a .NET regular expression that the entered value must match:
{
"type": "text",
"name": "company_registration",
"referenceSignerId": 1,
"referenceDocumentId": 1,
"page": 1,
"positionX": 100,
"positionY": 200,
"width": 250,
"height": 30,
"isRequired": true,
"tooltip": "Your company registration number, as shown on your certificate.",
"properties": {
"fontFamily": "Arial",
"fontSize": 12,
"color": "#333333",
"bold": false,
"textAlign": "left",
"placeholder": "e.g. 01234567",
"fieldTitle": "Company no.",
"regexValidation": "^[0-9]{8}$",
"regexValidationMessage": "Enter the 8-digit registration number."
}
}tooltip is shown when the recipient reaches the field, placeholder while it is empty, and fieldTitle as a short badge in the signer's field navigation panel (the field's type is shown when it is omitted). To pre-fill a value, set value; for a read-only note, value is the text shown.
In a multi-recipient envelope, assign each field by matching its referenceSignerId to the recipient's referenceSignerId:
"recipients": [
{ "referenceSignerId": 1, "name": "Jane Smith", "email": "jane@example.com", "role": "signer", "mandatory": true },
{ "referenceSignerId": 2, "name": "John Doe", "email": "john@example.com", "role": "signer", "mandatory": true }
],
"fields": [
{ "type": "signature", "name": "sig_jane", "referenceSignerId": 1, "referenceDocumentId": 1,
"page": 3, "positionX": 80, "positionY": 650, "width": 200, "height": 60, "isRequired": true },
{ "type": "signature", "name": "sig_john", "referenceSignerId": 2, "referenceDocumentId": 1,
"page": 3, "positionX": 320, "positionY": 650, "width": 200, "height": 60, "isRequired": true }
]To let any member of a group complete a field, set referenceSignGroupId instead — never both. See Configure Signing Order for sign groups.
The create response — and signatures-envelope-get — returns every field with its server id, its name, and the resolved recipientId or signGroupId, documentId, page and coordinates (for anchored fields, the coordinates of the match). Use name to map each id to the field you sent. As recipients complete fields, value carries what they entered.
Field validation failures return 400 with the specific problem in error.innerErrors[].code. See Error Handling, and the full field schema in the API Reference.