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 is an unbounded queue and an hour or more is ordinary. Nothing is
sendable until it is approved — watch for it on GET /v1/templates.
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 error.type api_error, 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 error.type api_error, 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 asks
you to retry the unchanged body. Exhausted preparation answers HTTP 503
template_asset_unavailable. Once the template-create call may have
reached the channel but its answer is unknown, HTTP 409
template_outcome_indeterminate 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.
The locale this variant is written in, such as en_US. One template name may have several language variants, each registered separately.
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
}