Adds someone to a draft and mints their signing token.
Adds someone to a draft and mints their signing token.
POST /v1/esign/documents/{id}/recipients
| Address | https://api.hanzo.ai/v1/esign/documents/{id}/recipients |
| Method | POST |
| Operation | post_esign_documents_by_id_recipients |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Adds someone to a draft and mints their signing token.
It answers 201 with the recipient's id and their signing TOKEN — the crypto-random capability that is the only credential the signer's door accepts — so this response is where the signing link is built from. A CC recipient is recorded as already complete, because they are never asked to sign.
Only while DRAFT: adding a recipient to a document already sent is a 409, because the field layout and the turn order were fixed when it went out. An unknown document is a 404. The addition is recorded on the audit trail.
Request
5 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
email | body | any | — | Email is where the signing link is meant to go, lower-cased on the way in. |
name | body | any | — | Name is the recipient's display name, also the fallback a NAME field is filled with when they leave it blank. |
role | body | any | — | Role is SIGNER (the default), CC, VIEWER, APPROVER or ASSISTANT; anything else reads as SIGNER. |
signingOrder | body | any | — | SigningOrder is this recipient's position when the document is SEQUENTIAL — lower signs first, and ties fall back to the order they were added. |
Response
| Status | Body | Meaning |
|---|---|---|
201 | esignInvite | created |
201 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
email | body | string | — | Email is the address the invitation is for, lower-cased. |
id | body | string | — | ID is the new recipient's id, which is what a field is placed against. |
name | body | string | — | Name is the recipient's display name, empty when none was given. |
role | body | string | — | Role is the role they were recorded with — SIGNER unless another was asked for. |
token | body | string | — | Token is the crypto-random signing capability for this recipient. |
Failure carries the platform error shape — see Errors.
Examples
hanzo esign documents recipients <id>import { Configuration, EsignApi } from 'hanzoai';
const api = new EsignApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postEsignDocumentsByIdRecipients({ id: 'id', email: "<email>", name: "<name>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EsignApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EsignApi(client).post_esign_documents_by_id_recipients(id='id', email="<email>", name="<name>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.EsignAPI.PostEsignDocumentsByIdRecipients(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, esign_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = esign_api::post_esign_documents_by_id_recipients(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EsignApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new EsignApi(client).postEsignDocumentsByIdRecipients();curl -X POST https://api.hanzo.ai/v1/esign/documents/<id>/recipients \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "<email>",
"name": "<name>"
}'The door reaches esign through the esign tool, which names its 9 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_esign_documents"
}
}
}'How is this guide?