Documentation
Sign inGet started

Send a message

POST
/v1/whatsapp/messages
curl -X POST "https://us1.platform.bird.com/v1/whatsapp/messages" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Sends a template message. Bird selects the sender number from the template's category.
请求载荷
to
string
必填
The message recipient's phone number in E.164 format (for example +31612345678).
template
object
The template to send. Bird selects the sender number from the template's category, so there is no sender field on this request. Templates are currently the only supported content type, so every send must include one; free-text content will be added in a future release.
显示子参数
template.name
string
必填
The template to send, by its name (for example bird_otp).
template.language
string
Language code of the template variant to send (for example en or pt_BR). May be omitted when the template has a single language.
template.components
array of object
The values that fill the template's placeholders.
显示子参数
template.components.type
string
必填
Which part of the template this fills in.
template.components.parameters
array of object
The values that fill this part's placeholders, in order.
显示子参数
template.components.parameters.type
object
必填
Parameter type.
template.components.parameters.text
string
必填
Parameter value.
响应载荷
id
string
必填
Message ID.
direction
string
必填
Whether the message was sent by the business (outbound) or received from the contact (inbound).
business
object
必填
显示子属性
business.phone_number
string
E.164 phone number of the WhatsApp business account that sent the message.
business.phone_number_id
string
The WhatsApp phone number identifier. Present only for account-owned numbers.
contact
object
必填
显示子属性
contact.phone_number
string
Contact's phone number in E.164 format, when known.
contact.bsuid
string
Business-scoped user ID (Meta's WhatsApp identifier for this contact within the business account), when available.
template
object
The template the message was sent from. For authentication templates the filled-in values are not returned.
显示子属性
template.name
string
必填
The template's stable handle (for example bird_otp).
template.category
object
必填
Content classification applied to messages sent from this template.
template.language
string
必填
The language code of the template variant that was sent (for example en).
template.components
array of object
必填
The values that filled the template's placeholders. Empty for an authentication template, whose content is never returned.
显示子属性
template.components.type
string
必填
Which part of the template this fills in.
template.components.parameters
array of object
The values that fill this part's placeholders, in order.
显示子属性
template.components.parameters.type
object
必填
Parameter type.
template.components.parameters.text
string
必填
Parameter value.
status
object
必填
last_error
nullable object
Failure detail for a message that did not reach the recipient. Null when there is no failure.
显示子属性
last_error.code
string
必填
Bird-stable failure reason, uniform whether the failure happened internally or was reported by the WhatsApp network. insufficient_balance — the workspace could not afford the send. price_not_found — no price was configured for this destination/template combination. internal_error — an unexpected Bird-side failure. undeliverable — the recipient could not be reached (e.g. not on WhatsApp, number invalid). service_window_expired — the 24-hour customer care window has closed and a free-form message cannot be sent; send a template instead. rate_limited — the send was throttled.
last_error.description
string
必填
Human-readable explanation of the failure.
last_error.occurred_at
string
必填
When the failure occurred.
created_at
string
必填
When the message was accepted for delivery.
sent_at
nullable string
When the message was handed to the WhatsApp network. Null until then.
delivered_at
nullable string
When delivery was confirmed. Null until then.
read_at
nullable string
When the message was read by the recipient. Null until then.