API & Embedded Signing

Let people sign documents without leaving your website or app.

Overview

There are two ways to embed signing:

  • Public form links: turn a template into a link anyone can open and sign, and paste it on your website as an iframe. Works on every plan; no developer needed. Best for waivers, intake forms, and agreements everyone signs the same way.
  • API with embedded signing: your server creates a document for a specific person, asks us for a one-time signing URL, and shows it in your app. Webhooks tell you when it's signed. Requires a plan with API access.

Both are configured on the Developers page. Before embedding in an iframe, add your site under Allowed websites; browsers block the iframe on any site that isn't listed.

Option 1: Public form links (no code)

  1. Create a template and place its fields in the Template Editor.
  2. In Templates, open the menu on the template and choose Share as Form, then Create public link.
  3. Share the link, or copy the embed code onto your website.
<iframe src="https://www.dottisign.com/f/<form-token>"
        width="100%" height="900" style="border:0"></iframe>

The visitor enters their name and email, agrees to sign electronically, fills in the fields, and signs. You get the document in your account and a copy is emailed to them. Each submission counts toward your monthly documents and e-signatures. Turn the link off or replace it at any time.

Option 2: API — authentication

Create a key on the Developers page and send it from your server. Never put a key in browser or mobile code.

curl https://api.dottisign.com/api/v1/external/me \
  -H "Authorization: Bearer dsk_live_..."

Base URL: https://api.dottisign.com/api/v1/external. Requests and responses are JSON.

Create and send a document

POST /external/documents creates a document and sends it for signing in one call. Use one of your templates (GET /external/templates lists them) or upload a PDF as base64.

curl https://api.dottisign.com/api/v1/external/documents \
  -H "Authorization: Bearer dsk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Lease agreement - Unit 4B",
    "templateId": "6f1c...",
    "recipients": [
      { "name": "Jane Doe", "email": "jane@example.com", "embedded": true }
    ],
    "signingMode": "parallel",
    "expirationDays": 30,
    "metadata": { "leaseId": "L-1042" }
  }'

To upload a PDF instead, pass fileBase64 and place the fields yourself:

{
  "title": "NDA",
  "fileBase64": "JVBERi0xLjcK...",
  "recipients": [{ "name": "Jane Doe", "email": "jane@example.com", "embedded": true }],
  "fields": [
    { "type": "signature", "recipientIndex": 0, "page": 2,
      "x": 72, "y": 640, "width": 180, "height": 50 },
    { "type": "date", "recipientIndex": 0, "page": 2,
      "x": 300, "y": 655, "width": 120, "height": 24, "label": "Date" }
  ]
}
  • type: signature, initials, date, input or checkbox.
  • Coordinates are PDF points (1/72 inch) from the top-left corner of the page.
  • With a template, every template field goes to recipient 0 unless you pass templateFieldAssignments ({ "<fieldId>": 1 }).
  • embedded: true means we send that person no signing or reminder emails; your app shows the signing page. Otherwise they get a signing link by email. Either way, every signer is emailed a copy of the signed PDF once everyone has signed.
  • signingMode: "sequential" makes recipients sign in list order.
  • metadata (up to 4 KB) comes back in responses and webhooks.

The response contains the document id and each recipient's id. Store both.

Embedded signing

Each time you want to show the signing page, ask for a fresh signing URL from your server:

curl https://api.dottisign.com/api/v1/external/documents/<documentId>/recipients/<recipientId>/signing-url \
  -H "Authorization: Bearer dsk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "returnUrl": "https://app.example.com/leases/L-1042" }'

{ "url": "https://www.dottisign.com/sign/embed/...", "expiresAt": "..." }

The URL works once and expires after 5 minutes. Don't store it or send it by email. Request a new one whenever the user opens the signing screen.

Show it in an iframe (your site must be in Allowed websites) or redirect the user to it. After a redirect, when they finish we send them back to returnUrl with ?dottisign_event=signed (or declined).

<script src="https://www.dottisign.com/embed.js"></script>
<div id="signing"></div>
<script>
  const signing = DottiSign.mount("#signing", signingUrl, {
    height: 900,
    onEvent(event) {
      if (event.type === "signed") {
        signing.destroy();
        // Show your own confirmation; confirm on your server via webhook or GET /documents/{id}.
      }
    },
  });
</script>

Browser events

Inside an iframe, the signing page posts messages to your page. Without embed.js, listen yourself and check the origin:

window.addEventListener("message", (e) => {
  if (e.origin !== "https://www.dottisign.com") return;
  if (e.data?.source !== "dottisign") return;
  console.log(e.data.type, e.data.documentId, e.data.recipientId);
});

Types: ready, signed, declined, already_signed, expired, error, and close (the user pressed Close). Browser events are for UX only. Use webhooks or the API to confirm a signature before acting on it.

Status and download

GET /external/documents/<documentId>
GET /external/documents/<documentId>/download   ->  { "url": "...", "signed": true, "expiresInSeconds": 3600 }

Document status: SENT, COMPLETED, DECLINED or EXPIRED. Recipient status: pending (waiting for an earlier signer), sent, signed or declined. The download URL is short-lived; request a new one each time.

Webhooks

Add an https endpoint on the Developers page. We POST these events for all of your documents:

  • recipient.signed: one recipient signed (data.recipient)
  • document.completed: everyone signed (includes a short-lived data.downloadUrl)
  • document.declined: a recipient declined (data.reason)
  • document.expired: the document passed its expiration date
  • ping: sent by the test button
{
  "id": "evt_...",
  "type": "document.completed",
  "createdAt": "2026-12-03T10:15:00Z",
  "data": {
    "document": { "id": "...", "status": "COMPLETED", "metadata": { "leaseId": "L-1042" }, "recipients": [ ... ] },
    "downloadUrl": "https://..."
  }
}

Verify every delivery. The X-DottiSign-Signature header is t=<unix time>,v1=<hex>, where v1 is HMAC-SHA256 of t + "." + rawBody keyed with your endpoint secret:

import crypto from "node:crypto";

function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false; // replay window
  const expected = crypto.createHmac("sha256", secret)
    .update(parts.t + "." + rawBody).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ""));
}

Reply with any 2xx within 10 seconds. Failed deliveries are retried after 30 seconds, 5 minutes and 30 minutes. Events can arrive more than once or out of order; use id to deduplicate and GET /external/documents/{id} for the current state.

Errors and limits

Errors return a JSON body with status and message (or fieldErrors for invalid input). 401: missing or revoked key. 403: your plan doesn't include API access, or you've used this month's documents or e-signatures. 404: not found or not yours. 410: signing URL expired or already used.

Every API-created document counts toward your monthly documents and e-signatures, the same as documents sent from the app. Requests are limited to 50 MB.