Skip to main content
POST
cURL
Guide: Templates

Authorizations

Authorization
string
header
required

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

Idempotency-Key
string

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.

Body

application/json
name
string
required

Lowercase letters, digits and underscores, up to 512 characters. Meta fixes it at creation. A connected app's key may not take a name that starts salla_, zid_ or wf_, or one of Tawked's own template names: errors.name is then nameReserved.

language
string
required

One of ar, en, en_US, en_GB, ur, hi, bn, tl, id, fr. Fixed at creation.

category
string
required

UTILITY. A connected app's key writes utility templates only: MARKETING is refused with 422 template_category_not_allowed. An authentication template is created in the console.

body
string
required

Up to 1024 characters. Placeholders are all named ({{name}}, lowercase) or all numbered ({{1}}, {{2}} in order), never at the very start or end of the text. A placeholder's name is at most 20 characters ({{start_date}}, not {{subscription_start_date}}): Meta approves a longer one but refuses every message from it, so it is refused as placeholderName.

header
string

A text header: one line, up to 60 characters, no emoji and no asterisk, at most one placeholder. Only with header_format TEXT or none: with IMAGE or DOCUMENT the template has no header text, and a header sent beside it is ignored.

header_format
string

What the template opens with: TEXT (the default, for a text header or none), IMAGE or DOCUMENT (a PDF: an invoice, a contract, an attendance sheet). Each message to an IMAGE or DOCUMENT template carries its own file in header.image or header.document when it is sent. Any other value answers 400 invalid_request with headerFormatInvalid. On an edit of a template that opens with an image or a document, send it again: an edit without it answers 409 template_not_editable with MEDIA_HEADER, so an edit written for text never drops the file; TEXT makes it a text template.

header_sample_url
string

An https link to the sample Meta reviews the template with: a PDF for DOCUMENT, a JPG or PNG for IMAGE, at most 5 MB (Tawked's limit). Tawked downloads it once from a public address (at most 3 redirects, 8 seconds) and uploads it to Meta; the sample is for the review only. Required on a creation with IMAGE or DOCUMENT; optional on an edit, which keeps the sample Meta already holds when it is left out. A refusal answers 400 invalid_request naming header_sample_url, with headerSampleMissing (no link for an IMAGE or DOCUMENT creation), headerSampleUnreachable (not https, a private address, an error status, a timeout), headerSampleInvalid (not a PDF for DOCUMENT, not a JPG or PNG for IMAGE) or headerSampleTooLarge (over 5 MB).

One line, up to 60 characters, no placeholders.

buttons
array

Up to 10 objects, each with a text of up to 25 characters: { "type": "QUICK_REPLY", "text" }, { "type": "URL", "text", "url" } (https, optionally ending in {{1}}; two at most) or { "type": "PHONE_NUMBER", "text", "phone_number" } (E.164; one at most). Quick replies sit together, before or after the other buttons.

examples
object

One sample value per placeholder, keyed header:<key>, body:<key> and button:<index>. Required whenever the template has placeholders: Meta reviews with them.

Response

Submitted to Meta

id
string
name
string
language
string
category
string
status
string