dm_message_send
Send an outbound direct message. Provide EXACTLY ONE of body (text), media (a single attachment), or — on WhatsApp — template, interactive, location or contacts. The message is queued and delivered asynchronously (returns status: pending). Outside Meta's 24h messaging window, a human agent replying to the participant's own inquiry can pass tag: HUMAN_AGENT (Facebook/Instagram only) — never for promotional or automated content. On WhatsApp the window is re-opened only by sending an approved template (or a text with category: utility); free-form sends outside it return 422. reply_markup is Telegram-only; reply_to_external_id works on Telegram and WhatsApp; quick_replies, buttons and card are the Facebook/Instagram interactive primitives and are rejected elsewhere — WhatsApp uses interactive (Meta-shaped) instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Message tag for sending outside the 24h window — extends it to 7 days from the participant's last inbound message. Facebook and Instagram only; ignored on Telegram and Bluesky. Meta's policy restricts it to a human agent replying to the participant's own inquiry: using it for marketing, offers, or automated re-engagement can get that Page / Instagram account's messaging capability suspended. Past 7 days Meta rejects the send and the message lands in status: failed with the platform error in error_details. | |
| body | No | Message text. Required when media is empty (provide body OR media, not both). | |
| card | No | Facebook and Instagram only. Extra generic-template fields for the card that carries buttons — requires buttons. Renders a richer product-style card. | |
| media | No | Up to one media attachment as a URL or local file path (absolute /path/to/file.jpg, relative ./image.png, or ~/Pictures/photo.jpg). Max 1 attachment. Not supported on Bluesky. WhatsApp limits: image 5MB jpeg/png, video 16MB mp4/3gpp, audio 16MB, document 100MB; on WhatsApp body may accompany media as its caption. | |
| buttons | No | Facebook and Instagram only. Up to 3 buttons attached to the message itself, which stay in the thread. Sent as a Meta generic template whose element title is your body — so body is required and capped at 80 characters, and buttons cannot be combined with media. A postback tap arrives as an inbound message carrying tapped_action.payload. | |
| chat_id | Yes | Chat hashid OR external_conversation_id | |
| category | No | WhatsApp only. Mark a plain text send as a utility Direct Send so it can go outside the 24h window without a template. Text only — cannot be combined with media, template, interactive, location or contacts. Meta reviews and bills these as utility conversations. | |
| contacts | No | WhatsApp only. Contact cards in Meta's contacts shape, e.g. [{ name: { formatted_name, first_name }, phones: [{ phone, type }] }]. | |
| filename | No | WhatsApp only. Display filename for a document attachment; defaults to the uploaded file's name. | |
| location | No | WhatsApp only. Send a map pin. | |
| template | No | WhatsApp only. Send an APPROVED message template (see whatsapp_templates_list). The only way to message a participant outside the 24h window or to open a brand-new conversation. Cannot be combined with body or media. variables fill the positional placeholders in order: header text vars first, then body vars, then dynamic URL button vars — the count must match the template's variable_count. | |
| voice_note | No | WhatsApp only. Deliver an audio attachment as a voice note (renders with the waveform player). The file must be OGG with the Opus codec. | |
| interactive | No | WhatsApp only. Meta-shaped interactive message object passed through unchanged — reply buttons (type: button, up to 3), list (type: list, up to 10 rows), cta_url, product / product_list, flow, location_request_message. Must carry type. A tap comes back as an inbound message whose body is the tapped title, with the reply id in platform_data.interactive. Session message: only inside the 24h window. | |
| link_preview | No | WhatsApp only. Set false to suppress the URL preview on a text message (default true). | |
| reply_markup | No | Telegram only. reply_markup payload — inline keyboard, custom reply keyboard, force-reply, or remove-keyboard. | |
| quick_replies | No | Facebook and Instagram only. Up to 13 tappable chips shown above the participant's composer; they disappear once one is tapped. A tap arrives as an inbound message carrying tapped_action.payload. On Instagram, quick replies only work on a plain-text message — not with media and not with buttons (both are accepted on Facebook). | |
| reply_to_external_id | No | Telegram and WhatsApp. Platform message id (Telegram message_id or WhatsApp wamid) of the message to quote / thread under. |