Hanzo
OpenapiLegal

Renders a document from a template and the caller's own merge data, seals it in…

Renders a document from a template and the caller's own merge data, seals it in the org's store, and returns it with its rendered body.

POST /v1/legal/documents

Addresshttps://api.hanzo.ai/v1/legal/documents
MethodPOST
Operationpost_legal_documents
AuthAuthorization: Bearer $HANZO_API_KEY

Renders a document from a template and the caller's own merge data, seals it in the org's store, and returns it with its rendered body.

The render is PURE and deterministic — no clock, no I/O — so the same template version and the same data always produce identical bytes, which is what makes a generated contract reproducible. It fails CLOSED on a missing merge field: there is no blank-filled contract, only a 400 naming the fields that were absent. When the template is counsel-review the rendered body opens with the counsel notice, which no caller can suppress.

The document is a DRAFT. Hanzo Legal manages documents; it does not give legal advice and does not determine that a document is valid or sufficient.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
databodyobjectData supplies every merge field the template declares, keyed by field key.
data.*bodystring
templateIdbodystringTemplateID is the template to render.

Response

StatusBodyMeaning
201documentReplycreated

201 body — 14 fields.

FieldInTypeAlwaysDescription
disclaimerbodystringDisclaimer is the boundary made visible on the wire.
documentbodydocumentView
document.bodybodystringBody is the rendered document. It is sealed at rest and returned only to the owning org.
document.categorybodystring
document.contentTypebodystringContentType is the rendered body's media type — text/markdown.
document.createdAtbodyinteger
document.esignProviderbodystring
document.idbodystring
document.signedAtbodyinteger
document.statusbodystring
document.templateIdbodystring
document.templateVersionbodyinteger
document.titlebodystring
document.updatedAtbodyinteger

Failure carries the platform error shape — see Errors.

Examples

hanzo legal documents create

Legal API · All Hanzo APIs · Interactive reference

How is this guide?

On this page