Replace templates

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}

Addresshttps://api.hanzo.ai/v1/legal/templates/{id}
MethodPUT
Operationput_legal_templates_by_id
AuthAuthorization: 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).

FieldInTypeRequiredDescription
idpathstringyesID is the template to override, from the path.
bodybodystring—Body is the text/template source.
categorybodystring—Category groups the template: formation, equity, ops or sales.
counselReviewbodyboolean—CounselReview marks a template whose documents must carry the counsel notice.
fieldsbodylegal.Field[]—Fields declares the merge fields the body consumes.
fields[].keybodystring—Key is the identifier the body substitutes ({{.key}}) and the key a generation's data map must carry.
fields[].labelbodystring—Label is the human prompt for whoever fills the value in — "Governing law (state)".
idbodystring—ID is the template to override, from the path.
titlebodystring—Title is the template's display name.

Response

StatusBodyMeaning
200legal.templateReplyok
defaultproblem-detailsrefused

200 body — 12 fields.

FieldInTypeAlwaysDescription
disclaimerbodystring—Disclaimer is the boundary made visible on the wire.
templatebodylegal.legalTemplate—
template.bodybodystring—
template.categorybodystring—
template.counselReviewbodyboolean—
template.fieldsbodylegal.Field[]—
template.fields[].keybodystring—Key is the identifier the body substitutes ({{.key}}) and the key a generation's data map must carry.
template.fields[].labelbodystring—Label is the human prompt for whoever fills the value in — "Governing law (state)".
template.idbodystring—
template.originbodystring—
template.titlebodystring—
template.versionbodyinteger (int64)—

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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.LegalAPI.PutLegalTemplatesById(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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>"
     }'

MCP reaches legal through the legal tool, which names its 10 operations with its own verbs — this one among them, under a name only MCP 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"
         }
       }
     }'

Legal API · All Hanzo APIs · Interactive reference

Was this page useful?