Skip to main content

Get WABA Template by UUID

Agent Skill

Automate this endpoint with an AI agent using the 2chat-whatsapp-waba skill:

npx skills add 2ChatCo/agent-skills -s 2chat-whatsapp-waba

Retrieve a single WhatsApp Business API (WABA) message template by its UUID, together with the variables a caller must fill in to send it via Send WABA Message and a ready-to-copy example request body.

This is the endpoint to call when you need to know a template's variables before attempting a send — for example to build the input fields of a Zapier, Make or n8n step, or to render a dynamic form.

info

Requires a WhatsApp Business API (WABA) channel connected to your 2Chat account. See How to connect WABA to 2Chat.

Endpoint

GET https://api.p.2chat.io/open/waba/templates/{template_uuid}

Authentication

Send your API key in the X-User-API-Key header. See Authentication.

Path parameters

ParameterDescriptionExample
template_uuidUUID of the template. Obtain it from Get WABA Templates (the uuid field). Must start with TMP. Required.TMP1b44a079-c75c-4403-bc8f-a75c4ce5cd23

Query parameters

ParameterDescriptionExample
fields_formatSet to flat to additionally receive a fields array with one ready-to-render form field per template variable. Any other value returns a 400. Optional.flat

Invocation

curl --request GET \
--url 'https://api.p.2chat.io/open/waba/templates/TMP1b44a079-c75c-4403-bc8f-a75c4ce5cd23' \
--header 'X-User-API-Key: your_api_key_here'

Response

{
"success": true,
"template": {
"uuid": "TMP1b44a079-c75c-4403-bc8f-a75c4ce5cd23",
"name": "order_shipped",
"status": "APPROVED",
"category": "UTILITY",
"language": "en_US",
"content": "Hi {{1}}, your order {{2}} is on its way.",
"description": null,
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your order {{2}} is on its way.",
"example_values": ["Ana", "A-4821"],
"sample_text": "Hi Ana, your order A-4821 is on its way."
},
{
"type": "FOOTER",
"text": "Logistics team"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://example.com/track/{{1}}"
}
]
}
],
"quality_score": "GREEN",
"rejection_reason": null,
"updated_at": "2026-07-28T11:04:52Z"
},
"required_params": {
"send_supported": true,
"unsupported_reasons": [],
"body": [
{
"index": 1,
"placeholder": "{{1}}",
"required": true,
"type": "string",
"max_length": 1024,
"example": "Ana"
},
{
"index": 2,
"placeholder": "{{2}}",
"required": true,
"type": "string",
"max_length": 1024,
"example": "A-4821"
}
],
"header": [],
"header_media_url": null,
"header_media_filename": null,
"button": [
{
"index": 1,
"required": true,
"type": "URL",
"button_text": "Track order",
"url_template": "https://example.com/track/{{1}}",
"dynamic": true,
"placeholder_index": 1,
"placeholder": "{{1}}"
}
],
"counts": {
"body": 2,
"header": 0,
"button": 1
}
},
"example_payload": {
"from_number": "+15550001111",
"to_number": "<to_number>",
"template_uuid": "TMP1b44a079-c75c-4403-bc8f-a75c4ce5cd23",
"params": {
"body": ["Ana", "A-4821"],
"button": ["<button_1>"]
}
}
}

Top-level fields

FieldDescription
successtrue when the request succeeded
templateThe template itself, in the same shape used by Get WABA Templates
required_paramsThe params.* values you must supply when sending this template
example_payloadA ready-to-copy request body for Send WABA Message
fieldsOnly present with ?fields_format=flat. Flat list of form fields — see Flat fields format

template

FieldDescription
uuidTemplate UUID
nameTemplate name (lowercase with underscores)
statusMeta approval status: APPROVED, PENDING, REJECTED, FAILED, …
categoryTemplate category (e.g. UTILITY, MARKETING, AUTHENTICATION)
languageTemplate language code (e.g. en_US, es_MX)
contentThe body text, including placeholders such as {{1}}
descriptionOptional template description, or null
componentsNormalized component list: HEADER (with format and, for media headers, default_media_url), BODY (with text, optional example_values and sample_text), FOOTER, and BUTTONS
quality_scoreMeta quality rating (GREEN, YELLOW, RED, or UNKNOWN)
rejection_reasonReason Meta rejected the template, when applicable, otherwise null
updated_atLast update time (ISO 8601, UTC)

