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

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.

Body

application/json
name
string
required

What the console calls it, up to 120 characters.

subject
string
required

The subject, with placeholders. A value placed in it loses its line breaks.

alias
string

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.

html
string

The HTML body, up to 512 KiB, with placeholders. html or text, or both.

text
string

The plain-text body, with placeholders.

from
object

{"name", "address"} on a domain of the application: the sender when a send names none.

reply_to
array

Addresses replies go to, when a send names none.

variables
array

[{"key": "NAME", "fallback": "عميلنا"}]: each variable with the value used when a send gives none (null: the send must give it). At most 50.

publish
boolean

true publishes the draft at once.

Response

Created

id
string
alias
string
name
string
state
string
published_version
integer
published
object
draft
string | null
created_at
string<date-time>
updated_at
string<date-time>