Skip to content

Templates

A template is a container marked reusable. Cloning a template creates a new container — optionally including its documents’ content — without repeating setup.

MethodPathDescription
GET/api/v1/templatesList org templates
POST/api/v1/templatesMark an existing container as a template
PATCH/api/v1/templates/:idUpdate template metadata
DELETE/api/v1/templates/:idUnmark a container as a template
POST/api/v1/templates/:id/cloneClone a template into a new container

GET /api/v1/templates

Query parameters:

ParameterTypeRequiredDescription
categorystringNoFilter 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:

StatusCodeCause
401UNAUTHORIZEDMissing or invalid API key

Mark a container as a template POST

Section titled “Mark a container as a template ”
POST /api/v1/templates

Marks an existing container as reusable. Does not create a new container — containerId must already exist in the organisation.

Request body:

FieldTypeRequiredConstraints
containerIdUUIDYesMust not already be a template
descriptionstringNoMax 500 characters
categorystringNoMax 100 characters
{
"containerId": "018e1234-abcd-7000-8000-000000000001",
"description": "Mutual non-disclosure agreement",
"category": "legal"
}

Response 201:

{
"data": { "success": true }
}

Error cases:

StatusCodeCause
400BAD_REQUESTcontainerId is not a valid UUID, or the container is already a template
401UNAUTHORIZEDMissing or invalid API key
403TIER_LIMITTemplate limit reached for the organisation’s plan
404NOT_FOUNDContainer does not exist in this organisation

PATCH /api/v1/templates/:id

Request body:

FieldTypeRequiredConstraints
descriptionstringNoMax 500 characters
categorystringNoMax 100 characters
{
"category": "hr"
}

Response 200:

{
"data": { "success": true }
}

Error cases:

StatusCodeCause
400BAD_REQUESTid is not a valid UUID
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDContainer is not a template in this organisation

DELETE /api/v1/templates/:id

Removes 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:

StatusCodeCause
400BAD_REQUESTid is not a valid UUID
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDContainer is not a template in this organisation

POST /api/v1/templates/:id/clone

Creates a new container from a template’s structure.

Request body:

FieldTypeRequiredConstraints
namestringYes1–255 characters — name for the new container
includeContentbooleanNoDefault 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:

StatusCodeCause
400BAD_REQUESTid is not a valid UUID, or name is empty/too long
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDTemplate does not exist in this organisation