API reference

Templates API

A template keeps the recipient slots and the fields bound to them, so a document made from one can be sent for signature straight away — no signature blocks to place, no fields to map.

Base URL https://xdocs.io/api/v1, with Authorization: Bearer xdk_… on every request. Pagination, rate limits, scopes and error codes are the same for every endpoint and are described once, in how the API behaves.

Templates

A document saved for reuse. Recipient slots and the fields bound to them are kept; the addresses and access codes are stripped, so a template can never quietly send to whoever signed last time.

GET/api/v1/templatesdocuments:read

Saved templates, most recently changed first.

Query parameters

limitinteger
Rows per page, up to 100. Defaults to 50.
cursorstring
The previous page's nextCursor. Opaque — pass it back unchanged.

Returns

{ data: Template[], nextCursor } — id, name, description, kind, pageCount, recipients: [{ id, name, role, routingOrder }], useCount, createdAt, updatedAt

GET/api/v1/templates/:iddocuments:read

One template.

Query parameters

includestring
content adds the body.

Returns

{ data: Template }

POST/api/v1/templatesdocuments:write

Save one of your documents as a template.

Body (JSON)

documentIdstringrequired
The document to copy.
namestring
1–200 characters. Defaults to the document's title plus “template”.
descriptionstring
Up to 2,000 characters.

Returns

201 { data: Template }

  • 422 A spreadsheet, which a template cannot hold: a template keeps a body, and a sheet's body is only its grid worked out.
PATCH/api/v1/templates/:iddocuments:write

Rename or re-describe a template. Its body is fixed at save time.

Body (JSON)

namestring
1–200 characters.
descriptionstring
Up to 2,000 characters.

Returns

{ data: Template }

DELETE/api/v1/templates/:iddocuments:write

Delete a template. Documents made from it are untouched.

Returns

204

← The whole API referenceNext: E-signature API: envelopes →