Record that a generated document's signature request completed
Records completion of the signature request opened over a generated document and answers the document with a `signed` flag.
POST /v1/legal/documents/{id}/sign/complete
| Address | https://api.hanzo.ai/v1/legal/documents/{id}/sign/complete |
| Method | POST |
| Operation | post_legal_documents_by_id_sign_complete |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Records completion of the signature request opened over a generated document and answers the document with a signed flag.
The e-sign provider's own status is consulted FIRST and is the default answer; an explicit signed field in the body overrides it. That override is the whole point: the default manual provider never self-completes, so a reviewer (or a real provider's webhook) is what moves the document. A completion flips the document to signed, stamps signedAt, and writes a legal.document.signed audit event; a provider still reporting incomplete answers 200 with the document unchanged, so the call is safe to repeat and never fabricates a signature.
Org-scoped and fails closed: a validated principal is required (403 without one), the document is read under the caller's OWN org so another tenant's id is a 404, a document with no open signature request is a 400, and a provider whose status call errors is a 502.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response
The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.
Examples
hanzo legal documents sign complete <id>import { Configuration, LegalApi } from 'hanzoai';
const api = new LegalApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postLegalDocumentsByIdSignComplete({ id: 'id' });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_complete(id='id')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.LegalAPI.PostLegalDocumentsByIdSignComplete(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_complete(&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).postLegalDocumentsByIdSignComplete();curl -X POST https://api.hanzo.ai/v1/legal/documents/<id>/sign/complete \
-H "Authorization: Bearer $HANZO_API_KEY"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?