Build on the Updocly API
Send an Updocly template out for signature from an external system. A single call clones the template to a document, assigns real signers to its placeholder recipients, applies variable values, and sends it through the same path the application uses, including the audit trail and signing emails.
Base URL: https://<your-updocly-host>/api/v1. All requests and responses are JSON; dates are ISO 8601 strings with a timezone. The machine-readable OpenAPI spec ships in the repository as apps/api/openapi.v1.yaml.
Authentication
Create a key in the application under Settings → API. A key is the string updk_ followed by 43 URL-safe characters. The full key is shown once, at creation; Updocly stores a SHA-256 hash of it, so a lost key cannot be recovered, only revoked and replaced.
Include the key on every request, in either header:
Authorization: Bearer updk_...
X-Api-Key: updk_...A missing or invalid key returns 401 with a code of MISSING_API_KEY, INVALID_API_KEY, or API_KEY_REVOKED.
A key grants full account access: it can read every template and envelope the account owns and send documents in the account's name. Treat it like a password: store it server-side only, never in a browser, an application binary, or a repository.
Keys
Three endpoints manage keys. They are authenticated by the application's normal login session (a JWT bearer token from /api/auth/login), never by an API key, so a leaked API key cannot create additional keys.
| Method | Path | What it does |
|---|---|---|
POST | /api/api-keys | Create a key. Body {"name": "CRM integration"}. The response's key field is the full secret and is never shown again. |
GET | /api/api-keys | List keys: name, prefix, created, last used, revoked. Never the key or its hash. |
DELETE | /api/api-keys/:id | Revoke. The row stays, marked revokedAt, so the list still shows what existed. |
The creation response. The key field is the full secret and is not returned again:
{
"key": "updk_wJalrXUtnFEMI7K8M2dGnFpxfRLkq3vT9yBz5cQaXhE",
"apiKey": {
"id": "66f1a2b3c4d5e6f7a8b9c0d1",
"name": "CRM integration",
"prefix": "updk_wJa",
"createdAt": "2026-09-05T09:30:00.000Z"
}
}Revocation is immediate: a revoked key fails from the next request. There are no per-key scopes; every key can perform every operation the v1 surface offers.
Send a template
Sending a template performs three steps in one call:
- Clone. The template is instantiated to a fresh document; the template itself is never modified, so the same template can be sent any number of times.
- Assign. Each placeholder recipient in the template (for example "Tenant" or "Landlord") is resolved to a real person's name and email from the request. Every non-sender placeholder must be mapped; otherwise the call is refused with
422and the missing placeholders are named. - Send. The content is frozen into an envelope snapshot, signing links are minted and emailed to the first order group, and the audit trail records
envelope.created.
GET /v1/templates
Lists the account's templates with the information needed to send them: placeholder recipients to map and variables to fill. Paginated with ?page= and ?limit= (default 20, max 100).
curl "$BASE_URL/api/v1/templates" -H "Authorization: Bearer $UPDOCLY_KEY"{
"items": [
{
"id": "66f1a2b3c4d5e6f7a8b9c0d2",
"name": "Lease agreement",
"description": "Standard 12-month residential lease",
"pageCount": 3,
"recipients": [
{ "id": "r-tenant", "name": "Tenant", "role": "signer", "order": 1 },
{ "id": "r-landlord", "name": "Landlord", "role": "signer", "order": 2 },
{ "id": "r-guarantor", "name": "Guarantor", "role": "signer", "order": 3 }
],
"variables": [
{ "name": "rent.amount", "label": "Monthly rent", "type": "currency", "defaultValue": "1000", "required": true },
{ "name": "lease.start", "label": "Start date", "type": "date", "defaultValue": "", "required": false }
],
"createdAt": "2026-08-01T10:00:00.000Z",
"updatedAt": "2026-09-01T10:00:00.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}recipients[].name is the placeholder label the template's author typed, not a real person. A recipient with role sender is the template's author; they are filled in automatically, do not appear in this list, and must not be mapped.
Identifying recipients
Each entry in recipients names a placeholder (recipientId) and identifies the person for it in exactly one of three ways:
contactId: the id of a contact stored in the account. The contact supplies the name and email. Anamesent alongsidecontactIdoverrides the contact's saved name for this envelope.emailalone: the address is matched, case-insensitively, against the account's contacts. If a contact matches, its name is used. If no contact matches,nameis required and the call is refused with422 RECIPIENT_NAME_REQUIREDuntil one is provided.emailandname: the person is used exactly as given; no contact is needed.
Sending both contactId and email in one entry is refused with 422 RECIPIENT_AMBIGUOUS; sending neither is refused with 422 RECIPIENT_IDENTIFIER_REQUIRED. Sending never creates or modifies a contact: a person identified by an unknown email is used for that envelope only.
GET /v1/contacts
Lists the account's contacts as id, name, and email, newest first, paginated like the other listings, so a sender can find the contactId for a saved person. An empty email marks a half-filled contact that cannot receive a signing link until one is added in the application. Contacts cannot be created or modified through the API.
curl "$BASE_URL/api/v1/contacts" -H "Authorization: Bearer $UPDOCLY_KEY"POST /v1/envelopes
The one-call send described above. The example maps its three placeholders using each identification form: a contact id, a bare email that matches a contact, and an email with an explicit name.
curl -X POST "$BASE_URL/api/v1/envelopes" \
-H "Authorization: Bearer $UPDOCLY_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "66f1a2b3c4d5e6f7a8b9c0d2",
"title": "Lease - 42 Elm Street",
"message": "Please review and sign your lease.",
"expiresInDays": 14,
"recipients": [
{ "recipientId": "r-tenant", "contactId": "66f1a2b3c4d5e6f7a8b9c0e5" },
{ "recipientId": "r-landlord", "email": "lana@example.com" },
{ "recipientId": "r-guarantor", "name": "Gary Guarantor", "email": "gary@example.com" }
],
"values": {
"rent.amount": "1450",
"lease.start": "2026-10-01"
}
}'| Field | Required | Meaning |
|---|---|---|
templateId | yes | A template the key's account owns. |
recipients | yes | One entry per non-sender placeholder: recipientId from the template listing, plus one identification form (contactId, email, or email and name). Every placeholder must be mapped, each exactly once. |
title | no | Document and envelope title. Defaults to the template's name. |
message | no | Note included in every signing invitation. |
expiresInDays | no | Number of days each signing link stays valid, 1 to 365. Defaults to the server's configured TTL. |
values | no | Variable values by name, overriding the template's defaults. Every name must be a variable the template declares. |
The response, 201:
{
"envelope": {
"id": "66f1a2b3c4d5e6f7a8b9c0d3",
"status": "sent",
"title": "Lease - 42 Elm Street",
"documentId": "66f1a2b3c4d5e6f7a8b9c0d4",
"recipients": [
{
"id": "r-tenant",
"name": "Terry Tenant",
"email": "terry@example.com",
"role": "signer",
"order": 1,
"status": "notified"
},
{
"id": "r-landlord",
"name": "Lana Landlord",
"email": "lana@example.com",
"role": "signer",
"order": 2,
"status": "pending"
},
{
"id": "r-guarantor",
"name": "Gary Guarantor",
"email": "gary@example.com",
"role": "signer",
"order": 3,
"status": "pending"
}
],
"sentAt": "2026-09-05T09:31:00.000Z",
"createdAt": "2026-09-05T09:31:00.000Z",
"updatedAt": "2026-09-05T09:31:00.000Z"
}
}Recipients sign in their template order: notified means the invitation has been sent, pending means an earlier signer has not yet finished. Signing links are delivered to recipients by email; the API never exposes them. A template with a required variable left empty, or content that overflows its boxes, is refused with the same errors the application's own send action receives.
Envelopes
GET /v1/envelopes/:id
One envelope with current signing status per recipient, in the same shape as the send response. 404 if the envelope does not belong to the key's account.
curl "$BASE_URL/api/v1/envelopes/66f1a2b3c4d5e6f7a8b9c0d3" \
-H "Authorization: Bearer $UPDOCLY_KEY"Recipient status moves through pending, notified, viewed, signed, or declined. Envelope status moves through sent, viewed, partiallySigned, completed, declined, voided, or expired.
GET /v1/envelopes
Paginated list of the account's envelopes, newest first, same item shape.
curl "$BASE_URL/api/v1/envelopes?page=1&limit=20" \
-H "Authorization: Bearer $UPDOCLY_KEY"Webhooks
Instead of polling, Updocly can POST envelope events to your server as they happen: envelope.sent, envelope.viewed (first open), envelope.completed, envelope.declined, envelope.voided, envelope.expired. One event per envelope transition, not per recipient action. Manage endpoints under Settings → API or over HTTP; the key-authed surface mirrors the application's exactly.
| Method | Path | What it does |
|---|---|---|
| POST | /v1/webhooks | Create an endpoint. Body {"url": "https://...", "events": [...]}. The response carries the whsec_ signing secret alongside the webhook. |
| GET | /v1/webhooks | List endpoints: URL, events, active flag, last delivery time and status. Never the secret. |
| PATCH | /v1/webhooks/:id | Change url, events, or active. Reactivating after a 410 deactivation is {"active": true}. |
| DELETE | /v1/webhooks/:id | Delete the endpoint and discard its queued retries. 204. |
| GET | /v1/webhooks/:id/secret | Return the signing secret again. It signs every delivery, so unlike an API key it stays retrievable; each reveal is logged. |
| POST | /v1/webhooks/:id/ping | Queue a test delivery of type ping through the real pipeline, signature and retries included. 202. |
URL rules: https required, public addresses only. http is allowed for localhost while you develop a receiver; private and internal addresses are refused with WEBHOOK_URL_NOT_ALLOWED as an SSRF guard. Self-hosted deployments can relax this in development with WEBHOOK_ALLOW_PRIVATE_URLS=true on the API; never in production.
The delivery
Each event is one POST with a JSON body. data.envelope is exactly the shape GET /v1/envelopes/:id returns, so you parse one shape whether you polled or were pushed. id is stable across retries: treat it as your idempotency key.
{
"id": "evt_5f2c1a9d8e3b4a7c6d5e4f3a2b1c0d9e",
"type": "envelope.completed",
"createdAt": "2026-09-05T10:15:00.000Z",
"data": {
"envelope": { "id": "66f1a2b3c4d5e6f7a8b9c0d3", "status": "completed", "...": "..." }
}
}Content-Type: application/json
X-Updocly-Event: envelope.completed
X-Updocly-Signature: t=1757067300,v1=5257a869e7...Respond with any 2xx within 10 seconds; the response body is ignored.
Verifying the signature
v1 is the hex HMAC-SHA256, keyed with your endpoint's whsec_ secret, of the string t + . + the raw request body. The timestamp is inside the signed material, so a captured delivery cannot be replayed with a fresh-looking header. In Node, with no dependencies:
const { createHmac, timingSafeEqual } = require('node:crypto');
// rawBody must be the exact bytes received, BEFORE any JSON parsing.
function verify(secret, signatureHeader, rawBody, toleranceSeconds = 300) {
const parts = new Map(signatureHeader.split(',').map((p) => p.split('=', 2)));
const t = Number(parts.get('t'));
const v1 = parts.get('v1');
if (!Number.isInteger(t) || !v1) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const a = Buffer.from(expected, 'hex');
const b = Buffer.from(v1, 'hex');
return a.length === b.length && timingSafeEqual(a, b);
}Retries and 410
A delivery that does not get a 2xx - another status, a timeout, a refused connection - is retried after 1 minute, 5 minutes, 30 minutes, and 2 hours, five attempts in total, then marked failed. Deliveries are persisted server-side, so an API restart delays them rather than losing them. Ordering is not guaranteed under retry; use createdAt when order matters.
Answering 410 Gone deactivates the endpoint: no further deliveries for any event until it is reactivated with PATCH. It is the receiver-side unsubscribe - use it when tearing a receiver down.
POST, GET, DELETE /v1/hooks
A second surface for the same deliveries, shaped for automation platforms rather than for a person. /v1/webhooks above is the settings page with a key instead of a session: someone decides an account should have an endpoint, and that endpoint outlives any particular use of it. /v1/hooks is the subscribe and unsubscribe pattern Zapier, Make and n8n speak, one subscription per automation, created when the automation is switched on and deleted when it is switched off, with nobody watching either event.
The difference that matters is ownership. A row created here belongs to the key as well as the account, and this surface can only see and delete rows its own key created. So disconnecting an automation tidies up exactly what it made: not the endpoint you configured by hand, and not the one another integration is still using. Without that rule, "clean up on disconnect" and "do not break the other integration" would be the same DELETE, and one of them has to lose.
Errors
Every error is JSON with a machine-readable code, a human message, a requestId to quote when reporting a problem, and sometimes details. Branch on code, never on message; messages may be reworded.
{
"code": "UNMAPPED_RECIPIENT",
"message": "Every recipient needs a real person. Missing: \"Landlord\"",
"requestId": "6a1f...",
"details": { "recipients": [{ "id": "r-landlord", "name": "Landlord", "role": "signer" }] }
}| HTTP | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | The body or query did not parse. details lists the offending paths. |
| 400 | MISSING_REQUIRED_VARIABLE | A required variable has no value after values were applied. details.variables names them. |
| 400 | CONTENT_OVERFLOW | A text element has outgrown its box; the document cannot be sent until the template is fixed. |
| 401 | MISSING_API_KEY | No key in the request. |
| 401 | INVALID_API_KEY | The key is malformed or does not exist. |
| 401 | API_KEY_REVOKED | The key existed and was revoked. |
| 404 | TEMPLATE_NOT_FOUND | No such template in this account. Another account's template returns the same answer. |
| 404 | ENVELOPE_NOT_FOUND | No such envelope in this account. |
| 409 | ENVELOPE_ALREADY_ACTIVE | The document already has a live envelope. Cannot occur through this API's own flow, which clones a fresh document per send. |
| 422 | UNMAPPED_RECIPIENT | A non-sender placeholder has no entry in recipients. details.recipients lists them. |
| 422 | UNKNOWN_RECIPIENT | A recipientId the template does not have, or its sender. details.recipientIds lists them. |
| 422 | DUPLICATE_RECIPIENT | The same recipientId was mapped twice. |
| 422 | RECIPIENT_IDENTIFIER_REQUIRED | A recipient entry has neither contactId nor email. details.recipientIds lists them. |
| 422 | RECIPIENT_AMBIGUOUS | A recipient entry has both contactId and email. Send exactly one. details.recipientIds lists them. |
| 422 | CONTACT_NOT_FOUND | A contactId that does not exist in this account. Another account's contact returns the same answer. details.contactIds lists them. |
| 422 | CONTACT_MISSING_EMAIL | The contact has no email address, so no signing link can be delivered. Add an email to the contact or identify the recipient by email. details.contactIds lists them. |
| 422 | RECIPIENT_NAME_REQUIRED | The email matches no contact in this account (or the matched contact has no saved name), so name is required. Sending does not create a contact. details.recipientIds lists them. |
| 422 | UNKNOWN_VARIABLE | A values name the template does not declare. details.variables lists them. |
| 400 | WEBHOOK_URL_NOT_ALLOWED | The webhook URL is not https, or points at a private or internal address. See the URL rules under Webhooks. |
| 400 | WEBHOOK_INACTIVE | Ping refused because the endpoint is deactivated; reactivate it first. |
| 404 | WEBHOOK_NOT_FOUND | No such webhook endpoint in this account. Another account's endpoint returns the same answer. |
| 429 | RATE_LIMITED | Over a rate limit: 60 requests per minute per key, or 100 envelope sends per hour per key. Retry-After says how long to wait. |
Use Updocly from Claude
Updocly speaks MCP, the protocol AI assistants use to call tools. The hosted endpoint is POST /api/mcp, authenticated with the same API key as everything above: connect it and Claude can list templates and contacts, send a template for signature, and check envelope status. Ask it to "send the lease to terry@example.com" and it maps the placeholders, fills the variables, and sends through the same one-call endpoint documented above.
On claude.ai and Claude Desktop, add it as a custom connector: Settings, Connectors, "Add custom connector", with the URL https://updocly.com/api/mcp. Claude walks through Updocly's own sign-in and consent screen (OAuth with PKCE), and the connection appears under Settings, API as a revocable key.
In Claude Code, one command connects it:
claude mcp add --transport http updocly \
"https://<your-updocly-host>/api/mcp" \
--header "Authorization: Bearer updk_..."Any MCP client that can send an Authorization header (Cursor, VS Code, and friends) connects the same way. For Claude Desktop, the repository also ships the same tools as a local stdio server, @updocly/mcp:
{
"mcpServers": {
"updocly": {
"command": "node",
"args": ["/path/to/superdoc/packages/mcp/dist/index.js"],
"env": {
"UPDOCLY_API_URL": "https://<your-updocly-host>/api",
"UPDOCLY_API_KEY": "updk_..."
}
}
}
}Both are thin clients of the v1 endpoints and add no capability a key does not already have. Scopes still apply: connect a read-only key and the send tool politely refuses. Within its scopes a key acts as your account, so this is a setup for your own machine or server, never one to hand to a third party. Details are in docs/MCP.md in the repository.
Use Updocly from ChatGPT
ChatGPT speaks to the same MCP endpoint. In ChatGPT, enable developer mode under Settings, Apps and connectors, then add a connector with the URL https://updocly.com/api/mcp and authentication set to OAuth - the same sign-in and consent flow Claude uses. A custom GPT with an Action is the alternative: import the schema at apps/api/openapi.v1.yaml and authenticate with an API key. Both run from OpenAI's servers, so either needs a deployment on a public https host; they cannot reach localhost.
- Create a dedicated key under Settings → API, and set the schema's
serversURL to your host. - In ChatGPT, create a GPT, add an action, and paste the schema. Configure authentication as API Key, type Bearer, with the raw
updk_key. - Ask it to list your templates, then to send one.
The key is stored in the GPT, so anyone who can use the GPT acts with the key's full account access. Keep the GPT private, and revoke the key to cut it off. The full walkthrough, a worked conversation, and the import troubleshooting are in docs/CHATGPT.md in the repository.
Limits
The v1 surface is templates, contacts, envelopes, and webhooks: list templates and contacts, send a template, read the result, and be told when it changes.
- Webhook deliveries retry on a fixed ladder and then stop; there is no delivery log in the UI, only each endpoint's last delivery status.
- No per-key scopes or expiry; a key grants full account access until revoked, so store it server-side.
- Each key allows 60 requests per minute across the whole v1 surface, webhook management included, and 100 envelope sends per hour from a separate pool. Every v1 response carries
X-RateLimit-Limit,X-RateLimit-Remaining, andX-RateLimit-Reset(epoch seconds); going over returns429 RATE_LIMITEDwithRetry-After. - No API access to documents, PDFs, or template editing. Contacts can be listed and referenced by
contactIdor email when sending, but cannot be created or modified through the API. - No sandbox mode. Every send emails real recipients.
To get started, create an account, build or select a template, and create a key under Settings → API.