Messagesv4.1

Send a message to a chat

POST/chats/{chatId}/messages

Sends a message into an existing chat. Both the sender channel and recipient are inferred from the chat, so from and to must not be supplied. Returns the message object at the top level (not wrapped in data).

Path parameters

chatIdRequiredstring

Unique identifier of the chat, prefixed with chat_. Returned by the List chats endpoint.

Headers

AuthorizationRequiredstring

Your API key, sent as a bearer token: Authorization: Bearer <api_key>. Editing this stays in sync with the API key box on the right.

Bearer
Idempotency-Keyoptionalstring

Optional key for safe retries. Replaying the same key with an identical body returns the original result; a different body returns 409. Use a unique value (such as a UUID) per logical request.

Body parameters

JSON
textoptionalstring

Plain text message. May be combined with attachments or with a template (sent as the lead-in message or embedded body depending on the channel).

attachmentsoptionalstring[]

Public https media URLs. May be combined with text.

templateoptionalAgnosticTemplate

A channel-agnostic interactive template. Blooio's channel adapter manifests each kind natively on the target channel (Apple Messages quick reply / list picker / time picker / form / Apple Pay / rich link / authenticate; WhatsApp reply buttons / list / CTA URL; RCS suggestion chips; P2P iMessage and SMS numbered text and links).

kindRequired"choices"
titleRequiredstring
multipleoptionalboolean
include_person_optionoptionalboolean

Append a "Talk to a person" option (id talk_to_person) to a single-select menu.

optionsRequiredobject[]

Array of object

idoptionalstring

Returned when the customer picks this option. Unique within the template; defaults to option_<n>.

labelRequiredstring
detailoptionalstring
whatsapp_templateoptionalobject

Approved WhatsApp Business HSM template content (renamed from template in v4.1 so template holds channel-agnostic interaction templates).

nameoptionalstring
languageoptionalstring
variablesoptionalstring[]
template_idoptionalstring
reply_tooptionalstring

Message id to reply to.

typing_indicatoroptionalboolean

Show a typing indicator before sending when supported by the channel.

fallbackoptionalstring

With template only. What to do when the recipient's device lacks a native capability for a template (for example an older Apple Messages device without FORM). auto (the default) sends the closest thing the device can show in place of only the part it can't (a numbered list for a menu, the reply instruction for a confirmation). reject fails the whole send with a 422 before any part of it is sent.

"auto""reject"
dry_runoptionalboolean

Returns

idoptionalstring
chat_idoptionalstring
channel_idoptionalstring
channel_typeoptionalstring
"blooio""twilio""whatsapp""whatsapp_business""rcs_business""amb""sms""voice"
protocoloptionalstring

Transport state or resolved wire service; never null. pending = accepted and dispatched, wire service not resolved yet; imessage / rcs / sms = the device-confirmed transport (iMessage blue bubble, RCS, or SMS/MMS green bubble); whatsapp = sent over P2P WhatsApp; whatsapp_business = sent over the WhatsApp Business Platform (WABA); rcs_business = sent over Blooio RCS, from a verified RCS business sender; amb = sent over Apple Messages for Business; unknown = accepted but the transport could not be resolved before the tracking window closed (see error).

"pending""unknown""imessage""sms""rcs""whatsapp""whatsapp_business""rcs_business""amb"
fromoptionalstring | null

The resolved sender as a human value: the sending channel's phone number (numbered channels) or alias (non-numbered channels). This is the primary sender reference; channel_id remains available for exact follow-up and audit.

directionoptionalstring
"inbound""outbound"
typeoptionalstring
statusoptionalstring

Initial lifecycle state for the send: normally queued (accepted for delivery), pending when the message waits behind the channel's opener (see routing.opener), or failed if rejected before dispatch. Later transitions (sent → delivered / read, or failed) are reported via the message status endpoint and message.* webhooks.

group_idoptionalstring

Existing group id for a group-targeted send.

erroroptionalMessageError

Why the message failed; null unless it failed. On a blooio channel code is a MessageErrorCode and message describes it. On any other channel both are the provider's own error. See [Errors](/errors#v4-message-errors).

codeRequiredMessageErrorCode | string | null
messageRequiredstring | null

A description of the failure.

fallbackoptionalobject

Present when a send could not be delivered on the requested channel and a different channel should be tried.

