Templates
Retrieve a template
Retrieve template metadata and its current saved draft.
GET
/api/v1/templates/{templateId}On this page
Authentication
Send a RouteKite API key as a Bearer token. This endpoint requires the template:read scope.
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Required | Bearer API key with the required workspace scope.Example: Bearer rk_your_key |
Path parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
templateId | uuid | Required | The RouteKite template identifier.Example: 27fdc190-3a56-46f0-89e8-88ac64a5087d |
Response
| Name | Type | Requirement | Description |
|---|---|---|---|
object | string | Always | Always template. |
id | uuid | Always | The template identifier. |
name | string | Always | The template name. |
description | string | null | Always | Optional template description. |
purpose | marketing | transactional | Always | The immutable compliance purpose. |
source_mode | visual | html | Always | The immutable authoring mode. |
state | draft | published | Always | The current template state. |
industry | string | null | Always | Optional industry metadata. |
tone | string | null | Always | Optional tone metadata. |
published_version_id | uuid | null | Always | The current immutable published version. |
created_at | date-time | Always | When the template was created. |
updated_at | date-time | Always | When the template metadata or state last changed. |
draft.revision | integer | When saved | The server-authoritative draft revision. |
draft.base_published_version_id | uuid | null | When saved | The published version the draft was based on. |
draft.schema_version | integer | When saved | The canonical document schema version. |
draft.source_document | object | When saved | The canonical editable document. |
draft.requires_save | boolean | When saved | True only when RouteKite presented the exact prior canonical compliance footer with current locked markers. Save this returned document before Publish. |
draft.subject | string | When saved | The saved subject. |
draft.preview_text | string | When saved | The saved inbox preview text. |
Server-authoritative draft
draft is null until saved content exists. When present, use its revision and base_published_version_id for the next Save request.
If requires_save is true, source_document contains an in-memory upgrade of the exact prior canonical marketing footer. Submit that returned document to Save before Publish. RouteKite never rewrites an immutable version.
Errors
| Status | Code | What it means | What to do |
|---|---|---|---|
| 401 | UNAUTHORIZED | The API key is missing, invalid, revoked, or expired. | Check the Bearer header and active key. |
| 403 | FORBIDDEN | The key lacks the required template scope. | Use template:read or template:write as documented for the operation. |
| 429 | RATE_LIMITED | Too many template requests were sent. | Honor Retry-After before retrying. |
| 500 | TEMPLATE_OPERATION_FAILED / INTERNAL_ERROR | The template operation could not complete. | Retry after a short delay. |
| 404 | NOT_FOUND | The template or version is unavailable in this workspace. | Check the identifier and workspace. |