curl --request POST \
--url https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_update_v1",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} has been updated to {{3}}, see you soon.",
"example": {
"body_text": [
[
"Ana",
"ORD-1024",
"in transit"
]
]
}
}
]
}
'{
"id": "1613165359891625",
"status": "PENDING",
"category": "UTILITY"
}{
"error": "Newport request failed",
"value": {
"errors": [
{
"description": "",
"name": "META_WHATSAPP_ERROR",
"message": "Your message could not be sent because it contains content that other people on Facebook have reported as abusive.",
"code": "368"
}
]
}
}{
"error": 401,
"message": "Unauthorized"
}{
"error": {
"errors": [
{
"code": "100",
"name": "META_WHATSAPP_ERROR",
"subCode": "2388024",
"message": "Invalid parameter",
"description": "There is already English (US) content for this template. You can create a new template and try again."
}
]
}
}Templates (WhatsApp)
Criar template
Crie um novo template e envie para aprovação da Meta
POST
/
whatsapp
/
businesses
/
{wabaId}
/
templates
curl --request POST \
--url https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_update_v1",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} has been updated to {{3}}, see you soon.",
"example": {
"body_text": [
[
"Ana",
"ORD-1024",
"in transit"
]
]
}
}
]
}
'{
"id": "1613165359891625",
"status": "PENDING",
"category": "UTILITY"
}{
"error": "Newport request failed",
"value": {
"errors": [
{
"description": "",
"name": "META_WHATSAPP_ERROR",
"message": "Your message could not be sent because it contains content that other people on Facebook have reported as abusive.",
"code": "368"
}
]
}
}{
"error": 401,
"message": "Unauthorized"
}{
"error": {
"errors": [
{
"code": "100",
"name": "META_WHATSAPP_ERROR",
"subCode": "2388024",
"message": "Invalid parameter",
"description": "There is already English (US) content for this template. You can create a new template and try again."
}
]
}
}Conceituação
Este endpoint é escopado por WABA, então hoje cobre só o WhatsApp Oficial.Instagram e Messenger também têm template pré-aprovado — o Utility Template, escopado por página. O suporte a eles no Omni Z-API está em implementação. Veja a comparação dos três tipos de template.
PENDING e é atualizado para APPROVED ou REJECTED após a revisão.
Use o endpoint de Sincronizar templates para forçar a atualização do status.
O nome do template deve ser em
snake_case, sem espaços ou caracteres especiais. Uma vez criado, o nome não pode ser alterado.O
wabaId é obtido através do endpoint de Listar WABAs.Autorizações
Secret Key generated in the Omni Z-API Security panel
Parâmetros de caminho
WABA ID (obtained via List WABAs)
Exemplo:
"428083093730937"
Corpo
application/json
Template name (snake_case, no spaces)
Template category
Opções disponíveis:
UTILITY, MARKETING, AUTHENTICATION Template language (e.g. en_US, pt_BR)
Template components (HEADER, BODY, FOOTER, BUTTONS)