Skip to main content
POST
/
v1
/
templates
Create template
curl --request POST \
  --url https://pilotstatus.com.br/v1/templates \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "promo_cupom",
  "category": "MARKETING",
  "language": "pt_BR",
  "body": {
    "header": {
      "type": "IMAGE",
      "base64": "data:image/png;base64,..."
    },
    "body": {
      "text": "Oi {{nome}}! Use e ganhe {{desconto}} de desconto."
    },
    "footer": {
      "text": "Promoção por tempo limitado"
    },
    "buttons": [
      {
        "type": "QUICK_REPLY",
        "text": "Quero!"
      },
      {
        "type": "URL",
        "text": "Comprar",
        "url": "https://loja.com/promo/{{link}}"
      },
      {
        "type": "PHONE_NUMBER",
        "text": "Falar",
        "phone_number": "+5511999998888"
      },
      {
        "type": "COPY_CODE",
        "example": [
          "PROMO10"
        ]
      }
    ]
  },
  "examples": {
    "nome": "Maria",
    "desconto": "10%",
    "link": "abc123"
  }
}
'
{
  "id": "tpl_01HZX...",
  "name": "promo_cupom",
  "category": "MARKETING",
  "metaStatus": "PENDING"
}

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
string
required

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

Example:

"{ \"body\": { \"text\": \"Oi {{nome}}!\" } }"

body.header
string

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:

"{ \"type\": \"IMAGE\", \"base64\": \"data:image/png;base64,...\" }"

Optional footer, up to 60 chars, no variables.

Example:

"{ \"text\": \"Promoção por tempo limitado\" }"

body.buttons
string

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:

"[{ \"type\": \"URL\", \"text\": \"Comprar\", \"url\": \"https://loja.com/promo/{{link}}\" }, { \"type\": \"COPY_CODE\", \"example\": [\"PROMO10\"] }]"

examples
string

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:

"{ \"nome\": \"Maria\", \"desconto\": \"10%\", \"link\": \"abc123\" }"

category
string

Template category (default UTILITY).

Example:

"MARKETING"

language
string

Template language (default pt_BR).

Example:

"pt_BR"

Response

Create full template