curl --request POST \
--url https://tawked.com/v1/applications/{application}/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"autofill_text": "<string>",
"body": "<string>",
"buttons": [
{
"phone_number": "<string>",
"text": "<string>",
"url": "<string>"
}
],
"code_expiry_minutes": 45,
"examples": {},
"footer": "<string>",
"header": "<string>",
"header_sample": "<string>",
"message_send_ttl_seconds": 465,
"package_name": "<string>",
"security_recommendation": true,
"signature_hash": "<string>",
"zero_tap_terms_accepted": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
autofill_text: '<string>',
body: JSON.stringify('<string>'),
buttons: [{phone_number: '<string>', text: '<string>', url: '<string>'}],
code_expiry_minutes: 45,
examples: {},
footer: '<string>',
header: '<string>',
header_sample: '<string>',
message_send_ttl_seconds: 465,
package_name: '<string>',
security_recommendation: true,
signature_hash: '<string>',
zero_tap_terms_accepted: true
})
};
fetch('https://tawked.com/v1/applications/{application}/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/applications/{application}/whatsapp/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'autofill_text' => '<string>',
'body' => '<string>',
'buttons' => [
[
'phone_number' => '<string>',
'text' => '<string>',
'url' => '<string>'
]
],
'code_expiry_minutes' => 45,
'examples' => [
],
'footer' => '<string>',
'header' => '<string>',
'header_sample' => '<string>',
'message_send_ttl_seconds' => 465,
'package_name' => '<string>',
'security_recommendation' => true,
'signature_hash' => '<string>',
'zero_tap_terms_accepted' => 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
url = "https://tawked.com/v1/applications/{application}/whatsapp/templates"
payload = {
"name": "<string>",
"autofill_text": "<string>",
"body": "<string>",
"buttons": [
{
"phone_number": "<string>",
"text": "<string>",
"url": "<string>"
}
],
"code_expiry_minutes": 45,
"examples": {},
"footer": "<string>",
"header": "<string>",
"header_sample": "<string>",
"message_send_ttl_seconds": 465,
"package_name": "<string>",
"security_recommendation": True,
"signature_hash": "<string>",
"zero_tap_terms_accepted": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}whatsapp.templates.create
The console’s template form: name (lower-case, digits, underscores), language, category (UTILITY, MARKETING or AUTHENTICATION), an optional text or IMAGE header (an image needs header_sample, a path from whatsapp.template_samples.create), body with , footer, buttons, and examples: an object of one example per variable, keyed by the variable’s key ({"body:1": "Sara"}, or {"body:order_id": "1042"} for a named one), never a list. Field errors answer 422 with codes; Meta’s own refusal (a name already used…) 422 meta_refused with its sentence.
curl --request POST \
--url https://tawked.com/v1/applications/{application}/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"autofill_text": "<string>",
"body": "<string>",
"buttons": [
{
"phone_number": "<string>",
"text": "<string>",
"url": "<string>"
}
],
"code_expiry_minutes": 45,
"examples": {},
"footer": "<string>",
"header": "<string>",
"header_sample": "<string>",
"message_send_ttl_seconds": 465,
"package_name": "<string>",
"security_recommendation": true,
"signature_hash": "<string>",
"zero_tap_terms_accepted": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
autofill_text: '<string>',
body: JSON.stringify('<string>'),
buttons: [{phone_number: '<string>', text: '<string>', url: '<string>'}],
code_expiry_minutes: 45,
examples: {},
footer: '<string>',
header: '<string>',
header_sample: '<string>',
message_send_ttl_seconds: 465,
package_name: '<string>',
security_recommendation: true,
signature_hash: '<string>',
zero_tap_terms_accepted: true
})
};
fetch('https://tawked.com/v1/applications/{application}/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/applications/{application}/whatsapp/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'autofill_text' => '<string>',
'body' => '<string>',
'buttons' => [
[
'phone_number' => '<string>',
'text' => '<string>',
'url' => '<string>'
]
],
'code_expiry_minutes' => 45,
'examples' => [
],
'footer' => '<string>',
'header' => '<string>',
'header_sample' => '<string>',
'message_send_ttl_seconds' => 465,
'package_name' => '<string>',
'security_recommendation' => true,
'signature_hash' => '<string>',
'zero_tap_terms_accepted' => 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
url = "https://tawked.com/v1/applications/{application}/whatsapp/templates"
payload = {
"name": "<string>",
"autofill_text": "<string>",
"body": "<string>",
"buttons": [
{
"phone_number": "<string>",
"text": "<string>",
"url": "<string>"
}
],
"code_expiry_minutes": 45,
"examples": {},
"footer": "<string>",
"header": "<string>",
"header_sample": "<string>",
"message_send_ttl_seconds": 465,
"package_name": "<string>",
"security_recommendation": True,
"signature_hash": "<string>",
"zero_tap_terms_accepted": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}Authorizations
An account token from Settings › Account API in the Tawked console: Authorization: Bearer tk_acct_…
Headers
One per intended change (1 to 128 printable ASCII characters): a retry with the same key and the same request answers the stored 2xx with Idempotent-Replayed: true, for 24 hours. A 428 approval_required is never stored: send the approved request again with the same key or none. An answer that carried a secret shown once is never kept: its replay answers 409 idempotency_secret_not_replayable with the id of what it made.
1 - 128Path Parameters
An application's id (a UUID); list them with applications.applications.list.
^(?:[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12})$Body
UTILITY, MARKETING, AUTHENTICATION ar, en, en_US, en_GB, ur, hi, bn, tl, id, fr 512^[a-z0-9_]+$Only when category is AUTHENTICATION. Not when otp_type is COPY_CODE.
25^[^\r\n]*$Not when category is AUTHENTICATION.
1024Not when category is AUTHENTICATION.
10Show child attributes
Show child attributes
Only when category is AUTHENTICATION.
1 <= x <= 90Not when category is AUTHENTICATION.
Show child attributes
Show child attributes
Not when category is AUTHENTICATION.
60^[^\r\n]*$Not when category is AUTHENTICATION.
60^[^\r\n]*$Not when category is AUTHENTICATION.
TEXT, IMAGE, DOCUMENT Not when category is AUTHENTICATION. Only when header_format is IMAGE or DOCUMENT.
255Only when category is AUTHENTICATION.
30 <= x <= 900Only when category is AUTHENTICATION.
COPY_CODE, ONE_TAP, ZERO_TAP Only when category is AUTHENTICATION. Not when otp_type is COPY_CODE.
224^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)+$Only when category is AUTHENTICATION.
Only when category is AUTHENTICATION. Not when otp_type is COPY_CODE.
^[A-Za-z0-9+\/]{11}$Only when category is AUTHENTICATION. Only when otp_type is ZERO_TAP.
Response
Created.