Send an event to a live call
Send a named event into a live call, from your own server.
Send a named event into a live call, from your own server.
Use it when something happens outside the call that the agent should react to
at once: the customer opened a payment link, a payment went through, a form
was submitted. On a flow agent, the step the call is on takes its path that
waits for this event, and the next step speaks without waiting for the
caller. The event's data becomes fields of the call, which the flow's
rules can read and its steps can use as {names}, whether or not a path
waits for the event. A step with no path for this event stays where it is.
202, not 200. The event is queued and reaches the call in about a second. If the agent is speaking, or the caller is, it is handled when that turn ends; several events are handled in the order they were sent.
404 means no such call in your organization. 409 means the call is not live:
it is scheduled and has not been placed yet, it has already ended, or it has
been placed but is still connecting (that answer carries Retry-After).
Rate limit: 2000 requests per minute per organization, counted together with every endpoint that has no stricter limit of its own. Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.
v2/calls/{execution_id}/eventsAuthorization
AuthorizationRequiredBearer <token>
Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.
In: header
Request Body
application/jsonRequirednameName | null
The event's name (required, as name or event). On a flow agent, a path that waits for this event (when.type event, when.event this name) on the step the call is on is taken at once.
64eventEvent | null
The same as name, for clients that send event and properties.
64dataData | null
Fields the event carries, up to 8 KB as JSON. They become fields of the call: the flow's rules can read them and its steps can use them as {names}, whether or not a path waits for the event.
propertiesProperties | null
The same as data, for clients that send event and properties.
Path Parameters
execution_idRequiredExecution Id
The call's id, as returned by POST /v2/calls or GET /v2/calls.
Query Parameters
organization_idOrganization Id
Optional. Must equal your key's organization.
Response Body
202
Successful Response
acceptedAccepted
Always true: the event is queued and reaches the call in about a second.
truenameRequiredName
The event's name, as sent.
execution_idRequiredExecution Id
The call it was sent to.
statusStatus
Always accepted.
"accepted"eventRequiredEvent
The same as name.
run_idRequiredRun Id
The same as execution_id.
401
1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
403
1102 — the key is valid but lacks the scope this endpoint requires, or names another organization. GET /v2/scopes reports what a key holds.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
404
1200 — no such resource in your organization. A resource belonging to another organization answers 404, never 403.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
409
1201 — the resource's current state does not allow this action.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
422
1001 — the body or query failed validation; the message names the first offending field.
errorRequiredinteger
Stable integer code from the error table. Branch on this, not on the message.
messageRequiredstring
One human-readable sentence. Wording may change; the code will not.
429
1300 — the per-organization request rate or concurrent-call limit was reached. Carries Retry-After.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
503
1501 — a service this endpoint depends on is unreachable or returned a 5xx.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
Successful Response

