Skip to main content
POST
Create Code Template

Authorizations

Authorization
string
header
required

Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.

Headers

Thinnest-Workspace
string

Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace.

Example:

"org_3fKq9TzQ1mN8vB2xR7cLpA"

Body

application/json
name
string
required

Lowercase letters, digits and underscores, as WhatsApp allows. Unique with language.

Maximum string length: 512
Pattern: ^[a-z0-9_]{1,512}$
Example:

"login_code"

language
enum<string>
required

A WhatsApp template language code.

Available options:
en,
hi,
mr,
bn,
ta,
te,
kn,
ml,
gu,
pa,
ur,
ar,
es,
pt_BR,
fr,
de,
it,
nl,
ru,
tr,
id,
ms,
th,
vi,
fil,
ja,
ko,
zh_CN,
zh_TW,
he,
sw,
en_GB,
en_US
Example:

"en"

expiryMinutes
integer
default:10

How long the code lasts. WhatsApp shows it to the customer in their own language.

Required range: 1 <= x <= 90
Example:

10

securityRecommendation
boolean
default:true

Adds "For your security, do not share this code."

Example:

true

button
enum<string>
default:copy_code

copy_code: the customer taps to copy, then pastes — works everywhere. one_tap: hands the code straight to your Android app; needs apps.

Available options:
copy_code,
one_tap
Example:

"copy_code"

apps
object[]

Required for one_tap: the Android apps the code may be handed to. Ignored for copy_code.

Response

The draft.

id
string<uuid>
required

The template's id (a bare uuid).

name
string
required

The template's name — what template on Send One-Time Code takes.

language
string
required

Its language code.

status
enum<string>
required

draft: yours to change. pending: with WhatsApp for review. approved: sends. rejected: see reviewNote. paused: WhatsApp paused it.

Available options:
draft,
pending,
approved,
rejected,
paused
reviewNote
string | null
required

WhatsApp's reason, when it gave one.

settings
object | null
required

The three choices. Null only for a template saved before these settings existed.

preview
object | null
required

What the customer reads, in WhatsApp's words, with a sample code.

agent
string
required

The agent the template belongs to (ag_…).

createdAt
string<date-time>
required

When it was created.