Templates

Cria o template e envia para aprovação da Meta. providerStatus nasce PENDING; o resultado chega pelo webhook template.updated.

  • O nome é único por conta WhatsApp Business. Repetido: 409 CONFLICT.
  • Em AUTHENTICATION o conteúdo é fixo: a Arara envia à Meta o texto {{1}} é o seu código de verificação com um botão de copiar código, em pt_BR. body, buttons e language enviados não mudam o template aprovado. No envio, passe o código como única variável.
  • Exige conta ativa (403 ACCOUNT_NOT_ACTIVATED).
  • Os planos atuais não têm limite de templates. Contas no plano Free legado têm teto de 3 templates aprovados e recebem 403 PLAN_LIMIT_REACHED.

Permissão: TEMPLATES_WRITE.

post/v1/templates

Request

Request body

namestring required

Nome do template. Único por conta WhatsApp Business.

category'MARKETING' | 'UTILITY' | 'AUTHENTICATION' required

Categoria avaliada pela Meta. Em AUTHENTICATION o conteúdo é fixo (veja a descrição do endpoint).

bodystring required

Texto com variáveis {{1}}, {{2}}... Não pode começar nem terminar com variável.

languagestring

Idioma do template.

headerstring nullable

Cabeçalho: texto simples ou URL de mídia.

headerType'text' | 'media' | 'document' nullable

Tipo do cabeçalho.

footerstring nullable

Rodapé.

samplesobject nullable

Exemplo por número da variável ({"1": "João"}). A Meta usa na revisão. Precisa ser objeto: array responde 400 INVALID_JSON.

variableExamplesstring[] nullable

Legado. Prefira samples.

Example request

{
  "name": "pedido_confirmado"
}

Response

Template criado

idstring uuid required

ID do template (UUID).

namestring required
formattedNamestring required
categorystring required

Categoria atual. A Meta pode mudar a categoria na revisão.

originalCategorystring nullable

Categoria pedida na criação.

languagestring required
providerNamestring required
providerTemplateIdstring required
providerStatusstring required

Status de aprovação:

  • PENDING: em revisão.
  • APPROVED: pronto para enviar.
  • REJECTED: reprovado. Veja rejectionReason.
  • PAUSED: pausado pela Meta ou pela proteção automática da Arara. O envio responde 422 TEMPLATE_PAUSED.
  • DISABLED: desativado. O envio responde 422 TEMPLATE_NOT_SENDABLE.
rejectionReasonstring nullable
availableForSendingboolean required

false quando o template foi aprovado em um número que a organização não usa mais. Recrie o template no número ativo.

unavailableReasonstring nullable
bodyPreviewstring nullable

Corpo do template, com os marcadores de variável.

structureJsonobject required
usageGuideobject nullable
variablesSchemaobject nullable

Exemplos por número da variável.

createdAtstring date-time required
updatedAtstring date-time nullable

Example response

{
  "id": "a7f3c1e2-4b5d-6789-abcd-ef0123456789",
  "name": "pedido_confirmado",
  "formattedName": "pedido_confirmado",
  "category": "UTILITY",
  "originalCategory": "UTILITY",
  "language": "pt_BR",
  "providerName": "GUPSHUP",
  "providerTemplateId": "4c1f0e9a-2b3d-4e5f-8a6b-7c8d9e0f1a2b",
  "providerStatus": "PENDING",
  "rejectionReason": null,
  "availableForSending": true,
  "unavailableReason": null,
  "bodyPreview": "Oi {{1}}, seu pedido {{2}} foi confirmado. Total: R$ {{3}}.",
  "structureJson": {},
  "usageGuide": {
    "message": "Use o objeto 'variables' no envio da mensagem para substituir os placeholders.",
    "endpoint": "POST /v1/messages"
  },
  "variablesSchema": {
    "1": "João",
    "2": "12345",
    "3": "147,90"
  },
  "createdAt": "2026-09-15T14:30:00Z",
  "updatedAt": null
}

Changes

    • breaking

      the request property's minItems was increased to 2

    • warning

      the // request property's maxLength was set to 20

    • warning

      the //// request property's maxLength was set to 20

    • info

      api tag Templates added

    • info

      api tag templates removed

    • info

      added the new optional request property //

    • info

      added the new optional request property ////

    • info

      added the new CHARGE enum value to the request property //

    • info

      added the new CHARGE enum value to the request property ////

    • info

      added the new FLOW enum value to the request property //

    • info

      added the new FLOW enum value to the request property ////

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property became optional for the status

    • breaking

      the response's property type changed from object to string for status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the optional property / from the response with the status

    • info

      added to the response body anyOf list for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status