Opens an e-signature request over one document and moves it to…
Opens an e-signature request over one document and moves it to out_for_signature, returning the provider's reference for the request.
POST /v1/legal/documents/{id}/sign
| Address | https://api.hanzo.ai/v1/legal/documents/{id}/sign |
| Method | POST |
| Operation | post_legal_documents_by_id_sign |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Opens an e-signature request over one document and moves it to out_for_signature, returning the provider's reference for the request.
The provider is whatever this deployment has wired. The honest default is "manual": the request is recorded and the org fulfils it out of band — nothing here fabricates a signature, and the stub never reports itself complete.
Request
5 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the document to send for signature, from the path. |
id | body | string | — | ID is the document to send for signature, from the path. |
signers | body | legalSigner[] | — | Signers are the people who must sign, by name and email. |
signers[].email | body | string | — | |
signers[].name | body | string | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | signReply | ok |
200 body — 13 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
document | body | documentSummary | — | |
document.category | body | string | — | Category is the template's category: formation, equity, ops or sales. |
document.createdAt | body | integer | — | CreatedAt is when the document was generated, in unix seconds. |
document.esignProvider | body | string | — | EsignProvider names the e-signature provider handling it, absent until a signature has been requested. |
document.id | body | string | — | ID is the document's server-minted handle, "doc_"-prefixed. |
document.signedAt | body | integer | — | SignedAt is when the provider reported completion, in unix seconds. |
document.status | body | string | — | Status is the lifecycle state: draft, out_for_signature, signed or voided. |
document.templateId | body | string | — | TemplateID is the template it was rendered from. |
document.templateVersion | body | integer | — | TemplateVersion is WHICH version of that template rendered it, so the document is reproducible and auditable. |
document.title | body | string | — | Title is the document's title, inherited from the template. |
document.updatedAt | body | integer | — | UpdatedAt is when it last changed, in unix seconds. |
esignRef | body | string | — | EsignRef is the provider's own reference for the request — what a webhook or a status poll quotes. |
provider | body | string | — | Provider names the e-signature provider that took the request. |
Failure carries the platform error shape — see Errors.
Examples
hanzo legal documents sign create <id>import { Configuration, LegalApi } from 'hanzoai';
const api = new LegalApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postLegalDocumentsByIdSign({ id: 'id', id: "<id>", signers: [{"email":"<email>","name":"<name>"}] });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LegalApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LegalApi(client).post_legal_documents_by_id_sign(id='id', id="<id>", signers=[{"email":"<email>","name":"<name>"}])cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.LegalAPI.PostLegalDocumentsByIdSign(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, legal_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = legal_api::post_legal_documents_by_id_sign(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LegalApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new LegalApi(client).postLegalDocumentsByIdSign();curl -X POST https://api.hanzo.ai/v1/legal/documents/<id>/sign \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>",
"signers": [
{
"email": "<email>",
"name": "<name>"
}
]
}'The door reaches legal through the legal tool, which names its 11 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_legal_documents"
}
}
}'How is this guide?