Skip to main content
Each recipe shows the MCP tool calls an agent makes and the equivalent REST requests, for when you’d rather run the deterministic part in your own code and let the agent only decide what to send.

Template → fill → send

The most common flow: a standard document from the customer’s template, the agent fills its fields, a human approves, the recipients get an email.
1

Find the template

list_templates, then get_template with the chosen templateKey. The response lists every field with filledBy. The agent fills owner fields; any_recipient and specific_recipient fields belong to the signers.
2

Create the draft with fields and recipients

create_contract
The result has contractKey, the recipients with signingUrl, and unfilledFields — owner fields the agent still has to fill (use fill_placeholders) or ask the user about. Nobody has been emailed.
3

Show the user and get approval

The agent shows the contract name, the filled values, each recipient and their role, and asks to send.
4

Send

send_for_signature
Requires send mode. Recipients are emailed in signing order.
5

Track

get_contract_timeline for events, download_contract_pdf once the status is Fully signed. In production, listen to the webhook instead of polling.
The same in REST:
cURL
In REST, contract create with a recipients array creates and sends in one call: the recipients are emailed immediately. recipient create adds recipients without email; recipient send emails them. The MCP create_contract tool always takes the safe path.
A contract made from a template gets its own field keys. Match template fields to contract fields by name (from placeholder list on the contract), then fill them by the contract’s placeholderKey. Filling by name inside contract create is not reliable. In recipient send, give every recipient a position.

Embedded signing without email

Your product already talks to the signer (in your app, a chat, a portal). Show the signing link there and never send a Sendforsign email.
  1. Create the draft and add recipients (create_contract with recipients, or add_recipients). Both return each recipient’s signingUrl:
    With a recipient custom domain the links can be on your own domain.
  2. Give each signer their own link in your UI: a button, a message, or an iframe/new tab. The link identifies the recipient, so treat it like a password reset link: show it only to that person.
  3. Don’t call send_for_signature. The agent can run in draft mode for this flow.
  4. Learn about the signature from the webhook.
In REST, the recipientKey comes from recipient list. For a fully embedded editor and contract list (review and edit what the agent drafted), use the React components, and set your branding for any emails you do send.

One tenant per customer

A product with many customers keeps each customer’s templates and contracts apart. The tenant is chosen by your code through headers, so an agent working for customer A cannot see customer B’s contracts. Setup, once per customer (from your backend):
cURL
Store the returned clientKey with the customer. When a user of that customer starts an agent session, open the MCP connection with:

React when a contract is fully signed

Webhooks are per clientKey. Register one per client:
cURL
When the last recipient signs, your endpoint receives:
Then download the signed PDF (GET /api/download_pdf), store it, and tell the agent or the user. To resume an agent conversation, pass it the contractKey; it can call get_contract and get_contract_timeline. All events: webhooks concept.

Upload a finished text and get it signed

For legal-AI products that draft elsewhere: pass the final text as content (Markdown by default, or contentFormat: "html") to create_contract, add signers, send. For a PDF, use PDF upload and PDF placeholders in REST.