POST

Create Message

Sends an outbound message in a conversation over any supported channel.

POSThttps://api.vantaxai.com/v1/conversations/{conversation_id}/messages

Create a message to reply to a contact on their channel. The `channel` you pass determines which fields are required: • **SMS / WhatsApp** — set `content` and `from_phone_number_id` (the owned number to send from). Optionally attach `media_url` for MMS / media messages. • **Facebook Messenger / Instagram** — set `content`. The connected Page or IG account that owns the conversation is used automatically; `media_url` may carry images. • **Email** — set `content` plus a `subject`. You may also pass `html` for a rich-text body; `content` is used as the plain-text fallback. The message is sent immediately and returns with an initial `status` of `queued` or `sent`; delivery state is updated asynchronously to `delivered` or `failed`.

Channel-specific requirements

SMS and WhatsApp require `from_phone_number_id`. Email requires `subject`. Facebook Messenger and Instagram route through the connected Page / IG account that owns the conversation — no extra fields needed.

Messaging windows

Facebook Messenger, Instagram, and WhatsApp enforce platform-side messaging windows (e.g. WhatsApp's 24-hour customer service window). Sending outside the window may be rejected with a 422 — use an approved template instead.

Headers

  • Authorizationstringrequired

    Bearer authentication with your secret API key.

    example: Bearer vx_live_3fa9c2…

  • Content-Typestringrequired

    Must be application/json for requests with a body.

    example: application/json

Path Parameters

  • conversation_idstringrequired

    The conversation to post the message into.

    example: conv_4b8e21

Body Parameters

  • channelstringrequired

    The channel to send on. Must match a channel the contact can be reached on.

    smswhatsappfacebookinstagramemail

    example: sms

  • contentstringrequired

    The message body (max 4000 chars). For email, this is the plain-text body / fallback.

    example: Yes! We're open Saturday 9am–4pm.

  • subjectstringoptional

    Email subject line (max 255 chars). Required when channel is `email`, ignored otherwise.

    example: Re: Saturday hours

  • htmlstringoptional

    Optional rich-text HTML body for email. When omitted, `content` is sent as plain text.

    example: <p>Yes! We're open <b>Saturday 9am–4pm</b>.</p>

  • from_phone_number_idstringoptional

    Owned phone number to send from. Required for `sms` and `whatsapp` channels.

    example: pn_55ad12

  • media_urlarrayoptional

    Optional list of publicly accessible media URLs to attach (MMS / images). Ignored by `email`.

    example: ["https://cdn.example.com/menu.jpg"]

Request

# Channel: SMS — requires from_phone_number_id, optional media_url for MMS
curl -X POST https://api.vantaxai.com/v1/conversations/conv_4b8e21/messages \
  -H "Authorization: Bearer vx_live_3fa9c2..." \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "sms",
    "content": "Yes! We are open Saturday 9am-4pm. Want me to book a slot?",
    "from_phone_number_id": "pn_55ad12"
  }'

Response

{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "id": "msg_7c1a4f",
    "conversation_id": "conv_4b8e21",
    "channel": "sms",
    "direction": "outbound",
    "content": "Yes! We are open Saturday 9am-4pm. Want me to book a slot?",
    "subject": null,
    "sender_type": "human",
    "media_url": [],
    "status": "sent",
    "created_at": "2026-01-14T10:30:12Z"
  }
}