Templates
List templates
List non-system workspace templates with purpose and state filters.
GET
/api/v1/templatesOn 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 |
Request body
| Name | Type | Requirement | Description |
|---|---|---|---|
purpose | marketing | transactional | Optional | Match one template purpose. |
state | draft | published | Optional | Match one template state. |
limit | integer | Optional | Page size from 1 to 100. Defaults to 20. |
cursor | string | Optional | Opaque next_cursor from the previous page. |
Response
| Name | Type | Requirement | Description |
|---|---|---|---|
object | string | Always | Always list. |
data | template[] | Always | Matching templates. |
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 | null | List item | The saved draft revision, or null. |
draft_updated_at | date-time | null | List item | When the saved draft changed, or null. |
has_more | boolean | Always | Whether another page exists. |
next_cursor | string | null | Always | Opaque cursor for the next page. |
Newest changes first
Templates are ordered by updated_at and ID, newest first. Use next_cursor unchanged to continue.
Errors
| Status | Code | What it means | What to do |
|---|---|---|---|
| 400 | INVALID_REQUEST / INVALID_JSON / INVALID_CURSOR | The JSON, identifier, field, document, or cursor is invalid. | Correct the reported input. |
| 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. |