Templates
A template is a container marked reusable. Cloning a template creates a new container — optionally including its documents’ content — without repeating setup.
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
GET | /api/v1/templates | List org templates |
POST | /api/v1/templates | Mark an existing container as a template |
PATCH | /api/v1/templates/:id | Update template metadata |
DELETE | /api/v1/templates/:id | Unmark a container as a template |
POST | /api/v1/templates/:id/clone | Clone a template into a new container |
List templates GET
Section titled “List templates ”GET /api/v1/templatesQuery parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | No | Filter to templates with this exact template_category value |
Response 200:
{ "data": [ { "id": "018e1234-abcd-7000-8000-000000000001", "name": "Standard NDA", "template_description": "Mutual non-disclosure agreement", "template_category": "legal", "created_at": "2026-02-01T09:00:00.000Z", "_count": { "documents": 1 } } ]}Error cases:
| Status | Code | Cause |
|---|---|---|
401 | UNAUTHORIZED | Missing or invalid API key |
Mark a container as a template POST
Section titled “Mark a container as a template ”POST /api/v1/templatesMarks an existing container as reusable. Does not create a new container — containerId must already exist in the organisation.
Request body:
| Field | Type | Required | Constraints |
|---|---|---|---|
containerId | UUID | Yes | Must not already be a template |
description | string | No | Max 500 characters |
category | string | No | Max 100 characters |
{ "containerId": "018e1234-abcd-7000-8000-000000000001", "description": "Mutual non-disclosure agreement", "category": "legal"}Response 201:
{ "data": { "success": true }}Error cases:
| Status | Code | Cause |
|---|---|---|
400 | BAD_REQUEST | containerId is not a valid UUID, or the container is already a template |
401 | UNAUTHORIZED | Missing or invalid API key |
403 | TIER_LIMIT | Template limit reached for the organisation’s plan |
404 | NOT_FOUND | Container does not exist in this organisation |
Update template metadata PATCH
Section titled “Update template metadata ”PATCH /api/v1/templates/:idRequest body:
| Field | Type | Required | Constraints |
|---|---|---|---|
description | string | No | Max 500 characters |
category | string | No | Max 100 characters |
{ "category": "hr"}Response 200:
{ "data": { "success": true }}Error cases:
| Status | Code | Cause |
|---|---|---|
400 | BAD_REQUEST | id is not a valid UUID |
401 | UNAUTHORIZED | Missing or invalid API key |
404 | NOT_FOUND | Container is not a template in this organisation |
Unmark a template DELETE
Section titled “Unmark a template ”DELETE /api/v1/templates/:idRemoves the template flag. The underlying container and its documents are not deleted — this only stops it from appearing in template listings.
Response 200:
{ "data": { "success": true }}Error cases:
| Status | Code | Cause |
|---|---|---|
400 | BAD_REQUEST | id is not a valid UUID |
401 | UNAUTHORIZED | Missing or invalid API key |
404 | NOT_FOUND | Container is not a template in this organisation |
Clone a template POST
Section titled “Clone a template ”POST /api/v1/templates/:id/cloneCreates a new container from a template’s structure.
Request body:
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Yes | 1–255 characters — name for the new container |
includeContent | boolean | No | Default true. When true, clones each document’s active version content; when false, clones structure only |
{ "name": "Acme Corp NDA", "includeContent": true}Response 201:
{ "data": { "id": "018e1234-abcd-7000-8000-000000000099", "name": "Acme Corp NDA" }}Error cases:
| Status | Code | Cause |
|---|---|---|
400 | BAD_REQUEST | id is not a valid UUID, or name is empty/too long |
401 | UNAUTHORIZED | Missing or invalid API key |
404 | NOT_FOUND | Template does not exist in this organisation |