Events
Move a live call from your own server. When something happens outside the call, such as a booking made on a web page, send an event and the flow reacts at once, without waiting for the caller to speak.
Most paths are taken because of something the caller said. An event path is taken because of something your own system saw: the caller booked a slot on a web page, finished a form in your app, or a colleague picked up their case. Your server sends a named event into the live call; if the step the call is on has a path waiting for that name, the call takes it, and the step it lands on speaks straight away.
Add an event path
Event paths have no form in the builder. Add them as text in Settings ›
Advanced › Raw flow, among the step's paths (its next), or through the
Flow API:
event is the name your server will send. A step can wait for several events,
each on its own path, alongside its other paths. Once added, the path shows on
the canvas like any other, and its panel shows the event it waits for. A branch
can't have an event path, because a call never rests on one.
Here is a whole flow built around two events. The agent texts the caller a booking page and stays on the line while they pick a time for a demo.
While the call is on Send the booking page, the agent keeps talking with
the caller; nothing they say moves the call on, except the rule that gives up on
the page after four turns. When your server sends slot_booked with
booked_slot in its data, the call moves to Confirm the booking, which says
the time at once and hangs up after its line. If the time was taken first,
slot_taken (with requested_slot) moves the call to That time went,
which waits for the next booking.
Send an event
Send it from your own server, with an API key (Authorization: Bearer gat_…)
that can place calls (the calls:write scope). execution_id is the id the call
was placed under, the one POST /v2/calls returns; the call must be one of your
organization's.
Body
| Field | Type | |
|---|---|---|
name | text, required | The event's name, up to 64 characters. It is what an event path's event matches. |
data | object, optional | Values that join the call's data under their own names, up to 8 KB as JSON. Defaults to {}. |
Responses
202 Accepted means the event was queued for the call:
It does not mean a path was taken: that depends on the step the call is on when the event is handled (below).
Errors use the /v2 envelope, {"error": <code>, "message": "<sentence>"}:
| Status | error | When |
|---|---|---|
202 | — | Queued. |
401 | 1100 | No API key, or one that isn't valid. |
403 | 1102 | The key can't place calls. |
404 | 1200 | No call with that id in your organization. |
409 | 1201 | The call isn't live: it is scheduled and hasn't been placed yet, it has already ended, or it is still connecting. The last answer carries Retry-After: send the event again after that many seconds. |
422 | 1001 | name is missing, empty or longer than 64 characters; data isn't an object or is larger than 8 KB; or the body has a field this endpoint doesn't take. |
429 | 1300 | Rate limited. Retry after Retry-After seconds. |
503 | 1501 | Temporarily unavailable. Retry with backoff. |
What the call does with it
-
The call picks the event up within about a second, then waits until the agent is neither speaking nor working on a reply, for up to 30 seconds, so it never talks over itself.
-
Its
datajoins the call's data under the names you sent, and the event's name is kept as_last_event. Rules can test the values (booked_slotis filled in) and text can say them ({booked_slot}). See Values picked up during the call. -
If the current step has an event path for that name, the call takes it, and the step it lands on speaks at once:
- an AI reply speaks first, without waiting for the caller;
- a fixed line plays its line, and hangs up afterwards if it is set to;
- a branch decides and moves the call on to a step that speaks.
If the caller happens to be talking at that moment, the call still moves, but the new step answers what the caller says instead of speaking first.
-
If it has no such path, nothing is said. The data is still added, for later steps and rules.
Events for one call are handled one at a time, in the order they arrive. When two event paths on a step wait for the same name, the one with the lower order is taken. An event never puts words in the caller's mouth: the transcript shows the agent's new turn straight after its previous one.
Trying an event path
Events need a live call with an id you know. Place one with POST /v2/calls,
which answers with its execution_id, and send the event from a terminal
while you're on the call.

