Skip to main content

Template lifecycle and approval semantics

A template is a reusable message body you author once and send many times. The endpoint contract — every field, every status value — lives in the Templates API reference. This page explains the model behind it: why templates exist as a separate object at all, how a template moves through approval, and where templates sit relative to ad-hoc bodies, flows, and campaigns.

Why templates exist

Two forces keep templates separate from a message’s body field. The first is carrier policy. On several channels a business cannot send a message body the carrier has never reviewed: WhatsApp goes through Meta’s review queue, RCS goes through MNO/MAAP review, and KakaoTalk AlimTalk / Zalo ZNS are legally template-only — the reseller must pre-approve a template before any send can reference it. On those channels the platform cannot treat the body as sender-authored text; it has to persist the authored content, submit it for review, and track the outcome as first-class state. The second is operational. Templates carry their own write-path rules. Only one route mutates templates — the canonical POST / PATCH / DELETE surface under /api/v1/messages/templates — because that is where the carrier-approval gate lives: the service decides whether a create is sent to the carrier’s review queue or activated immediately, and whether an edit has to re-submit. The top-level GET /api/v1/templates is a read-only search alias the dashboard’s command palette uses; it deliberately exposes no mutation, so no path can edit a template while bypassing the approval gate. A freeform body on a single send has no review step at all — that is what makes templates a distinct object rather than a convenience.

The lifecycle

A template carries one status value at a time: Which states are sendable depends on the channel. On an approval-required channel, only approved works — sending a draft or pending template fails, because the carrier has not signed off. On platform-only channels (SMS, MMS, email, Viber, Telegram, LINE, Messenger, Instagram, push, fax, Apple Messages), active templates send immediately and there is no review round-trip. The typical walk on an approval-required channel is draft → pending → approved, with rejected as a loop back into draft after an edit. The terminal state on any channel is archived, not deprecated: when you retire a template you archive it, and every campaign that referenced it keeps its historical association.

WhatsApp-specific statuses

The WhatsApp channel layers three more status values onto the generic lifecycle. None of them is a carrier verdict — they describe setup and sync states around Meta’s review: Dashboard badges spell these more loosely — “Draft (no WABA)”, “Resolving with Meta”, and “Submission failed” — but the underlying status value is the one above. Fixes for each are worked in the WhatsApp template troubleshooting page. Filter the list by where a template is in this walk with ?status= on GET /api/v1/messages/templates — e.g. ?status=pending for everything currently waiting on a carrier decision.

Channels and purposes

Two filters cut the list by what the template is for. ?channel= matches against the template’s audience channel. The value set is shared across create and list: sms, mms, whatsapp, email, viber, rcs, telegram, line, messenger, instagram, push, fax, kakao, zalo, apple_messages. Of those, four require carrier approval — whatsapp, rcs, kakao, and zalo — which is why they start at draft; the rest start at active. ?purpose= tags a template with a declared use when channel alone is too coarse. The set is closed and deliberately small today — call_permission_request is the only value, marking a WhatsApp re-engagement template for contacts whose calling permission has expired or been revoked. Templates without a tag remain general-purpose; both the create schema and the list filter accept only the closed set.

Cross-campaign analytics

A template reused across many campaigns accumulates engagement history scattered across per-campaign counters. GET /api/v1/templates/{id}/analytics consolidates it: sent, delivered, failed, opened, and clicked totals aggregated across every campaign that references the template, the derived delivery/open/click rates, and a per-campaign breakdown alongside the rollup. The template analytics guide walks the response fields and reading patterns.

Templates, bodies, flows, campaigns

The layers below exist at different altitudes; confusing them is the most common modeling mistake.
  • A body is one send’s content — the body string you pass on a single message (POST /api/v1/messages). It is ephemeral: sent once, reviewed never, reused never.
  • A template is a named, reusable message body. It survives sends, goes through carrier review once, and is referenced by name from then on.
  • A flow is a conversational or automation graph — a sequence of sends and waits, e.g. a three-step drip. Sends inside a flow still reference templates or bodies per step; the flow orchestrates, it does not author content.
  • A campaign is the targeting-and-scheduling wrapper: which contacts, when, through which flow or single send. A campaign references a template by id; the template never knows the campaign exists.
Rule of thumb: if the content is reviewed, it is a template. If it is ad-hoc and one-shot, it is a body. If it spans multiple sends with logic between them, it is a flow. If it is aimed at an audience with timing, it is a campaign.

