Template Management API
The Template Management API is currently in beta. If you would like to join the beta, please contact us.
The Template Management API allows you to create, list, retrieve, update, and delete WhatsApp message templates in your workspace programmatically.
Looking to send templates to contacts? See the Templates API for sending pre-approved templates via the Messages API.
See the authentication page for how to obtain a bearer token. All endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <token>
JSON Field Casing
All request and response bodies use snake_case field names exclusively.
Error Responses
All endpoints return errors in a consistent envelope format:
{
"error": {
"message": "422 UNPROCESSABLE ENTITY",
"details": "Template content failed validation",
"violations": [
{
"field": "content.body.text",
"rule": "REQUIRED",
"message": "Body text is required"
}
]
}
}
The violations array is present on validation errors (422) and provides field-level detail about what failed. Each violation contains:
| Field | Type | Description |
|---|---|---|
field | string | Dot-notation path to the invalid field |
rule | string | Violation rule code (e.g. REQUIRED, IMMUTABLE, INVALID_FORMAT) |
message | string | Human-readable description of the violation |
Common error status codes:
| Status | Meaning |
|---|---|
| 400 | Bad request -- malformed input |
| 401 | Unauthorized -- invalid or missing token |
| 403 | Forbidden -- insufficient permissions |
| 404 | Not found -- template does not exist in your workspace |
| 409 | Conflict -- duplicate template name/locale combination |
| 422 | Unprocessable entity -- validation error with violations |
| 429 | Too many requests -- rate limit exceeded (check Retry-After header) |
| 500 | Internal server error |
Pagination
The list endpoint uses offset-based pagination:
| Parameter | Type | Default | Min | Max |
|---|---|---|---|---|
limit | integer | 50 | 1 | 100 |
offset | integer | 0 | 0 | -- |
{
"templates": [...],
"pagination": {
"limit": 50,
"offset": 0,
"total": 142
}
}
Create Template
POST https://api.cuedesk.com/v1/templates
Creates a new WhatsApp message template. The template will be submitted to Meta for approval.
Headers:
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token |
Idempotency-Key | No | Unique key to prevent duplicate template creation |
- Request
- Request (Media Header)
- Response (201)
- Errors
{
"name": "order_confirmation",
"locale": "en",
"category": "UTILITY",
"template_type": "STANDARD",
"content": {
"header": {
"format": "TEXT",
"text": "Order Confirmed"
},
"body": {
"text": "Hi {{1}}, your order #{{2}} has been confirmed and will be delivered by {{3}}.",
"example": ["John", "12345", "25 Jan 2025"]
},
"footer": {
"text": "Thank you for your purchase"
},
"buttons": [
{
"type": "URL",
"text": "Track Order",
"url": "https://example.com/track/{{1}}",
"example": ["12345"]
}
]
},
"enabled_in_livechat": true,
"continue_session": false
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name. Alphanumeric, underscores, and spaces. Max 500 chars. |
locale | string | Yes | Language code, e.g. en, es_ES. Format: xx or xx_XX. |
category | string | Yes | One of: MARKETING, UTILITY, AUTHENTICATION |
template_type | string | Yes | One of: STANDARD, CAROUSEL, AUTHENTICATION |
content | object | Yes | Template content structure (see Content Object) |
enabled_in_livechat | boolean | Yes | Whether agents can send this template from the live chat UI |
continue_session | boolean | Yes | Whether sending this template continues an existing conversation session |
{
"name": "vacation_promo",
"locale": "en",
"category": "MARKETING",
"template_type": "STANDARD",
"content": {
"header": {
"format": "IMAGE",
"example": ["https://example.com/images/vacation-promo.jpg"]
},
"body": {
"text": "Hi {{1}},\n\nWould you like to join our team on their next vacation?",
"example": ["John"]
},
"footer": {
"text": "Reply STOP to unsubscribe"
},
"buttons": [
{
"type": "QUICK_REPLY",
"text": "I'm interested"
},
{
"type": "QUICK_REPLY",
"text": "No thanks"
}
]
},
"enabled_in_livechat": false,
"continue_session": false
}
For media headers (IMAGE, VIDEO, DOCUMENT), provide the media URL in the example array. The text field is only used with TEXT format headers.
{
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workspace_uuid": "11111111-2222-3333-4444-555555555555",
"name": "order_confirmation",
"canonical_name": "order_confirmation",
"locale": "en",
"category": "UTILITY",
"template_type": "STANDARD",
"status": "PENDING",
"rejection_reason": null,
"content": {
"header": {
"format": "TEXT",
"text": "Order Confirmed"
},
"body": {
"text": "Hi {{1}}, your order #{{2}} has been confirmed and will be delivered by {{3}}.",
"example": ["John", "12345", "25 Jan 2025"]
},
"footer": {
"text": "Thank you for your purchase"
},
"buttons": [
{
"type": "URL",
"text": "Track Order",
"url": "https://example.com/track/{{1}}",
"example": ["12345"]
}
],
"cards": null,
"auth": null
},
"enabled_in_livechat": true,
"continue_session": false,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}
409 Conflict -- A template with the same name and locale already exists:
{
"error": {
"message": "409 CONFLICT",
"details": "Template with name 'order_confirmation' and locale 'en' already exists",
"violations": []
}
}
422 Validation Error -- Content failed validation:
{
"error": {
"message": "422 UNPROCESSABLE ENTITY",
"details": "Template content failed validation",
"violations": [
{
"field": "content.body.text",
"rule": "REQUIRED",
"message": "Body text is required for STANDARD templates"
}
]
}
}
List Templates
GET https://api.cuedesk.com/v1/templates
Returns a paginated list of templates in your workspace with optional filtering.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Results per page (1–100, default 50) |
offset | integer | No | Offset for pagination (default 0) |
status | string | No | Filter by status (see TemplateStatus) |
category | string | No | Filter by category: MARKETING, UTILITY, AUTHENTICATION |
search | string | No | Search by template name (1–200 chars) |
- Request
- Response (200)
GET https://api.cuedesk.com/v1/templates?status=APPROVED&category=UTILITY&limit=10
Authorization: Bearer <token>
{
"templates": [
{
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workspace_uuid": "11111111-2222-3333-4444-555555555555",
"name": "order_confirmation",
"canonical_name": "order_confirmation",
"locale": "en",
"category": "UTILITY",
"template_type": "STANDARD",
"status": "APPROVED",
"rejection_reason": null,
"content": { ... },
"enabled_in_livechat": true,
"continue_session": false,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-16T08:00:00.000Z"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 1
}
}
Get Template
GET https://api.cuedesk.com/v1/templates/{template_uuid}
Retrieves a single template by its UUID.
- Request
- Response (200)
- Errors
GET https://api.cuedesk.com/v1/templates/a1b2c3d4-e5f6-7890-abcd-ef1234567890
Authorization: Bearer <token>
Returns a single Template Object.
404 Not Found:
{
"error": {
"message": "404 NOT FOUND",
"details": "Template not found",
"violations": []
}
}
Delete Template
DELETE https://api.cuedesk.com/v1/templates/{template_uuid}
Deletes a template. This operation is asynchronous — a 202 Accepted response indicates the deletion has been initiated.
- Request
- Response (202)
- Errors
DELETE https://api.cuedesk.com/v1/templates/a1b2c3d4-e5f6-7890-abcd-ef1234567890
Authorization: Bearer <token>
{
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "PENDING_DELETION"
}
| Field | Type | Description |
|---|---|---|
uuid | string | The UUID of the deleted template |
status | string | Will be PENDING_DELETION while deletion is in progress |
404 Not Found:
{
"error": {
"message": "404 NOT FOUND",
"details": "Template not found",
"violations": []
}
}
Template Object
The full template object returned by Create, Get, and List endpoints:
| Field | Type | Description |
|---|---|---|
uuid | string | Unique template identifier (UUID v4) |
workspace_uuid | string | Workspace the template belongs to |
name | string | Template display name |
canonical_name | string | Normalized template name (lowercase, underscored) |
locale | string | Language code (e.g. en, pt_BR) |
category | string | Template category (see TemplateCategory) |
template_type | string | Template type (see TemplateType) |
status | string | Current approval status (see TemplateStatus) |
rejection_reason | string | Reason for rejection, if applicable |
content | object | Template content structure (see Content Object) |
enabled_in_livechat | boolean | Whether the template is available in the live chat UI |
continue_session | boolean | Whether sending this template continues a session |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
Content Object
The content field contains the template's structural components:
| Field | Type | Description |
|---|---|---|
header | object | Header component (format, text, example) |
body | object | Body component (text, example) |
footer | object | Footer component (text) |
buttons | array | List of button components |
cards | array | Carousel cards (only for CAROUSEL type) |
auth | object | Authentication config (only for AUTHENTICATION type) |
Header formats
| Format | Description |
|---|---|
TEXT | Text header with optional parameter placeholders |
IMAGE | Image media header |
VIDEO | Video media header |
DOCUMENT | Document media header |
Button types
| Type | Description |
|---|---|
QUICK_REPLY | Quick reply button |
URL | URL button (can contain a parameter) |
PHONE_NUMBER | Call button |
COPY_CODE | Copy code button |
OTP | One-time password button |
Enums Reference
TemplateCategory
| Value | Description |
|---|---|
MARKETING | Promotional and marketing messages |
UTILITY | Transactional and utility messages |
AUTHENTICATION | One-time password and verification messages |
TemplateType
| Value | Description |
|---|---|
STANDARD | Standard template with header, body, footer, and buttons |
CAROUSEL | Carousel template with scrollable cards |
AUTHENTICATION | Authentication template with OTP configuration |
TemplateStatus
| Value | Description |
|---|---|
PREPARING | Template is being prepared for submission |
PENDING | Submitted and awaiting Meta approval |
APPROVED | Approved and ready to use |
REJECTED | Rejected by Meta (see rejection_reason) |
PAUSED | Temporarily paused by Meta |
FLAGGED | Flagged for quality issues |
DISABLED | Disabled by Meta |
IN_APPEAL | Rejection is being appealed |
PENDING_DELETION | Deletion in progress |
LOCKED | Locked and cannot be modified |
IN_REVIEW | Under review after an update |
DELETED | Successfully deleted |
CREATE_FAILED | Template creation failed |
UPDATE_FAILED | Template update failed |
DELETE_FAILED | Template deletion failed |