Send a template through the API

Create a key in Settings, read a template with GET /v1/templates, and send it for signature with one POST from your own system.
About 12 minutes to read and follow along.
The v1 API does one job well: it sends an Updocly template out for signature from an external system. A single call clones the template to a fresh document, assigns real people to its placeholder recipients, applies variable values, and sends it through the same path the application uses, audit trail and signing emails included.
Create a key
- Open Settings and go to the API tab. Give the key a name under "Key name" - what it is for, e.g. "CRM integration" - and click "Create key".
- Copy the key from "Your new API key" immediately. As the panel says, this is the only time it will be shown; Updocly stores a hash, not the key, and cannot show it again.
- Keep it server-side. A key grants full account access, so it belongs in your backend's secrets, never in a browser or a repository. If one leaks, "Revoke" kills it from the next request.

Read the template
Send the key on every request, as "Authorization: Bearer updk_..." or in an "X-Api-Key" header. Start with GET /v1/templates: it lists your templates with exactly what you need to send one - the placeholder recipients to map and the variables to fill, each variable with its type, default, and whether it is required.
The recipients in that listing are placeholders, not people: "Tenant" or "Landlord", as the template's author named them. A recipient with the role "sender" is the author, is filled in automatically, and must not be mapped.
The one call
- POST /v1/envelopes with the templateId and one recipients entry per placeholder, each naming its recipientId from the listing.
- Identify each person in exactly one of three ways: a contactId of a saved contact, which supplies name and email; an email alone, matched against your contacts, refused with 422 RECIPIENT_NAME_REQUIRED if nothing matches; or an email and a name together, used exactly as given, no contact needed.
- Pass values for the template's variables, and optionally a title, a message for the invitation emails, and expiresInDays for a deadline.
- A 201 comes back with the envelope: its id, its status, and each recipient as "notified" (invited) or "pending" (waiting on an earlier signer).
Every non-sender placeholder must be mapped, each exactly once, or the call is refused with a 422 that names the missing ones. Sending never creates or modifies a contact.
Check status
GET /v1/envelopes/:id returns the envelope with current signing status per recipient: pending, notified, viewed, signed, or declined, while the envelope itself moves through sent, viewed, partiallySigned, and completed, or ends in declined, voided, or expired. If your system should react without polling, add a webhook endpoint under Settings, in the API tab; Updocly then POSTs a signed event on every envelope transition, and this endpoint remains for reads.
Every error is JSON with a machine-readable code and a requestId to quote; branch on the code, never the message. The full reference - every endpoint, field, error code, and the current limits - is on the developers page.
Keep going
Use Updocly from Claude and ChatGPT