Skip to main content
The Trigger Conversations API starts outbound conversations through an existing VIVI channel. Use it to send appointment reminders, operational alerts, status updates, or other event-driven messages from your backend systems. The endpoint supports Twilio Phone, SIP Trunk, Twilio SMS, and Microsoft Teams & Copilot channels.

Endpoint

POST https://api.vivi.bot/channelsApi/{channelId}/conversations/trigger

API reference

View the complete request and response schema in ReDoc.

Before you start

You need:
  • A configured Twilio Phone, SIP Trunk, Twilio SMS, or Microsoft Teams & Copilot channel.
  • The channel ID, available from the channel details page in VIVI.
  • An active account or workspace API credential and its clientId, clientSecret, audience, and tokenUrl.
See API Credentials for instructions on creating credentials and exchanging them for an access token.
The endpoint accepts only machine-to-machine access tokens. An interactive user token or an API channel’s vivi-api-key will not work.

Request an access token

Exchange your API credentials for an access token. Cache and reuse the token until it is close to expiring.
cURL
Send the returned token on trigger requests as Authorization: Bearer YOUR_ACCESS_TOKEN.

Request body

string
required
The message or voice prompt to send. Maximum 4,000 characters. Use {variable} placeholders to personalize the message for each recipient.
array
required
One or more recipients. The default maximum is 100 recipients per request. Every recipient contains a channel-specific target and optional metadata values.
string
required
The destination. Its accepted format depends on the channel type. Maximum 256 characters.
object
String values used to replace placeholders in messageTemplate. Every recipient must provide every variable used by the template. Maximum encoded size: 4 KB per recipient.
object
Optional string metadata for your own request context. Maximum encoded size: 8 KB.
The API validates the complete batch before dispatching anything. Duplicate targets, invalid targets, or missing template variables reject the entire request.

Channel examples

Replace YOUR_CHANNEL_ID and YOUR_ACCESS_TOKEN in the examples below. The channel ID must belong to the same account as the API credential.
Use an E.164 phone number, including + and the country code. VIVI starts a voice call from the first phone number configured on the channel.

Response

The endpoint returns 201 Created after processing the batch. A successful HTTP response can contain both successful and failed recipients, so inspect every item in results. Results remain in the same order as the request.
Voice and SMS dispatches normally return initiating. Microsoft Teams returns completed after provider confirmation. Recipient-specific failures return failed with an error object.

Retries, idempotency, and rate limits

A 201 response means that the batch was processed, not that every recipient succeeded. Retry only results where error.retriable is true, and send a new request containing only those recipients. Generate a new Idempotency-Key for the retry request.
The optional Idempotency-Key header prevents a concurrent duplicate from dispatching twice while the first request is processing. The reservation is released after processing completes, so reusing the key later executes the request again and can create a duplicate.
Each workspace accepts 60 trigger requests per rolling 60-second window. A 429 response includes a Retry-After header with the number of seconds to wait.

Request errors

Error responses include a stable code, a human-readable message, a retriable flag, and a request_id for support and log correlation.