Send a message
Send a text, template, image or document message to a customer.
Set up WhatsApp first. Connect a WhatsApp number in the dashboard or with Connect numbers. Included on every paid plan. See plans.
It goes out from phone_number_id. Set type and the field that matches
it.
Outside the 24-hour window, only a template goes through. Text, image and
document sends are refused with 409 window_closed. A template send works
any time and can start a new conversation.
A send does not take the conversation over, so the agent keeps answering.
Set take_over: true to stop the agent and answer yourself.
Idempotency-Key is required. The same key with the same body replays the first answer instead of sending again.
Headers
Idempotency-KeystringrequiredA unique string you choose, up to 255 characters. Required on this
route. The same key with the same body replays the first answer for
24 hours instead of acting twice. A different body with the same key
answers 409.
Length at most 255
Body
phone_number_idintegerrequiredThe number to send from.
tostringrequiredThe customer's number in international format, such as +15551234567.
typeenumrequiredOne of: texttemplateimagedocument
textstringRequired when type is text.
Length at most 4096
templateobjectRequired when type is template.
+ Show child fields (2)− Hide child fields
idintegerrequiredAn approved template on this number, from listWhatsappTemplates.
paramsobjectOne value per field in the template's fields. Keys are
those field keys. String, number or null values.
mediaobjectRequired when type is image or document.
+ Show child fields (2)− Hide child fields
media_idstringrequiredThe media_id from uploadWhatsappMedia, uploaded within the last 24 hours.
captionstringLength at most 1024
reply_tointegerA message id in the same conversation to quote. Not allowed with a template.
take_overbooleanStop the agent answering this conversation and let a person run it.
Default false
Was this page helpful?
