Enviar mensagem
Changed onEnvia uma mensagem de WhatsApp. Mande exatamente um conteúdo: templateName, body, interactive, location ou reaction. Zero ou mais de um responde 400 VALIDATION_ERROR.
- Template aprovado (templateName) pode ser enviado a qualquer hora.
- Os demais conteúdos só passam com a janela de 24h aberta. Fora dela: 422 CONVERSATION_WINDOW_CLOSED.
A resposta 202 traz o id da mensagem. O status final chega pelo webhook message.status_updated.
Idempotency-Key (opcional): a mesma chave, para o mesmo usuário, devolve a mensagem já criada, sem novo envio nem nova cobrança. A chave não expira e o corpo não é comparado: reusar a chave com outro destinatário devolve a mensagem antiga, sem erro. Use uma chave por intenção de envio, derivada de um evento do seu sistema (ex. pedido-12345-confirmacao).
Permissão: MESSAGES_SEND.
Request
- Base URLhttps://api.ararahq.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Chave de idempotência, de 1 a 255 caracteres, sem caracteres de controle (fora disso: 400 INVALID_IDEMPOTENCY_KEY). Derive de um evento do seu sistema (id do pedido, id da tentativa) e reuse a mesma chave nas retentativas.
Request body
Example request
{
"receiver": "+5511999999999",
"templateName": "pedido_confirmado",
"templateVariables": [
"João",
"12345"
],
"scheduled_at": "2027-01-15T14:00:00-03:00"
}Response
Mensagem aceita
Example response
{
"id": "ara_msg_k9Bf2Xq",
"status": "PENDING",
"mode": "LIVE",
"sender": "whatsapp:+5511888888888",
"receiver": "whatsapp:+5511999999999",
"body": "Oi João, seu pedido 12345 foi confirmado!",
"cost": 0.068,
"reason": null
}Changes
- breaking
added to the
request propertyallOflist - breaking
added to the
request propertyallOflist - breaking
added to the
request propertyallOflist - breaking
the
request property type changed fromobjectto no type - breaking
the
request property type changed fromobjectto no type - breaking
the
request property type changed fromobjectto no type - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - info
api tag
Mensagensadded - info
api tag
messagesremoved - info
added the new optional request property
- info
the request property
became nullable - info
the request property
became nullable - info
the request property
became nullable - info
added the non-success response with the status
- breaking
- breaking
the response's body type changed from
objectto 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 nullable for the status - breaking
the response property
became optional for the status - breaking
the
response's property format changed fromfloatto no format for status - breaking
the
response's property type changed fromobjecttostringfor 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 optional property
/from the response with the status - info
added the new optional
headerrequest parameterIdempotency-Key - info
added to the response body
anyOflist for the response status - info
added the non-success response with the status
- info
added the non-success 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 optional property
to the response with the status
- breaking