Register a template
Registers a template and submits it for review, synchronously.
The call returns once the channel has accepted the submission, so a name
or a body it refuses is a 422 you read immediately rather than a silence
you discover later. What comes back is almost always status: "pending".
Review time varies: templates have been approved in minutes and, in other
cases, over several days, so poll GET /v1/templates rather than assuming
a wait. Nothing is sendable until it is approved — watch for it on
GET /v1/templates. After approval the
send_schema is published on the registry’s next read-back, up to about
fifteen minutes later; until then a send is refused with
template_not_sendable pointing at the template. The category on the
approved template is the one review assigned and can differ from the one
you submitted; read it back, since it determines pricing and whether
marketing delivery rules apply.
Status is never ours to assert. An approved template can be paused later for quality and approved again afterwards, and this API reports what the channel currently says rather than what it said at submission.
A refusal decided before any submission attempt records nothing, and its
message says so: the name remains reusable. Once a submission is attempted,
its evidence remains visible as status: "draft" with the derived
parameter schema even if the attempt is refused or its answer is lost. A
definitive refusal leaves the name reusable after correction; an unknown
outcome permanently fences the name and must not be retried. This ordering prevents
an accepted template from becoming invisible here. A name that is already
registered beyond draft answers 409 — submitted names are permanent.
An account with no messaging channel answers retryable HTTP 503
no_channel_account with a 3xxx error.code, not a validation
error. It carries no Retry-After because setup has no honest completion
time to publish.
An invalid channel credential likewise answers HTTP 503
template_channel_unavailable with a 3xxx error.code, not 422
template_refused: rotating that credential is this service’s repair,
not a change to the template. It carries no Retry-After because rotation
is an operator action rather than a clock boundary.
Media-header preparation is bounded and resumable. While the same request
is actively preparing, HTTP 503 template_submission_in_progress (a
3xxx error.code, 3021) asks you to retry the unchanged body. Exhausted
preparation answers HTTP 503 template_asset_unavailable (a 3xxx
error.code, 3011). Once the template-create call may have reached the
channel but its answer is unknown, HTTP 409
template_outcome_indeterminate (a 2xxx error.code, 2039) is
permanent: do not resubmit that name; registry reconciliation must
establish the outcome. HTTP 201 is returned only after the channel
accepted the template submission.
Body ParametersJSON
utility, marketing or authentication.
The channel may RECATEGORISE on review — copy that reads as marketing is
treated as marketing whatever was requested — and the assigned category is
what the send is priced at. Read category back off the response and off
GET /v1/templates.
An authentication template renders a fixed one-time-code layout and
cannot carry a carousel; the pair is refused with a fault at /carousel
before anything is recorded.
The locale this variant is written in, such as en_US. One template name
may have several language variants, each registered separately. The
x-template-languages list documents upstream-supported values as of its
verification date; this service accepts any well-formed code so a newly
supported locale is not refused here.
Register a template
curl https://whatsapp.messages.api.linqapp.com/v1/templates \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \
-d '{
"category": "category",
"language": "language",
"name": "name"
}'{
"category": "category",
"created_at": "2019-12-27T18:11:19.117Z",
"language": "language",
"name": "name",
"parameters": {},
"quality": "quality",
"rejected_reason": "rejected_reason",
"send_schema": {},
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"content": {
"body": "body",
"buttons": [
{
"type": "type",
"phone_number": "phone_number",
"text": "text",
"url": "url"
}
],
"carousel": [
{
"body": "body",
"buttons": [
{
"type": "type",
"phone_number": "phone_number",
"text": "text",
"url": "url"
}
],
"header": {
"kind": "kind",
"text": "text"
}
}
],
"footer": "footer",
"header": {
"kind": "kind",
"text": "text"
}
},
"retry_allowed": true
}Returns Examples
{
"category": "category",
"created_at": "2019-12-27T18:11:19.117Z",
"language": "language",
"name": "name",
"parameters": {},
"quality": "quality",
"rejected_reason": "rejected_reason",
"send_schema": {},
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"content": {
"body": "body",
"buttons": [
{
"type": "type",
"phone_number": "phone_number",
"text": "text",
"url": "url"
}
],
"carousel": [
{
"body": "body",
"buttons": [
{
"type": "type",
"phone_number": "phone_number",
"text": "text",
"url": "url"
}
],
"header": {
"kind": "kind",
"text": "text"
}
}
],
"footer": "footer",
"header": {
"kind": "kind",
"text": "text"
}
},
"retry_allowed": true
}