Skip to main content
POST
Create template

Authorizations

x-api-key
string
header
required

Your ps_ API key

Body

application/json
name
string
required

Template name (letters/numbers only; separators become _).

Example:

"promo_cupom"

body
object
required

Template content: object { header?, body, footer?, buttons? } (recommended), the same JSON as a string, or plain text (auto-wrapped).

Example:
body.header
object

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.

Example:

Optional footer, up to 60 chars, no variables.

Example:
body.buttons
object[]

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.

Example:
examples
object

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.

Example:
category
string

Template category (default UTILITY).

Example:

"MARKETING"

language
string

Template language (default pt_BR).

Example:

"pt_BR"

Response

Create full template