What it does
Creates a new WhatsApp message template and submits it to Meta for approval. On success the Meta ID is returned and the template is written through to the local DB (best-effort; the request does not fail even if the DB write fails). A newly created template’s status is usuallyPENDING.
Endpoint
Headers
Secret key in
Bearer sk_... format. See Secret Key authentication.Always
application/json.Path parameters
Application ID. Must belong to the organization (otherwise
404).Request Body
Top-level fields
Template name (max 512 chars). Pattern:
^[a-z][a-z0-9_]*$ (must start with a lowercase letter; lowercase letters, digits, and underscores only). Must be unique.Language code (BCP-47), e.g.
tr, en, en_US.See Template Category. Determines the component rules (see the Category rules section below).
Header component. See the header object below.
Body component. See the body object below.
Footer component. See the footer object below.
List of buttons (max 10). See the buttons object below.
If
true, Meta may automatically re-classify the template’s category.Message time-to-live.
UTILITY: 30–43200, MARKETING: 43200–2592000, AUTHENTICATION: 30–900 (or -1).header object
One of
NONE (default), TEXT, IMAGE, VIDEO, DOCUMENT, LOCATION.Only for
TEXT headers (max 60 chars). Cannot start or end with a variable.Variable example for a
TEXT header; for media headers, the uploaded media handle.body object
Body text (max 1024 chars); supports
{{1}}, {{2}} variables. Cannot start or end with a variable. Required for UTILITY/MARKETING.Example values for the variables (order matters). The count must equal the number of variables.
AUTHENTICATION only; adds the security recommendation text.footer object
Footer text (max 60 chars). Cannot be used in
AUTHENTICATION.AUTHENTICATION only (1–90); the code validity duration.buttons object
Each item in thebuttons array:
One of
QUICK_REPLY, URL, PHONE_NUMBER, COPY_CODE, OTP.Button text (2–25 chars). Required for
URL / PHONE_NUMBER / QUICK_REPLY.URL type target link (https://...); can be dynamic using {{1}}.PHONE_NUMBER type phone in E.164 format.Dynamic URL example, or the
COPY_CODE coupon code (required for COPY_CODE).For
OTP: one of COPY_CODE, ONE_TAP, ZERO_TAP.ONE_TAP / ZERO_TAP autofill text (max 25 chars).ONE_TAP / ZERO_TAP Android package name.ONE_TAP / ZERO_TAP signature hash.ZERO_TAP terms acceptance.Category rules
AUTHENTICATION — no
header; no body.text (only addSecurityRecommendation); no footer.text (only codeExpirationMinutes); buttons may only be OTP.UTILITY / MARKETING —
body.text is required; addSecurityRecommendation and codeExpirationMinutes cannot be used; OTP buttons are not allowed; COPY_CODE is allowed in MARKETING only.The body/header cannot start or end with a variable, and the number of
examples must equal the number of variables.Response
The envelope is{ "data": {...}, "isSuccess": true } (HTTP 200). The data is a lean creation response:
true when the template was created and submitted.The create response does not return
components, qualityScore, rejectedReason, parameterFormat, or the DB id — use Get Template Detail or Get Templates for those.Examples
Demo 1 — UTILITY (lean)
Demo 1 — UTILITY (lean)
Demo 3 — MARKETING (coupon / COPY_CODE)
Demo 3 — MARKETING (coupon / COPY_CODE)
Demo 4 — AUTHENTICATION (OTP)
Demo 4 — AUTHENTICATION (OTP)
Demo 5 — error: same name+language already exists → 409
Demo 5 — error: same name+language already exists → 409
Errors
Error details with
code, group, and description; isSuccess is false.