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

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

Response

Response fields
NameTypeRequirementDescription
objectstringAlwaysAlways template.
iduuidAlwaysThe template identifier.
namestringAlwaysThe template name.
descriptionstring | nullAlwaysOptional template description.
purposemarketing | transactionalAlwaysThe immutable compliance purpose.
source_modevisual | htmlAlwaysThe immutable authoring mode.
statedraft | publishedAlwaysThe current template state.
industrystring | nullAlwaysOptional industry metadata.
tonestring | nullAlwaysOptional tone metadata.
published_version_iduuid | nullAlwaysThe current immutable published version.
created_atdate-timeAlwaysWhen the template was created.
updated_atdate-timeAlwaysWhen the template metadata or state last changed.
draft.revisionintegerWhen savedThe server-authoritative draft revision.
draft.base_published_version_iduuid | nullWhen savedThe published version the draft was based on.
draft.schema_versionintegerWhen savedThe canonical document schema version.
draft.source_documentobjectWhen savedThe canonical editable document.
draft.requires_savebooleanWhen savedTrue only when RouteKite presented the exact prior canonical compliance footer with current locked markers. Save this returned document before Publish.
draft.subjectstringWhen savedThe saved subject.
draft.preview_textstringWhen savedThe 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

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.