Generate a legal document
Assembles the document from its pinned template and answers, renders the PDF, stores its SHA-256, and freezes the snapshot. Returns the frozen document and a short-lived signed download URL. Unvetted templates render with a DRAFT watermark. A consignment agreement lists the consignor contact's open inbound consignments as Schedule A, so it needs at least one.
Assembles the document from its pinned template and answers, renders the PDF, stores its SHA-256, and freezes the snapshot. Returns the frozen document and a short-lived signed download URL. Unvetted templates render with a DRAFT watermark. A consignment agreement lists the consignor contact's open inbound consignments as Schedule A, so it needs at least one.
Authorization
bearerAuth legal_documents:update, gallery:read, contacts:readA gallery API key, sent as Authorization: Bearer gpk_… (or the x-api-key header).
In: header
Scope: legal_documents:update, gallery:read, contacts:read
Path Parameters
The legal document id.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
{ "document": { "id": "string", "document_type": "loan_agreement", "status": "draft", "title": "string", "counterparty_contact_id": "string", "counterparty_name": "string", "template_key": "string", "template_version": -9007199254740991, "template_vetted": true, "jurisdiction": "string", "answers": { "property1": "string", "property2": "string" }, "pdf_sha256": "string", "generated_at": "string", "sent_at": "string", "accepted_at": "string", "voided_at": "string", "metadata": { "property1": "string", "property2": "string" }, "created_at": "string", "updated_at": "string", "assembled_markdown": "string", "assembled_clauses": [ { "key": "string", "version": -9007199254740991, "title": "string", "markdown": "string" } ], "missing_answers": [ "string" ] }, "download_url": "string"}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "code": "invalid_request", "retry": "permanent", "details": null}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "code": "invalid_request", "retry": "permanent", "details": null}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "code": "invalid_request", "retry": "permanent", "details": null}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "code": "invalid_request", "retry": "permanent", "details": null}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "code": "invalid_request", "retry": "permanent", "details": null}{ "type": "../dictionary", "title": "string", "status": 0, "detail": "string", "code": "invalid_request", "retry": "permanent", "details": null}Delete a draft legal document DELETE
Deletes a draft. Generated, sent, or accepted documents are business records — void them instead.
Get a legal document GET
Returns the document with its frozen assembled text (once generated) and `missing_answers` — the required interview questions still unanswered against its pinned template version.