DocuDetectDocs

Embedded signing

Show the signing page in a frame inside your own app, on a domain you have verified.

Early access

The REST API, webhooks and embedded signing are open to accounts in early access. If Settings, Developers is not in your account yet, write to contact@docudetect.com. What these pages describe can still change; breaking changes are announced on this site first.

With embedded signing, your signer signs without leaving your app. Your server asks DocuDetect for a one-time signing link, your page shows it in an iframe, and the frame tells your page when they have signed. Everything else stays the same: the signed PDF, the certificate of completion and the document's history.

1. Verify your domain

In the app, open Settings, Developers, Embedded signing, turn it on and add the domain of the page that will show the frame, for example app.example.com. A domain is one exact host over https: no wildcards and no paths. You can add up to 10, and the account owner is emailed whenever one is added.

Prove the domain is yours with a DNS record:

TypeNameValue
TXT_docudetect.app.example.comdocudetect-verify=… (the app shows the exact value)

The domain is usable once the record is found. DNS changes can take up to an hour to show.

2. Send without email

Make the draft as usual, then send it with delivery set to embedded so the signer is not emailed and gets no automatic reminders:

curl -X POST "https://docudetect.com/api/public/v1/documents/$DOCUMENT_ID/send" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"delivery":"embedded"}'

delivery: "embedded" is for documents with one signer.

3. Ask for a session, from your server

With a key that has embedding:sessions:

curl -X POST "https://docudetect.com/api/public/v1/documents/$DOCUMENT_ID/signers/s1/embedded-session" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin":"app.example.com"}'
{ "success": true, "data": { "url": "https://docudetect.com/embed/sign/…", "expiresAt": "2026-12-06T15:09:05.000Z", "origin": "https://app.example.com" } }

The signer is s1 on a one-signer document; otherwise use the signer's id from the document. The link opens once, within 5 minutes. Once opened, the signer has 60 minutes to sign in that frame. Each call makes a new link, and opening one ends the earlier ones. Nothing is emailed.

4. Show it in a frame

<iframe src="{url}" title="Sign the document"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads"
  style="width:100%;height:min(100dvh,900px);border:0"></iframe>

Set src just before you show the frame, on the verified domain only, and keep the link out of logs, analytics and session recordings. The signing page refuses to load in a frame on any other origin.

5. Listen for what happens

The frame posts messages to your page, always to your exact origin:

window.addEventListener("message", (event) => {
  if (event.origin !== "https://docudetect.com") return;
  if (event.source !== frame.contentWindow) return;
  if (event.data?.source !== "docudetect") return;
  if (event.data.type === "document.signed") showThanks();
});

Every message has source: "docudetect", version: 1, documentId and signerId, plus:

typeExtra fieldsSent when
readynoneThe signing page has loaded.
expiringexpiresAt5 minutes before the signer's time runs out.
document.signedcompletedThe signer signed. completed is true when that finished the document.
document.declinednoneThe signer declined to sign.
errorcodeThe frame can't be used.

Error codes: session_used, session_invalid, session_expired, not_framed, not_your_turn, canceled, declined, expired, completed, network, server.

Messages are hints for your interface. Before you rely on a signature, confirm it with Get a document or a document.signed webhook.