Developer
Let users prepare and send documents inside your app
Embedded signing lets your customers sign inside your app. Embedded sending goes one step earlier: your user places the fields and sends the document from your own pages. You create a draft through the API, ask for an editor link for your website, and show it in an iframe.
When to embed sending
Embed the editor when your users decide where the fields go. A common case is a property platform where each landlord uploads their own lease, or a CRM where sales staff send their own quotes.
If your app already knows where every field goes, you do not need the editor. Create the envelope with fields or text tags and send it through the API.
Create a draft
Upload the document and add the recipients, but do not send it yet. Set send to false.
POST /api/v1/envelopes
{
"document": {"url": "https://example.com/lease.pdf"},
"recipients": [{"name": "Ana Diaz", "email": "[email protected]"}],
"send": false
}
Ask for an editor link
Call edit-url from your server with the exact website that will show the iframe. Keep the API key on your server; the browser only ever sees the link.
POST /api/v1/envelopes/{id}/edit-url
{"embedOrigin": "https://app.example.com"}
-> {"url": "https://docaisign.com/d/...?embed=...&ep=...", "expiresAt": "..."} - embedOrigin must be one https address such as https://app.example.com, with no path
- Only a draft can be opened; a sent envelope is refused
- The answer has the link and the time it stops working
Show the editor and listen for events
Put the link in an iframe. Every other website is blocked from framing it. When your user sends, schedules or signs the document, the editor posts a message to your page with the envelope ID.
<iframe src="EDIT_URL" style="width:100%;height:900px;border:0"></iframe>
<script>
addEventListener('message', e => {
if (e.origin !== 'https://docaisign.com' || e.data?.source !== 'docaisign') return;
if (e.data.event === 'sent') showSentScreen(e.data.envelopeId);
});
</script> - ready: the editor has loaded
- sent: the envelope went out for signature
- scheduled: the user chose a later send time
- signed: the user signed it alone, with no other recipients
Confirm on your server
Browser events are for updating your screen. Confirm the result with a webhook or by reading the envelope, because a page message can be faked or lost when the user closes the tab.
Let recipients sign in your app too
After the envelope is sent, you can request a signing link for each recipient and show it in an iframe as well. Then both sending and signing happen inside your product.
From a script or an AI agent
The CLI prints an editor link with one command, and AI agents connected through MCP can call get_edit_url.
docaisign send lease.pdf --to "Ana Diaz <[email protected]>" --draft --json
docaisign edit-url env_8f2c --embed-origin https://app.example.com
Common questions
Does my user need a DocAISign account?
No. The link stands in for the sign-in, for that one draft only. Your user never sees the DocAISign sign-in page.
What happens after 4 hours?
The link stops working. Request a new one each time you show the editor, so it is always fresh.
Can the link open other documents in the account?
No. It covers the editor page and the editor's own requests for that one draft. Every other page still needs a normal sign-in.
Can I test it for free?
Yes. Use a test key. Test keys get editor links for test envelopes only, and those envelopes are watermarked TEST and free.