Developer

Text tags: put signature fields in a Word or PDF file before you upload

Text tags let a document say where each field goes. Type a tag such as {{signature:1}} in your Word or PDF source, send the file through the DocAISign API, CLI or MCP server, and each tag becomes a field for that recipient. Tags are not read when you upload a file in the web editor.

The syntax

A tag is {{type:recipient}}, optionally followed by :Label, :required or :optional, and :options=A|B for a dropdown. The recipient is the person's position in the envelope's recipient list, so 1 is the first. Do not put spaces inside a tag. In a label, an underscore stands for a space.

Tenant: {{signature:1}}     Date: {{date:1}}
Initials: {{i:2}}           Company: {{text:2:Company_name:optional}}
Plan: {{dropdown:1:Plan:options=Basic|Pro}}
PO number: {{text:0:PO_number}}

Field types and defaults

Fields are required by default, except checkboxes, which are optional unless you add :required. A document can hold up to 300 tags.

  • Signing marks: signature (s), initials (i), stamp
  • Filled for the signer: date (d), name (n), email (e)
  • Typed or chosen: text (t), number, company, title, dropdown, radio, checkbox (c)
  • Files: attachment
  • Recipient 0 cannot take a signature, initials or attachment tag

Send a tagged document

With the REST API, send textTags: true in POST /api/v1/envelopes. The fieldValues object fills your recipient 0 fields by label, with a space where the tag had an underscore. The CLI send command and the MCP send_document tool read tags by default. If a document has no tags and no other fields, those two add a signature page instead.

Add the X-Test-Mode: true header while you try this out. Test envelopes are free and watermarked.

{
  "document": { "url": "https://example.com/lease.pdf" },
  "recipients": [
    { "name": "Ana Diaz", "email": "[email protected]" },
    { "name": "Ben Lee", "email": "[email protected]" }
  ],
  "textTags": true,
  "fieldValues": { "PO number": "4411" }
}

Source: DocAISign developer docs (opens in a new tab) ↗

What happens to each tag

DocAISign covers each tag in white and places a field of that type where the tag was. Word files are converted to PDF first, and the tags are read from the converted pages. A signature box sits on the tag's line, and other fields are centred on it.

Field width comes from the type, not from the space you leave. A tag longer than the usual width keeps its own width. If the next text on the line is close, the box stops before it, so it does not cover a Date label beside it.

  • Signature: about 130 points wide, at least 30 points tall
  • Text and most other fields: about 100 points wide
  • Date: about 80 points wide
  • Initials: about 45 points wide

Layout tips

A little spacing in the source file prevents most layout problems. There are 72 points in an inch, so a signature needs a little under 2 inches of clear space on its line.

  • Leave clear space after a tag so the field can reach its full width
  • Leave a blank line above a signature tag, because the box grows upward from the line
  • Keep each tag on one line so it does not wrap
  • Check a Word file in test mode, because conversion can move lines

Errors you may see

A tag with a mistake stops the request with a message naming that tag, instead of placing a wrong field. Fix the source file and send it again.

  • Unknown field type, such as {{sig-here:1}}
  • Recipient number above 20, or higher than the number of recipients you listed
  • A dropdown with no options
  • A fieldValues label that matches none of your fields

When to use something else

Text tags suit documents you control. If someone else wrote the PDF, upload it in the web editor and let auto-detect find the signature lines. If you upload a tagged file in the web editor, the tags are not converted and stay in the document as plain text. A scanned page has no readable text, so tags on it are not found either.

Common questions

Can I hide tags by making them white in my source file?

You can, because tags are read from the text and not from their color. They are covered in white during processing anyway, so this mainly keeps your draft tidy.

Can I create a template from a tagged document?

Yes. POST /api/v1/templates takes the same body as an envelope plus a name, and the recipients become the template's roles.

How do I turn tag reading off in the CLI?

Add --no-text-tags to the send command, and any {{...}} text is left alone.