Body
platform"instagram" | "facebook" | "whatsapp"Required- For
whatsapp, see below. accountIduuidRequired- A connected Instagram account or Facebook Page in your organization.
profileIduuid- Optional, because accountId names its profile. If you pass both, they must agree.
recipientstringRequired- The provider-scoped participant id, 1–200 characters. Take it from the
senderfield of an inbound message, not from a username. textstringRequired- 1–1,000 characters on Instagram and Facebook, 1–4,096 on WhatsApp.
A Facebook reply has the same shape. accountId is the connected Page, and
recipient is the person's PSID, from the sender field of their inbound
message:
{
"platform": "facebook",
"accountId": "00000000-0000-0000-0000-000000000002",
"recipient": "6200000000000001",
"text": "Yes, we deliver on Saturdays."
}To send an Instagram private reply to a comment, or a message with buttons, use Send Instagram message.
WhatsApp sends free text to a customer inside the 24-hour window their last
message opened. accountId is the connected WhatsApp number and recipient is
the customer's number in E.164 form:
{
"platform": "whatsapp",
"accountId": "00000000-0000-0000-0000-000000000003",
"recipient": "+15551234567",
"text": "Your order is ready for pickup."
}Outside the window, or to someone who has never written, Adeli answers
409 window_closed without sending; so does a send that WhatsApp refuses at the
window's edge. Other WhatsApp refusals, such as an undeliverable recipient, are
422 provider_rejected with WhatsApp's reason, and do not count against your
monthly messages. Send an approved template instead, with
template in place of text (never both); see
WhatsApp for its body.
Success returns 201 and a bare message object with direction: "outbound",
type: "text" (or "template"), status: "sent", and the
conversationKey of the conversation it went to.
Meta's messaging rules still apply
A business can message a person only inside the window Meta's policy opens,
which begins when that person messages the business. When Meta refuses a send
because that window has closed, the response is 409 window_closed. Wait for
the person to message again before retrying.
Errors — 402 usage_limit_reached, 401 unauthorized, 400 invalid_request, 404 profile_not_found,
404 account_not_found, 409 window_closed, 409 page_not_selected (Facebook),
403 permission_required with missing permission/resource and reconnect details, 422 connection_expired,
422 provider_not_configured, 422 provider_not_supported,
422 setup_incomplete, 422 reconnect_required and 422 provider_rejected (WhatsApp),
502 provider_error.