reasonoptionalstring
downgraded_fromoptionalstring

Present when fallback: "auto" sent something simpler because the recipient's device couldn't show the content: what was replaced, such as rich_card, media, or suggestions on Blooio RCS.

tooptionalstring

Recipient identifier. Present only on per-recipient items inside a fan-out (FanOutResult) response.

dry_runoptionalboolean
would_sendoptionalboolean
previewoptionalobject
polloptionalobject
titleoptionalstring
optionsoptionalstring[]
rendered_asoptionalstring

Present on v4.1 template sends: names how the channel adapter manifested the template (for example amb:quick_reply, amb:list_picker, amb:apple_pay, whatsapp_business:button, rcs_business:quick_reply, blooio:numbered_text, blooio:payment_link).

messagesoptionalobject[]

Present when a v4.1 template send expanded into multiple messages on the target channel (for example a lead-in text followed by an Apple Messages interactive card or a P2P numbered-options text), in the order they went out. The top-level fields describe the last message attempted. Sending stops at the first message that fails, so a failed top-level status with an earlier entry not failed means the contact already got part of the send; an automatically routed send then stays on this channel instead of repeating it on the next.

Array of object

idoptionalstring
typeoptionalstring
statusoptionalstring
reply_optionsoptionalobject

Present on v4.1 template sends a customer answers by picking (choices, time_slots, confirm): what each answer means, so a reply can be matched to it. On iMessage and SMS the options go out as a numbered list, and a reply of 2 means the entry with index 2. options includes the appended talk_to_person option when include_person_option added one. Confirm buttons carry confirm_id (confirm_yes) and cancel_id (confirm_no).

kindoptionalstring
"choices""time_slots""confirm"
titleoptionalstring
multipleoptionalboolean
optionsoptionalobject[]

Array of object

indexoptionalinteger
idoptionalstring
labeloptionalstring
detailoptionalstring
slotsoptionalobject[]

Array of object

indexoptionalinteger
idoptionalstring
start_timeoptionalstring
duration_minutesoptionalinteger
labeloptionalstring
recapoptionalstring
confirm_idoptionalstring
cancel_idoptionalstring
confirm_labeloptionalstring
cancel_labeloptionalstring
routingoptionalRoutingMetadata

How Blooio selected the concrete sender channel.

modeoptionalstring
"explicit""priority"
channel_typeoptionalstring
"blooio""twilio""whatsapp""whatsapp_business""rcs_business""amb""sms""voice"
numberoptionalstring
aliasoptionalstring
priority_idoptionalstring
priorityoptionalinteger

The priority step the sending channel belongs to.

sourceoptionalstring

Why this channel was tried (priority mode): last_inbound / last_outbound = the contact's most recent conversation was on it; claim = the pool number the contact was first sent from; switch_number = their number was banned and they were moved to another in the pool; priority = the priority's step order.

"priority""last_inbound""last_outbound""claim""switch_number"
fallthroughoptionalRoutingAttempt[]

Channels passed over before this one, in order. Absent when the first channel tried sent it.

Array of RoutingAttempt

channel_idRequiredstring
channel_typeRequiredstring
"blooio""twilio""whatsapp""whatsapp_business""rcs_business""amb""sms""voice"
outcomeRequiredstring

skipped = not tried (e.g. number_banned, no_address, template_required_outside_customer_service_window, no_healthy_number); refused = tried and the channel turned the send down (e.g. recipient_opted_out, a limit).

"skipped""refused"
codeRequiredstring
messageoptionalstring
transitionoptionalobject

Present when this send carried the previous step's transition message (see PrioritySettings.steps). message_id is the transition message's id. A post transition that couldn't be sent after the main message reports error instead. A dry run reports only mode.

modeRequiredstring
"pre""post"
message_idoptionalstring
erroroptionalobject
codeoptionalstring
messageoptionalstring
openeroptionalobject

Present when the message waits behind the channel's opener: an Apple Messages for Business invitation, or a WhatsApp Business template outside the contact's 24-hour window. The message reports pending until the contact answers, then goes out in order with the messages sent to them since, or fails (message.failed, amb_invitation_declined) if they decline the invitation. A dry run has no message_id. See the channel's opener setting.

typeRequiredstring
"invitation""template"
message_idoptionalstring

The opener's message.

Response codes

