Create a template
POST
/v1/whatsapp/sessions/{sessionId}/templatesCreates a template.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
namerequired | string | A name, unique within the session. Up to 100 characters. |
bodyrequired | string | The text, up to 4096 characters, with {{variable}} placeholders. |
header | string | Optional text added before the body. Up to 1024 characters. |
footer | string | Optional text added after the body. Up to 1024 characters. |
curl -X POST "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/templates" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "order-confirmation",
"body": "Hi {{customer}}, your order {{orderId}} has shipped.",
"footer": "Reply STOP to opt out."
}'201 Created
{
"id": "b1c2d3e4-f5a6-7890-bcde-f01234567890",
"sessionId": "9c1f6a4e-2b7d-4e0a-8f53-6d2a1b7c9e10",
"name": "order-confirmation",
"body": "Hi {{customer}}, your order {{orderId}} has shipped.",
"footer": "Reply STOP to opt out.",
"createdAt": "2026-01-15T09:40:00Z",
"updatedAt": "2026-01-15T09:40:00Z"
}List templates
GET
/v1/whatsapp/sessions/{sessionId}/templatesReturns the session's templates.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/templates" \
-H "X-API-Key: $TUSK_WA_KEY"200 OK
[
{
"id": "b1c2d3e4-f5a6-7890-bcde-f01234567890",
"sessionId": "9c1f6a4e-2b7d-4e0a-8f53-6d2a1b7c9e10",
"name": "order-confirmation",
"body": "Hi {{customer}}, your order {{orderId}} has shipped.",
"footer": "Reply STOP to opt out.",
"createdAt": "2026-01-15T09:40:00Z",
"updatedAt": "2026-01-15T09:40:00Z"
}
]Get a template
GET
/v1/whatsapp/sessions/{sessionId}/templates/{id}Returns one template.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
idrequired | path | The template id. |
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/templates/5b0e9c3a-7d1f-4a62-9c1e-2f8a6d4b7e31" \
-H "X-API-Key: $TUSK_WA_KEY"200 OK
{
"id": "b1c2d3e4-f5a6-7890-bcde-f01234567890",
"sessionId": "9c1f6a4e-2b7d-4e0a-8f53-6d2a1b7c9e10",
"name": "order-confirmation",
"body": "Hi {{customer}}, your order {{orderId}} has shipped.",
"footer": "Reply STOP to opt out.",
"createdAt": "2026-01-15T09:40:00Z",
"updatedAt": "2026-01-15T09:40:00Z"
}Update a template
PUT
/v1/whatsapp/sessions/{sessionId}/templates/{id}Changes a template. Send only the fields to change.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
idrequired | path | The template id. |
name | string | A name, unique within the session. Up to 100 characters. |
body | string | The text, up to 4096 characters, with {{variable}} placeholders. |
header | string | Optional text added before the body. Up to 1024 characters. |
footer | string | Optional text added after the body. Up to 1024 characters. |
curl -X PUT "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/templates/5b0e9c3a-7d1f-4a62-9c1e-2f8a6d4b7e31" \
-H "X-API-Key: $TUSK_WA_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "Hi {{customer}}, order {{orderId}} is on its way."
}'200 OK
{
"id": "b1c2d3e4-f5a6-7890-bcde-f01234567890",
"sessionId": "9c1f6a4e-2b7d-4e0a-8f53-6d2a1b7c9e10",
"name": "order-confirmation",
"body": "Hi {{customer}}, order {{orderId}} is on its way.",
"footer": "Reply STOP to opt out.",
"createdAt": "2026-01-15T09:40:00Z",
"updatedAt": "2026-01-15T09:40:00Z"
}Delete a template
DELETE
/v1/whatsapp/sessions/{sessionId}/templates/{id}Deletes a template.
| Name | Type | Description |
|---|---|---|
sessionIdrequired | path | The session id from the sessions endpoints. |
idrequired | path | The template id. |
curl -X DELETE "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/templates/5b0e9c3a-7d1f-4a62-9c1e-2f8a6d4b7e31" \
-H "X-API-Key: $TUSK_WA_KEY"204 No Content
(empty body)