Saves the org's own version of a template — a custom NDA, a house MSA — and…
Saves the org's own version of a template — a custom NDA, a house MSA — and returns it with its new version number.
PUT /v1/legal/templates/{id}
| Address | https://api.hanzo.ai/v1/legal/templates/{id} |
| Method | PUT |
| Operation | put_legal_templates_by_id |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Saves the org's own version of a template — a custom NDA, a house MSA — and returns it with its new version number. It takes effect for that org only; other orgs keep the built-in.
Two boundaries cannot be crossed here. Overriding a built-in INHERITS its category and its counsel-review posture, which can be raised but never dropped; and a formation or equity template is counsel-review whatever the caller sends, so no org can generate a securities-class document without the notice.
The body is validated on save, not at generation: a template that references an UNDECLARED merge field is refused with 400 rather than stored and rendered blank into a contract months later.
Request
9 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the template to override, from the path. |
body | body | string | — | Body is the text/template source. Required. |
category | body | string | — | Category groups the template: formation, equity, ops or sales. |
counselReview | body | boolean | — | CounselReview marks a template whose documents must carry the counsel notice. |
fields | body | Field[] | — | Fields declares the merge fields the body consumes. |
fields[].key | body | string | — | Key is the identifier the body substitutes ({{.key}}) and the key a generation's data map must carry. |
fields[].label | body | string | — | Label is the human prompt for whoever fills the value in — "Governing law (state)". |
id | body | string | — | ID is the template to override, from the path. |
title | body | string | — | Title is the template's display name. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | templateReply | ok |
200 body — 12 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
disclaimer | body | string | — | Disclaimer is the boundary made visible on the wire. |
template | body | legalTemplate | — | |
template.body | body | string | — | |
template.category | body | string | — | |
template.counselReview | body | boolean | — | |
template.fields | body | Field[] | — | |
template.fields[].key | body | string | — | Key is the identifier the body substitutes ({{.key}}) and the key a generation's data map must carry. |
template.fields[].label | body | string | — | Label is the human prompt for whoever fills the value in — "Governing law (state)". |
template.id | body | string | — | |
template.origin | body | string | — | |
template.title | body | string | — | |
template.version | body | integer | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo legal templates set <id>import { Configuration, LegalApi } from 'hanzoai';
const api = new LegalApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putLegalTemplatesById({ id: 'id', body: "<body>", category: "<category>" });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).put_legal_templates_by_id(id='id', body="<body>", category="<category>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.LegalAPI.PutLegalTemplatesById(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::put_legal_templates_by_id(&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).putLegalTemplatesById();curl -X PUT https://api.hanzo.ai/v1/legal/templates/<id> \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "<body>",
"category": "<category>"
}'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?