v2

latestOpenAPI 3.1.02026-08-075421692.0 MB
Messages

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).

Idempotency: send an Idempotency-Key header to make retries safe (e.g. after a client-side timeout where delivery is unknown): same key + same body replays the original response (with Idempotent-Replayed: true) instead of sending the message a second time; same key + different body returns 422; a key still in flight returns 409. Works for JSON and multipart (file upload) requests alike. Keys are retained for 24 hours.

post/v1/inbox/conversations/{conversationId}/messages

Path parameters

conversationIdstring required

Opaque conversation identifier, accepted verbatim from the list endpoint or from the conversationId on inbox webhooks. Format not to be assumed.

Headers

Idempotency-Keystring

Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.

Request body

accountIdstring required

Social account ID

messagestring

Message text

attachmentUrlstring

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.

category'utility'

WhatsApp only (Meta Direct Send). Sends this message as a business-initiated UTILITY message without an approved template, for example outside the 24-hour customer service window; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Supported only for text messages (link preview ok) and interactive messages (reply buttons, CTA URL buttons, voice-call button, header of text/image/video/document). Cannot be combined with template, attachments, location, or contacts. Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests.

attachmentType'image' | 'video' | 'audio' | 'file'

Type of attachment. Defaults to file if not specified.

attachmentNamestring

WhatsApp only. Display name for a document sent via attachmentUrl with attachmentType: file (e.g. "Report.pdf"). Maps to the recipient's file name; without it WhatsApp derives the name from the URL and shows "Untitled". Ignored for image/video/audio and for binary uploads (which use the uploaded file's name).

voiceNoteboolean

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.

messagingType'RESPONSE' | 'UPDATE' | 'MESSAGE_TAG'

Facebook messaging type. Required when using messageTag.

messageTag'CONFIRMED_EVENT_UPDATE' | 'POST_PURCHASE_UPDATE' | 'ACCOUNT_UPDATE' | 'HUMAN_AGENT'

Facebook message tag for messaging outside 24h window. Requires messagingType MESSAGE_TAG. Instagram only supports HUMAN_AGENT.

replyTostring

Platform message ID to quote-reply to. For WhatsApp, pass the wamid; for Telegram, the Telegram message ID (both available in message.platformMessageId from webhooks or the list-messages endpoint). On Slack it threads the reply (thread_ts) instead of quoting. Silently ignored on platforms without send-side reply support, including Instagram and Facebook Messenger (Meta's Send API rejects reply_to on Instagram and does not expose it on Messenger).

Response

Message sent

successboolean