Let people sign inside your own site
Create a document through the API, get a short-lived address for one signer and show it in an iframe. The page has no Signfinch header or footer, wears your logo and colour, and tells your page what happens by postMessage.
1. Create the document
Send the PDF and the signers as usual and add "embedded": true. The document is sent without an invitation e-mail. Signers who have to confirm a code by e-mail or phone use the normal link instead.
curl -X POST https://signfinch.com/api/v1/envelopes \
-H "Authorization: Bearer sf_live_..." \
-H "Content-Type: application/json" \
-d '{ "file_base64": "...", "recipients": [{ "name": "Anna", "email": "anna@example.com" }], "embedded": true }'2. Get the address for one signer
Ask for an embed address for a signer (the index in recipients, or the e-mail). The address works for 15 minutes by default and up to 60 minutes (ttl_seconds). It opens this signer of this document only and stops working once they have signed or declined.
curl -X POST https://signfinch.com/api/v1/envelopes/ENVELOPE_ID/embed \
-H "Authorization: Bearer sf_live_..." \
-H "Content-Type: application/json" \
-d '{ "recipient": 0, "ttl_seconds": 900, "redirect_url": "https://app.example.com/thanks" }'
# { "embed_url": "https://signfinch.com/embed/sign/emb_...", "token": "emb_...", "expires_at": "..." }The sites that may show the page are set in your account, in Embedded signing: https addresses without a path. redirect_url must be on one of those sites.
3. Show it in an iframe
Put the address in an iframe. Only the sites on your list can frame the page; any other site sees an empty frame.
<iframe
src="EMBED_URL?lang=en&accent=0d9488"
style="width:100%;height:720px;border:0"
allow="clipboard-write"
title="Sign the document"></iframe>langaccentlogo4. Listen to the events
The page sends messages to your page. Check the origin and the source field before you trust a message.
window.addEventListener("message", (e) => {
if (e.origin !== "https://signfinch.com") return; // only our page
const m = e.data;
if (m?.source !== "signfinch") return;
if (m.type === "signed") console.log("signed", m.completed, m.redirect_url);
if (m.type === "declined") console.log("declined");
if (m.type === "error") console.log("error", m.code);
});loadedfield_changedsigneddeclinederrorHow it is kept safe
- The address is random, belongs to one signer of one document and expires. After signing or declining it no longer works.
- Only the sites you list can frame the page. Every other page of Signfinch cannot be framed at all.
- Events go only to the sites on your list. The page reads nothing from your page.
- No cookies are used: the signer is identified by the address alone.