200Dry-run preview
201Message accepted. The message object is returned with its current `status`; a synchronously rejected send returns `status: "failed"` with an `error` object (still 201, since the message was created).
401Your API key is missing or invalid. Pass it as a bearer token.
403Blocked by messaging safety. The error `code` identifies the gate: `safety_account_review` (the sending number is blocked pending review), `safety_reply_only` (outbound is restricted to conversations with prior inbound), `safety_new_conversations_paused` (brand-new conversations are temporarily paused; replies are unaffected), or `conversation_content_restricted` (links, media, and attachments are not allowed before the recipient's first written reply, or in a re-engagement of an inactive conversation — an emoji reaction does not unlock them). Safety actions clear automatically as the underlying pattern ages out; current per-number state is delivered via the `safety.state_changed` webhook event.
404No message was found with the provided `chatId`.
409The request conflicts with the current state of the message (e.g. it already exists, the chat is closed, or the channel isn't active).
422Validation failed — one or more fields in the request are invalid or missing.
429Conversation-state limit reached. The error `code` identifies the rule: `conversation_awaiting_reply` (up to 3 messages may be sent before the recipient responds at all), `conversation_streak_limit` (consecutive-message cap since their last response), or `conversation_inactive_paused` (no response in 14+ days and the single re-engagement message was already sent; `details.retry_after` and the `Retry-After` header give a polling interval in seconds — retry after the recipient replies, since the pause does not lift on its own). Every response body carries `conversation_state` — one of `new`, `acknowledged` (reacted but never wrote back), `active`, `established`, `trusted`, or `inactive` — and the streak errors also carry `current_streak` and `limit`, so you can see which rung of the ladder a thread is on. The cap rises with the thread's written history, and an **emoji reaction counts as a response**: a tapback clears the consecutive-message counter and keeps a thread from going inactive, so the limit lifts the moment the recipient reacts. A reaction is not treated as a reply, though — only writing back raises the cap and unlocks links, media, and attachments (see `conversation_content_restricted`).
501This message endpoint is defined but not implemented yet.

Sends a live request with your values and shows the real response below. Your key is stored only in this browser.

Request
curl -X POST https://api.blooio.com/v4.1/chats/chat_a1b2c3d4/messages \
Body object
Response objectexample
{  "id": "obj_a1b2c3d4",  "chat_id": "chat_a1b2c3d4",  "channel_id": "ch_a1b2c3d4",  "channel_type": "blooio",  "protocol": "pending",  "from": "+15551234567",  "direction": "inbound",  "type": "string",  "status": "active",  "group_id": "grp_a1b2c3d4",  "error": {    "code": null,    "message": "Hello from Blooio!"  },  "fallback": {    "recommended": false,    "reason": "string"  },  "downgraded_from": "string",  "to": "+15551234567",  "dry_run": false,  "would_send": false,  "preview": {},  "poll": {    "title": "Example title",    "options": [      "string"    ]  },  "rendered_as": "string",  "messages": [    {      "id": "msg_a1b2c3d4",      "type": "string",      "status": "active"    }  ],  "reply_options": {    "kind": "choices",    "title": "Example title",    "multiple": false,    "options": [      {        "index": 0,        "id": "obj_a1b2c3d4",        "label": "vip",        "detail": "string"      }    ],    "slots": [      {        "index": 0,        "id": "obj_a1b2c3d4",        "start_time": "2025-01-15T09:30:00Z",        "duration_minutes": 1200,        "label": "vip"      }    ],    "recap": "string",    "confirm_id": "obj_a1b2c3d4",    "cancel_id": "obj_a1b2c3d4",    "confirm_label": "string",    "cancel_label": "string"  },  "routing": {    "mode": "explicit",    "channel_type": "blooio",    "number": "+15551234567",    "alias": "string",    "priority_id": "obj_a1b2c3d4",    "priority": 0,    "source": "priority",    "fallthrough": [      {        "channel_id": "ch_a1b2c3d4",        "channel_type": "blooio",        "outcome": "skipped",        "code": "string",        "message": "Hello from Blooio!"      }    ],    "transition": {      "mode": "pre",      "message_id": "msg_a1b2c3d4",      "error": {        "code": "string",        "message": "Hello from Blooio!"      }    },    "opener": {      "type": "invitation",      "message_id": "msg_a1b2c3d4"    }  }}