required_params

FieldDescription
send_supportedfalse when the template uses a shape Send WABA Message cannot handle (e.g. more than one dynamic URL button, or quick replies mixed with call-to-action buttons)
unsupported_reasonsHuman-readable explanations for send_supported: false. Empty array when the template is supported
bodyOne descriptor per body placeholder, in ascending placeholder order. Maps to params.body
headerOne descriptor per placeholder of a TEXT header. Maps to params.header. Empty for media or absent headers
header_media_urlPresent when the header is IMAGE, VIDEO or DOCUMENT: { "required": true, "format": "IMAGE", "default_media_url": "…" }. Maps to params.header_media_url. null otherwise
header_media_filename{ "required": false } for DOCUMENT headers, so you can override the filename shown to the recipient. Maps to params.header_media_filename. null otherwise
buttonOne descriptor per button that consumes a runtime value — in practice, dynamic URL buttons. Maps to params.button. Quick replies, phone-number buttons and the OTP button of an AUTHENTICATION template take no value and are not listed here (they are still visible under template.components)
countsHow many values each params.* array must carry: { "body": n, "header": n, "button": n }

Each descriptor in body and header carries:

FieldDescription
indexPlaceholder number as it appears in the template
placeholderThe literal placeholder, e.g. {{1}}
requiredAlways true — WhatsApp rejects a send with missing placeholder values
typeValue type. Always string
max_lengthMaximum characters accepted: 1024 for body values, 60 for header values
exampleSample value taken from the approved template, or null when the provider did not supply one

Each descriptor in button carries index, type, button_text, url_template, dynamic, placeholder_index, placeholder and required.

Values are positional, not keyed

params.body, params.header and params.button are arrays, filled in the same order the descriptors are returned — not maps keyed by placeholder number. A template whose body uses only {{2}} and {{3}} still takes a two-element params.body array.

Flat fields format

Add ?fields_format=flat when you want one ready-to-render input per variable instead of walking the nested body / header / button structure — useful for Zapier and Make field builders or dynamic forms.

curl --request GET \
--url 'https://api.p.2chat.io/open/waba/templates/TMP1b44a079-c75c-4403-bc8f-a75c4ce5cd23?fields_format=flat' \
--header 'X-User-API-Key: your_api_key_here'

The response is identical, plus a fields array:

{
"fields": [
{
"name": "body_1",
"label": "Body {{1}}",
"type": "text",
"required": true,
"help": "e.g. Ana"
},
{
"name": "body_2",
"label": "Body {{2}}",
"type": "text",
"required": true,
"help": "e.g. A-4821"
},
{
"name": "button_1",
"label": "Button \"Track order\" — URL variable",
"type": "text",
"required": true
}
]
}
FieldDescription
nameField name matching the <body_1>, <header_1>, <button_1> placeholders used in example_payload, so a filled-in field maps straight onto the matching slot
labelHuman-readable label. Always in English — it describes the API contract, not the message language
typetext for placeholder values, url for header_media_url
requiredWhether a value must be supplied
helpSample value, when the template provides one. Omitted otherwise

Fields are returned in the order the parts appear in the rendered message: header → header media → body → buttons.

Error responses

Errors return a 4xx status and a JSON body in the shape:

{
"error": true,
"error_message": "Payload is invalid: template_uuid is not valid"
}
Statuserror_messageWhen
400Payload is invalid: template_uuid is not validTemplate does not exist, or does not belong to your account
400Payload is invalid: fields_format only supports "flat"fields_format was set to anything other than flat
422Validation errortemplate_uuid does not match the expected TMP… format
Status is informational

This endpoint returns templates in any status, including PENDING and REJECTED, so you can inspect them. Only APPROVED templates can actually be sent.