curl -X PATCH https://tawked.com/v1/email/templates/order-shipped \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"subject": "شحنّا طلبك {{ ORDER }}"
}'const res = await fetch("https://tawked.com/v1/email/templates/order-shipped", {
method: "PATCH",
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
"subject": "شحنّا طلبك {{ ORDER }}"
}),
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/email/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'alias' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'text' => '<string>',
'from' => [
],
'reply_to' => '<array>',
'variables' => '<array>',
'publish' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.patch(
"https://tawked.com/v1/email/templates/order-shipped",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
json={
"subject": "شحنّا طلبك {{ ORDER }}"
},
)
data = res.json(){
"id": "0199f1f0-2d3e-7f4a-8b5c-6d7e8f9a0b12",
"alias": "order-shipped",
"name": "تم شحن الطلب",
"state": "published_with_draft",
"published_version": 3,
"published": {
"id": "0199f200-3d4e-7f5a-8b6c-7d8e9f0a1b23",
"number": 3,
"state": "published",
"subject": "طلبك {{ ORDER }} في الطريق",
"html": "<p>مرحبًا {{ NAME }}، طلبك {{ ORDER }} في الطريق.</p>",
"text": null,
"from": null,
"reply_to": [],
"variables": [
{
"key": "ORDER",
"fallback": null
},
{
"key": "NAME",
"fallback": "عميلنا"
}
],
"placeholders": [
"ORDER",
"NAME"
],
"problems": [],
"published_at": "2026-10-23T09:00:00+00:00",
"updated_at": "2026-10-23T09:00:00+00:00"
},
"draft": {
"id": "0199f240-7b8c-7d9e-8f0a-1b2c3d4e5f67",
"number": null,
"state": "draft",
"subject": "شحنّا طلبك {{ ORDER }}",
"html": "<p>مرحبًا {{ NAME }}، طلبك {{ ORDER }} في الطريق.</p>",
"text": null,
"from": null,
"reply_to": [],
"variables": [
{
"key": "ORDER",
"fallback": null
},
{
"key": "NAME",
"fallback": "عميلنا"
}
],
"placeholders": [
"ORDER",
"NAME"
],
"problems": [],
"published_at": null,
"updated_at": "2026-10-23T09:00:00+00:00"
},
"created_at": "2026-10-20T09:00:00+00:00",
"updated_at": "2026-10-23T09:00:00+00:00"
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "live_key_required"
}{
"error": "not_found"
}{
"error": "email_access_required"
}{
"error": "template_alias_invalid"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}Update a template
Changes the template’s draft (made from the published version when there is none): sends keep using the published version until the draft is published. Every field is optional. A live key of the application with the explicit email:manage: a full-access key does not hold it.
curl -X PATCH https://tawked.com/v1/email/templates/order-shipped \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"subject": "شحنّا طلبك {{ ORDER }}"
}'const res = await fetch("https://tawked.com/v1/email/templates/order-shipped", {
method: "PATCH",
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
"subject": "شحنّا طلبك {{ ORDER }}"
}),
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/email/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'alias' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'text' => '<string>',
'from' => [
],
'reply_to' => '<array>',
'variables' => '<array>',
'publish' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.patch(
"https://tawked.com/v1/email/templates/order-shipped",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
json={
"subject": "شحنّا طلبك {{ ORDER }}"
},
)
data = res.json(){
"id": "0199f1f0-2d3e-7f4a-8b5c-6d7e8f9a0b12",
"alias": "order-shipped",
"name": "تم شحن الطلب",
"state": "published_with_draft",
"published_version": 3,
"published": {
"id": "0199f200-3d4e-7f5a-8b6c-7d8e9f0a1b23",
"number": 3,
"state": "published",
"subject": "طلبك {{ ORDER }} في الطريق",
"html": "<p>مرحبًا {{ NAME }}، طلبك {{ ORDER }} في الطريق.</p>",
"text": null,
"from": null,
"reply_to": [],
"variables": [
{
"key": "ORDER",
"fallback": null
},
{
"key": "NAME",
"fallback": "عميلنا"
}
],
"placeholders": [
"ORDER",
"NAME"
],
"problems": [],
"published_at": "2026-10-23T09:00:00+00:00",
"updated_at": "2026-10-23T09:00:00+00:00"
},
"draft": {
"id": "0199f240-7b8c-7d9e-8f0a-1b2c3d4e5f67",
"number": null,
"state": "draft",
"subject": "شحنّا طلبك {{ ORDER }}",
"html": "<p>مرحبًا {{ NAME }}، طلبك {{ ORDER }} في الطريق.</p>",
"text": null,
"from": null,
"reply_to": [],
"variables": [
{
"key": "ORDER",
"fallback": null
},
{
"key": "NAME",
"fallback": "عميلنا"
}
],
"placeholders": [
"ORDER",
"NAME"
],
"problems": [],
"published_at": null,
"updated_at": "2026-10-23T09:00:00+00:00"
},
"created_at": "2026-10-20T09:00:00+00:00",
"updated_at": "2026-10-23T09:00:00+00:00"
}{
"error": "invalid_json"
}{
"error": "unauthorized"
}{
"error": "live_key_required"
}{
"error": "not_found"
}{
"error": "email_access_required"
}{
"error": "template_alias_invalid"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}Authorizations
Authorization: Bearer . An application key (tk_live_, tk_test_) has full access, which covers every product and any product added later, or custom access, chosen when the key is created: one or more of the scopes verify:check, verify:send (includes verify:check), notifications:read, notifications:send (includes notifications:read), email:read, email:send (includes email:read), email:manage (includes email:send), webhooks:manage, email:inbound, notifications:templates (includes notifications:read), chat:menus, chat:attendant. No key made on the API keys page holds notifications:templates, full access included: the three template writes answer such a key 403 insufficient_scope. A connected app's key holds it. Nor chat:menus: the five conversation menu operations answer such a key 403 insufficient_scope, and a connected app's key holds it once the client approved it. Nor chat:attendant: the five auto-attendant operations answer such a key 403 insufficient_scope too, and a connected app's key holds it once the client approved it. email:manage and webhooks:manage are held only by a key someone chose them for: a full-access key, old or new, never holds them. email:inbound, which reads, deletes and forwards received e-mail, is opt-in on every key, full access included: a key holds it only when it was turned on when the key was created. A call outside the key's access answers 403 insufficient_scope and names the scope it needs in the WWW-Authenticate response header. A partner key (tk_partner_) always has full access. Whatever its access, a key is a server-side secret.
Headers
Up to 128 characters. A retry with the same key and the same body within 24 hours answers what the first call answered and changes nothing again; the same key with another body answers 409 idempotency_key_reused.
Path Parameters
The template's id (a uuid) or its alias (order-shipped).
Body
What the console calls it, up to 120 characters.
A name a send uses in place of the id: lowercase letters, digits, - and _, up to 64, never shaped like a uuid. Unique in the application.
The subject, with placeholders. A value placed in it loses its line breaks.
The HTML body, up to 512 KiB, with placeholders. html or text, or both.
The plain-text body, with placeholders.
{"name", "address"} on a domain of the application: the sender when a send names none.
Addresses replies go to, when a send names none.
[{"key": "NAME", "fallback": "عميلنا"}]: each variable with the value used when a send gives none (null: the send must give it). At most 50.
true publishes the draft at once.