Skip to main content
PUT
/
v1
/
templates
/
{id}
Update template
curl --request PUT \
  --url https://pilotstatus.com.br/v1/templates/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "category": "MARKETING",
  "language": "pt_BR",
  "body": {
    "header": {
      "type": "IMAGE",
      "url": "https://cdn.loja.com/promo.png"
    },
    "body": {
      "text": "Oi {{nome}}! Agora com {{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}}"
      }
    ]
  },
  "examples": {
    "nome": "Maria",
    "desconto": "15%",
    "link": "abc123"
  }
}
'
{
  "id": "tpl_01HZX...",
  "name": "promo_cupom",
  "category": "MARKETING",
  "metaStatus": "PENDING"
}

Authorizations

x-api-key
string
header
required

Your ps_ API key

Path Parameters

id
string
required

Id or name of the template to update.

Body

application/json
body
string
required

New 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\", \"url\": \"https://cdn.loja.com/promo.png\" }"

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\": \"QUICK_REPLY\", \"text\": \"Quero!\" }, { \"type\": \"URL\", \"text\": \"Comprar\", \"url\": \"https://loja.com/promo/{{link}}\" }]"

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\": \"15%\", \"link\": \"abc123\" }"

category
string

Template category (default UTILITY).

Example:

"MARKETING"

language
string

Template language (default pt_BR).

Example:

"pt_BR"

Response

Update template