Skip to documentation
Dashboard
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.

Required headers
NameTypeRequirementDescription
AuthorizationstringRequiredBearer API key with the required workspace scope.Example: Bearer rk_your_key

Path parameters

Path parameters
NameTypeRequirementDescription
templateIduuidRequiredThe RouteKite template identifier.Example: 27fdc190-3a56-46f0-89e8-88ac64a5087d
versionIduuidRequiredAn immutable published template-version identifier.Example: 5e0469b4-e457-4248-b46b-a9eb00a14cd8

Response

Response fields
NameTypeRequirementDescription
objectstringAlwaysAlways template_version.
iduuidAlwaysThe immutable version identifier.
template_iduuidAlwaysThe owning template.
version_numberintegerAlwaysThe monotonic version number.
schema_versionintegerAlwaysThe canonical document schema version.
source_documentobjectAlwaysThe canonical published document.
mjmlstring | nullAlwaysCompiled MJML for visual templates, or null for HTML-source templates.
htmlstringAlwaysCompiled HTML.
plain_textstringAlwaysCompiled plain text.
subjectstringAlwaysPublished subject.
preview_textstringAlwaysPublished preview text.
content_hashstringAlwaysCompiled content hash.
variablesarrayAlwaysPublished variable definitions.
conditionsarrayAlwaysPublished conditional definitions.
published_atdate-timeAlwaysPublication time.
created_atdate-timeAlwaysVersion 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

StatusCodeWhat it meansWhat to do
401UNAUTHORIZEDThe API key is missing, invalid, revoked, or expired.Check the Bearer header and active key.
403FORBIDDENThe key lacks the required template scope.Use template:read or template:write as documented for the operation.
429RATE_LIMITEDToo many template requests were sent.Honor Retry-After before retrying.
500TEMPLATE_OPERATION_FAILED / INTERNAL_ERRORThe template operation could not complete.Retry after a short delay.
404NOT_FOUNDThe template or version is unavailable in this workspace.Check the identifier and workspace.