REFERENCE

Template links reference

Publish, list, rotate and delete shareable template links, and mint an embeddable URL for one.

All documentation

Six endpoints for publishing a template as a link anyone can sign. For the worked example, read template links. Requires the Business or Ultimate plan, same as the rest of the API.

The link object

json
{
  "id": "lnk_2f8d...",
  "slug": "k4m9xa",
  "url": "https://app.documentesign.com/start/k4m9xa",
  "template_id": "tpl_4c8a...",
  "label": "Supplier NDA - website",
  "headline": "Sign our mutual NDA",
  "message": null,
  "redirect_url": null,
  "expires_at": null,
  "max_uses": 500,
  "use_count": 12,
  "enabled": true,
  "signers": [
    { "placeholder_id": "ph_1", "role": "Supplier",
      "is_open": true, "name": null, "email": null }
  ],
  "created_at": "2026-09-01T10:00:00.000Z"
}
POST/v1/templates/{id}/links
Requires templates:write
Body
FieldTypeNotes
signersobject[]requiredOne entry per signer role on the template. Exactly one must be open.
signers[].placeholder_idstringrequiredFrom roles[].id on GET /v1/templates/{id}.
signers[].is_openbooleanrequiredTrue for the role the visitor fills.
signers[].name / emailstringRequired on every signer that is not open, else 400 assigned_signer_incomplete.
labelstringInternal name, up to 120 chars.
headline / messagestringShown to the visitor above the form.
redirect_urlstringWhere to send them after signing. Must be https://.
expires_atstringISO 8601.
max_usesintegerThe link stops working after this many completed starts.

Returns 201 with the link object.

GET/v1/templates/{id}/links
Requires templates:read

Every link published for one template, newest first: { "data": [ ... ] }.

GET/v1/template-links/{linkId}
Requires templates:read

Returns the link object. An id in another workspace returns 404, the same way documents and templates do.

POST/v1/template-links/{linkId}/embed-link
Requires templates:write
Body (optional)
FieldTypeNotes
expires_ininteger60 to 3600 seconds. Defaults to 900.
200 OK
{ "url": "https://app.documentesign.com/start/embed/eyJ...",
  "expires_at": "2026-09-01T10:15:00.000Z" }
Why this exists
The plain url on the link object is a full page and is served with frame-ancestors 'none', so a browser will not put it in an iframe. This mints a short-lived signed envelope for a frameable URL instead. The envelope carries the link id, so rotating the slug does not break an embed you have already deployed.
POST/v1/template-links/{linkId}/rotate
Requires templates:write

Issues a new slug and returns the updated link. The old URL stops working immediately. Outstanding embed envelopes keep working, because they reference the link rather than the slug - delete the link if you need to kill those too.

DELETE/v1/template-links/{linkId}
Requires templates:write
200 OK
{ "id": "lnk_2f8d...", "deleted": true }

Permanent. Documents already created from the link are unaffected.

Errors
FieldTypeNotes
exactly_one_open_role_required400Zero or more than one signer was marked open.
assigned_signer_incomplete400A non-open signer is missing a name or email.
signers_incomplete400Not every signer role on the template was covered.
template_not_published409Publish the template before you publish a link for it.
template_has_no_signer400The template has no signer roles.
embedding_not_configured409No origins on the workspace embed allowlist.
template_link_disabled / template_link_expired409Cannot mint an embed URL for a link that is not usable.
template_link_not_found404Unknown id, or a link in another workspace.
entitlement_required:template_share_links_enabled402The plan does not include shareable links.