Skip to main content
POST
This reference covers the trigger endpoint. The trigger gambit’s editor generates a ready request under Sample Request & Testing, with the real URL for your region and a typed sample body. Copy it from there instead of assembling the URL by hand. The same panel holds a Test Trigger form. Paste an API key and a channelUserId value, then click Send Test. This fires a real trigger call and reports the result beside the button.

Request

string
required
The agent’s public ID. The same value the embed snippet uses as data-convid.
string
required
The numeric ID of the trigger gambit inside the published flow.
string
required
Bearer YOUR_API_KEY, a key with the Triggers permission.
string
required
The end user’s identifier on the trigger’s channel. For WhatsApp, the phone number in international format.
object
Payload fields that become trigger variables in the flow.

Trigger variables

Every field inside data becomes a trigger variable, available throughout the flow as {{trigger.field}}. The trigger gambit declares typed fields in the builder, and the generated sample body mirrors that schema. For example, data.order_id above is read in any gambit as {{trigger.order_id}}.

Behavior

A trigger call passing three gates for the key, the published flow, and the channel account, then abandoning any open conversation before the flow runs at the trigger gambit
The call starts a new conversation at the trigger gambit and runs the flow from there. Any conversation the same end user already has open on that deployment and channel is marked abandoned first. The trigger gambit must have a channel account selected, and the flow must be published.

Response

boolean
true on a successful trigger.
string
The ID of the conversation the trigger started.
number
Reserved. Always 0.
string
started when the flow began at the trigger gambit.

Errors

Error responses return { "success": false, "error": "…" } with one of these statuses.

Authorizations

Authorization
string
header
required

API key sent as Authorization: Bearer YOUR_API_KEY. Campaign endpoints use campaign-scoped keys; the rest use organization or agent keys with the matching permission.

Path Parameters

convId
string
required

The agent's public ID

gid
string
required

The numeric ID of the trigger gambit

Pattern: ^\d+$

Body

application/json
channelUserId
string
required

The end user's identifier on the trigger's channel

data
object

Payload fields that become trigger variables in the flow

Response

Conversation started

success
boolean
required

True when the trigger was accepted.

conversationId
string

The conversation the trigger started or advanced. Use it to correlate later activity.

messagesQueued
number

How many messages the flow queued for delivery in response.

status
string

Always started on a successful call.

Allowed value: "started"