curl -X DELETE https://tawked.com/v1/whatsapp/templates/7002 \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"const res = await fetch("https://tawked.com/v1/whatsapp/templates/7002", {
method: "DELETE",
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
},
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/whatsapp/templates/{template_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.delete(
"https://tawked.com/v1/whatsapp/templates/7002",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
)
data = res.json(){
"id": "7002",
"name": "promo_v1",
"language": "en",
"deleted": true
}{
"error": "invalid_request"
}{
"error": "unauthorized"
}{
"error": "account_not_active"
}{
"error": "not_found"
}{
"error": "template_in_use",
"used_by": [
"campaign",
"automation"
]
}{
"error": "template_refused"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}{
"error": "templates_unavailable"
}Delete a template
For a connected app’s key alone: an application’s own key, full access included, answers 403 insufficient_scope, and writes its templates in the console. Deletes that one language of the template on Meta. Refused while something still sends it: 409 template_in_use, with used_by saying what. Meta’s own samples cannot be deleted (409 template_not_editable with status META_SAMPLE).
curl -X DELETE https://tawked.com/v1/whatsapp/templates/7002 \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"const res = await fetch("https://tawked.com/v1/whatsapp/templates/7002", {
method: "DELETE",
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
},
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/whatsapp/templates/{template_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.delete(
"https://tawked.com/v1/whatsapp/templates/7002",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
)
data = res.json(){
"id": "7002",
"name": "promo_v1",
"language": "en",
"deleted": true
}{
"error": "invalid_request"
}{
"error": "unauthorized"
}{
"error": "account_not_active"
}{
"error": "not_found"
}{
"error": "template_in_use",
"used_by": [
"campaign",
"automation"
]
}{
"error": "template_refused"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}{
"error": "templates_unavailable"
}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), notifications:templates (includes notifications:read). 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. 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
A 1 to 128 printable-ASCII-character key you generate, scoped to your API key. Replaying it with the same request answers the original 2xx unchanged, with the response header Idempotent-Replayed: true, and runs nothing again; the same key with another request answers 409 idempotency_key_reused, and a request still in flight 409 idempotency_in_progress. A refused request is never stored, so a corrected retry under the same key runs. Keys expire after 24 hours.
Path Parameters
The template's Meta id, as id in GET /v1/whatsapp/templates. One id is one language of a template.