Read and write scopes

Template management has its own API-key scope pair, separate from messages:*:
  • templates:read — list templates, fetch one, read summary counts, and pull cross-campaign analytics.
  • templates:write — create, update, or delete a template; a write-scoped key also reads.
This separation exists because authoring a template is not just sending: it is a content-authoring plus carrier-approval action, and a rejected or out-of-date template blocks every send that references it. Split keys let you mint a narrow read-only key for anything that only lists or analyzes templates, while holding writes to keys that are deliberately authorized to change what carriers see for review.

Marketing offers: limited-time offers and per-recipient coupons

Two authoring capabilities combine into a complete promotional message: the WhatsApp LIMITED_TIME_OFFER template component, which renders a live expiry countdown, and the {{coupon_code}} merge tag, which renders a coupon code unique to each recipient. They are independent — a template can carry the countdown without codes, and a body can carry codes on any channel — but together they model the flash sale where every recipient holds their own code.

The LIMITED_TIME_OFFER component

A MARKETING-category WhatsApp template may carry at most one LIMITED_TIME_OFFER component: an offer badge (the authored text, up to 16 characters) plus a has_expiration flag. The approved template stores only the badge and the flag; the countdown’s deadline, the expiration timestamp, is supplied at send time, the same way an AUTHENTICATION template’s one-time code resolves at send rather than authoring time. Submission validation enforces the component’s shape: MARKETING category only, a non-empty badge within the 16-character cap, a boolean has_expiration, and one instance per template. The countdown’s natural pairing is a COPY_CODE button, the coupon-reveal button that MARKETING templates may carry alongside it. When a send against such a template supplies a coupon code, the platform attaches the code to the paired COPY_CODE button, so the recipient sees the countdown and a one-tap copy of their own code in one message.

The {{coupon_code}} merge tag

{{coupon_code}} resolves at send time to a code derived deterministically (HMAC) from the recipient’s identity and the campaign’s coupon configuration. Three properties fall out of the derivation:
  • Unique per recipient. Two contacts in the same campaign receive different codes, so one scraped code cannot be mass-redeemed.
  • Stable across sends. The same recipient and campaign always render the same code. A resend, a provider retry, or a later journey step reaches the recipient with the code they already saw, and an external commerce system that knows the configuration can re-derive the code at redemption instead of the platform storing per-recipient rows.
  • Namespaced per campaign. The configuration’s seed, typically the campaign id, separates campaigns, so the same contact enrolled in two campaigns holds two distinct codes.
The configuration lives under the reserved __coupon key of the campaign’s variables map. __coupon is configuration, not a renderable tag: {{__coupon}} never resolves. All fields are optional: prefix (a literal lead-in such as SAVE-, capped at 16 characters), length (generated characters, clamped to 4–24), seed, and alphabet (an override of the default Crockford-style set, which omits visually ambiguous characters like 0/O and 1/I/L so a code read off a screen can be typed back into a checkout without confusion). Codes are generated, not drawn from an uploaded pool, so there is no pool to exhaust and no exhaustion state to monitor.

Composing an offer end to end

  1. Author and approve a MARKETING WhatsApp template whose components include LIMITED_TIME_OFFER (badge text, has_expiration) and, typically, a COPY_CODE button.
  2. Put {{coupon_code}} in the body so each recipient’s render carries their own code, alongside audience-wide campaign variables such as {{promo_expiry}} for the offer-window wording.
  3. At send time, supply the offer’s expiration and a coupon configuration; the platform derives the per-recipient code and pairs it with the COPY_CODE button. If you mint codes yourself, set metadata.lto_coupon_code on the send instead and the platform uses your literal code.

Validating before launch

An unresolved {{...}} tag renders blank for every recipient, silently. The campaign dry-run validates every merge tag, {{coupon_code}} included, against the personalization contract and withholds launch clearance until each token resolves; see Validate campaign personalization merge-tags before launch.

Boundaries

  • {{coupon_code}} is channel-agnostic: an SMS or email body renders the same per-recipient code. The countdown component is WhatsApp-only; it is a Meta template component with no counterpart on other channels.
  • These generated per-recipient codes are distinct from loyalty- or landing-page-minted codes, which those surfaces describe in their own terms; see the incentives ledger guide and the landing pages guide for terminology.

See also