Create template
Authorizations
Your ps_ API key
Body
Template name (letters/numbers only; separators become _).
"promo_cupom"
Template content: object { header?, body, footer?, buttons? } (recommended), the same JSON as a string, or plain text (auto-wrapped).
"{ \"body\": { \"text\": \"Oi {{nome}}!\" } }"
Optional header. TEXT: text with 0–1 variable (up to 60 chars). IMAGE/VIDEO/DOCUMENT: provide url (http/https) OR base64 (data URI); base64 is re-hosted server-side. No location header.
"{ \"type\": \"IMAGE\", \"base64\": \"data:image/png;base64,...\" }"
Optional footer, up to 60 chars, no variables.
"{ \"text\": \"Promoção por tempo limitado\" }"
Up to 10 buttons: QUICK_REPLY (≤ 10; text), URL (≤ 2; text + static url or dynamic with trailing {{1}}), PHONE_NUMBER (≤ 1; text + phone_number E.164), COPY_CODE (≤ 1; code in example). Quick-reply and CTA can coexist.
"[{ \"type\": \"URL\", \"text\": \"Comprar\", \"url\": \"https://loja.com/promo/{{link}}\" }, { \"type\": \"COPY_CODE\", \"example\": [\"PROMO10\"] }]"
Required when variables exist: maps each variable used in body/header (and the dynamic URL) to a sample value. The COPY_CODE code goes in button.example, not here. Missing → 400 TEMPLATE_EXAMPLES_REQUIRED.
"{ \"nome\": \"Maria\", \"desconto\": \"10%\", \"link\": \"abc123\" }"
Template category (default UTILITY).
"MARKETING"
Template language (default pt_BR).
"pt_BR"
Response
Create full template