Send message
Send a message in a conversation. Supports text, attachments, quick replies, buttons, templates, and message tags. Attachment and interactive message support varies by platform.
WhatsApp template messages: to send an approved template into this
conversation (required when the 24-hour customer-service window is
closed), use the template field with a single element carrying the
template reference: { "elements": [{ "name": ..., "language": ..., "components": [...] }] }.
See the template field below for the exact shape. To send a template
to a phone number you have no conversation with yet, use the
create-conversation endpoint (POST /v1/inbox/conversations) instead.
WhatsApp rich interactive messages (list, CTA URL, Flow, location request)
are available via the interactive field. Tap events are delivered through
the message.received webhook with WhatsApp-specific metadata fields
(interactiveType, interactiveId, flowResponseJson, flowResponseData).
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
The conversation ID (id field from list conversations endpoint). This is the platform-specific conversation identifier, not an internal database ID.
Social account ID
Message text
URL of the attachment to send (image, video, audio, or file). The URL must be publicly accessible. For binary file uploads, use multipart/form-data instead.
Type of attachment. Defaults to file if not specified.
"image" | "video" | "audio" | "file"WhatsApp only. When true on an audio attachment, the message is sent
as a voice message (PTT) — the recipient sees the waveform + voice-note
UI instead of a basic audio attachment. The audio file MUST be .ogg
encoded with the OPUS codec (mono) per Meta's voice-message contract;
other formats are rejected by WhatsApp. Ignored for non-audio attachments.
Quick reply buttons. Mutually exclusive with buttons. Max 13 items.
items <= 13Action buttons. Mutually exclusive with quickReplies. Max 3 items.
items <= 3Platform-dependent template payload. Ignored on Telegram.
Instagram / Facebook: a generic template (carousel). Set type: generic
and provide up to 10 elements, each with a title (required) and
optional subtitle, imageUrl, and buttons.
WhatsApp: sends an approved WhatsApp template message, the only message
type WhatsApp accepts when the 24-hour customer-service window is closed.
Provide exactly one element carrying the template reference:
{ "elements": [{ "name": "order_update", "language": "en_US", "components": [...] }] }
(type is ignored on WhatsApp). components is optional and is forwarded
unchanged as the template.components array of Meta's Cloud API send
payload; use it to fill body/header variables and button parameters, e.g.
[{ "type": "body", "parameters": [{ "type": "text", "text": "John" }] }].
Templates with media headers (image, video, document) must include the
header component with its media link here at send time. To send a template
to a phone number with no existing conversation, or to have media headers
filled in automatically from the template definition, use the
create-conversation endpoint (POST /v1/inbox/conversations) instead.
WhatsApp-only. Rich interactive payload for list messages, CTA URL
buttons, Flow prompts, and location requests. When set, takes
priority over buttons and quickReplies. The shape mirrors
Meta's Cloud API interactive object verbatim, so any payload
that works against Meta directly will also work here.
Use buttons / quickReplies for simple button replies
(WhatsApp's interactive.type: "button") — the abstraction caps at
3 buttons and handles the auto-conversion for you. Use this field
only for list, cta_url, flow, location_request_message, or
voice_call messages.
For voice_call, the message renders WhatsApp's native call
button; tapping it starts a voice call to your business number.
Requires WhatsApp Business Calling to be enabled on the sending
number. The optional parameters.payload string is echoed back on
the calls webhook (as cta_payload) for attribution.
For location_request_message, action may be omitted (we default
it to { "name": "send_location" }). WhatsApp renders a localized
"Send location" button; the user's reply arrives as a regular
location message in the conversation.
Tap events come back via the message.received webhook with
metadata.interactiveType set to list_reply or nfm_reply.
Telegram-native keyboard markup. Ignored on other platforms.
Facebook messaging type. Required when using messageTag.
"RESPONSE" | "UPDATE" | "MESSAGE_TAG"Facebook message tag for messaging outside 24h window. Requires messagingType MESSAGE_TAG. Instagram only supports HUMAN_AGENT.
"CONFIRMED_EVENT_UPDATE" | "POST_PURCHASE_UPDATE" | "ACCOUNT_UPDATE" | "HUMAN_AGENT"Platform message ID to quote-reply to. For WhatsApp, pass the wamid (available in message.platformMessageId from webhooks). For Telegram, pass the Telegram message ID.
WhatsApp-only. Send a location pin.
WhatsApp-only. Send one or more contact cards.
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.messages.sendInboxMessage({ path: { conversationId: 'conversation_abc123', }, body: { accountId: 'account_abc123', },});console.log(data);{
"success": true,
"data": {
"messageId": "string",
"conversationId": "string",
"sentAt": "2019-08-24T14:15:22Z",
"message": "string"
}
}{
"error": "string",
"code": "PLATFORM_LIMITATION"
}{
"error": "Unauthorized"
}Remove reaction DELETE
Remove a reaction from a message. Platform support: - Telegram: Send empty reaction array to clear - WhatsApp: Send empty emoji to remove - All others: Returns 400 (not supported)
Send typing indicator POST
Show a typing indicator in a conversation. Platform support: - Facebook Messenger: Shows "Page is typing..." for 20 seconds - Telegram: Shows "Bot is typing..." for 5 seconds - WhatsApp: Shows "typing..." for up to 25 seconds. Requires a recent inbound message in the conversation (Meta references the inbound message id) and also marks that message as read as a side-effect. - All others: Returns 200 but no-op (platform doesn't support it) Typing indicators are best-effort. The endpoint always returns 200 even if the platform call fails.