Ventia
Interactions

Create message

POST
/contact/{idcontact}/message

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <API_KEY>.

Path Parameters

idcontact*string

Unique identifier of the recipient contact as registered on the Ventia platform.

Request Body

Exactly one of channelId, userId, or userIntegrationId must be provided. At least one of text, mediaType+mediaUrl, or template must be provided.

application/json
  1. body
channelId?string

ID of a shared channel to send through. Must belong to the authenticated company. The channel's type (unofficial_wpp, whatsapp_business, fb, or ig) determines which provider is invoked. Mutually exclusive with userId and userIntegrationId.

userId?string

ID of a user whose personal WhatsApp session will send the message. Requires medium to disambiguate between the user's Baileys (unofficial_wpp) and Meta Cloud (whatsapp_business) integrations. Mutually exclusive with channelId and userIntegrationId.

medium?string

Required when userId is used. Selects which of the user's personal WhatsApp integrations to send through.

Value in"unofficial_wpp""whatsapp_business"
userIntegrationId?string

ID of a specific personal WhatsApp Business integration (Meta Cloud) to send through. Shortcut for userId + medium: "whatsapp_business" when the integration is already known. Mutually exclusive with channelId and userId.

text?string

Plain-text body of the message. Required unless mediaType or template is provided.

mediaType?string

Type of attached media. When set, mediaUrl is required.

Value in"image""audio""video""file"
mediaUrl?string

Publicly accessible URL of the media file. Required when mediaType is set.

Formaturi
mimetype?string

MIME type of the media file (e.g. image/jpeg, application/pdf). Useful when the URL does not advertise it.

fileName?string

Original filename for media sent as a document.

caption?string

Optional caption for media messages. Also used as the message body when text is absent.

template?string

ID of a pre-approved WhatsApp Business template to send. Only supported on whatsapp_business channels and on personal WhatsApp Business integrations (userId + medium: "whatsapp_business" or userIntegrationId). Requests combining template with unofficial WhatsApp or other media types are rejected.

replyMessage?string

ID of a prior message this one replies to (when the channel supports quoted replies).

localId?string

Client-supplied temporary ID echoed back for optimistic UIs. Optional.

Response Body

Message was accepted and delivered to the underlying channel. Returned for WhatsApp (official, unofficial, channel, and personal) sends where the dispatch is synchronous.

application/json
  1. response
success?boolean
interactionId?string

ID of the interaction record created for this outgoing message.

curl -X POST 'https://api.getventia.com/api/v1.0/contact/string/message' \  -H 'Content-Type: application/json' \  -d '{  "channelId": "656b0e1f8e5a2c001f3a9d12",  "text": "Hi! Just following up on your inquiry."}'
{  "success": true,  "interactionId": "66f3a9b11c4d8e0023b7c9a1"}