Templates
Retrieve a template version
Retrieve one immutable published source and compiled representation.
GET
/api/v1/templates/{templateId}/versions/{versionId}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 |
versionId | uuid | Required | An immutable published template-version identifier.Example: 5e0469b4-e457-4248-b46b-a9eb00a14cd8 |
Response
| Name | Type | Requirement | Description |
|---|---|---|---|
object | string | Always | Always template_version. |
id | uuid | Always | The immutable version identifier. |
template_id | uuid | Always | The owning template. |
version_number | integer | Always | The monotonic version number. |
schema_version | integer | Always | The canonical document schema version. |
source_document | object | Always | The canonical published document. |
mjml | string | null | Always | Compiled MJML for visual templates, or null for HTML-source templates. |
html | string | Always | Compiled HTML. |
plain_text | string | Always | Compiled plain text. |
subject | string | Always | Published subject. |
preview_text | string | Always | Published preview text. |
content_hash | string | Always | Compiled content hash. |
variables | array | Always | Published variable definitions. |
conditions | array | Always | Published conditional definitions. |
published_at | date-time | Always | Publication time. |
created_at | date-time | Always | Version creation time. |
Published representation
The response includes the canonical source document, MJML, HTML, plain text, variables, conditions, and content hash for this immutable version.
Published version source is returned byte-for-byte from immutable storage and is never passed through the mutable-draft compliance upgrade.
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. |