Templates Reference
Reusable record sets that can be applied to zones. For the guide, see Templates.
Base path: /api/v1/templates/
GET /api/v1/templates/#
List templates visible to the caller. Includes both system (shared) and tenant-custom templates.
Query parameters:
| Param | Type | Notes |
|---|---|---|
page, page_size |
integer | Standard pagination |
template_type |
string | system or custom |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
POST /api/v1/templates/#
Create a custom template or apply an existing one. The endpoint is overloaded — distinguish by payload shape:
- With
records[]andvariables[]: creates a template. - With
template_idanddomain_id: applies the template to a domain.
Create#
Request:
1 2 3 4 5 6 7 8 9 10 11 | |
Response: Created template.
Apply#
Request:
1 2 3 4 5 | |
Response:
1 2 3 4 5 6 7 8 | |
GET /api/v1/templates/{template_id}#
Get a single template.
Response:
1 2 3 4 5 6 7 8 9 10 | |
PATCH /api/v1/templates/{template_id}#
Update a custom template. System templates are read-only.
Request: Partial fields — name, description, records, variables.
Response: Updated template.
DELETE /api/v1/templates/{template_id}#
Delete a custom template.
Response: 204 No Content.
GET /api/v1/templates/variables#
Return built-in variables available in all templates.
Response:
1 2 3 4 5 6 7 8 | |
GET /api/v1/templates/{template_id}/required-variables#
Return the variables a specific template requires.
Response:
1 2 3 4 5 | |
POST /api/v1/templates/{template_id}/preview/{domain_id}#
Preview the records that would be created without actually creating them.
Request:
1 | |
Response:
1 2 3 4 5 | |
Schemas#
Template#
| Field | Type |
|---|---|
id |
string (UUID) |
name |
string |
description |
string |
template_type |
string (system or custom) |
records |
array of record templates (supports ${var} substitution) |
variables |
array of {name, description, required} |
tenant_id |
string or null (null for system templates) |
Error codes#
| Status | Meaning |
|---|---|
400 |
Malformed template (invalid record, unresolved ${var}) |
403 |
Can't modify system template; can't apply without records permission |
404 |
Template or domain not found |
409 |
Template name already exists in tenant |
422 |
Variable value missing or wrong type |
Related#
- Templates guide — walkthrough.
- Records reference — record shapes used inside templates.