Wait for an event

View as Markdown

Long-polls until the next event of eventType arrives on the account (optionally matching filters/regexFilters), or until timeout seconds elapse. Useful for one-shot waits such as receiving an inbound SMS code. For a continuous stream, use Open an event stream instead.

Authentication

AuthorizationBearer

Your Dial API key, sent as Authorization: Bearer sk_live_...

Request

This endpoint expects an object.
eventTypestringRequired
Event type to wait for.
filtersmap from strings to anyOptional

Exact-match on top-level event fields.

regexFiltersmap from strings to anyOptional

Regex-match on top-level event fields.

timeoutintegerOptional1-60Defaults to 30
Max seconds to wait.

Response

The matching event.
eventobject

An account event. Every event shares one envelope — id, object (“event”), type, version, createdAt, relatedObject — and a data payload whose shape the type selects. Field names are camelCase. Today: message.received (an inbound SMS), call.ended (a call finished), and call.transcribed (a call’s transcript is ready).

Errors

400
Bad Request Error
401
Unauthorized Error
408
Request Timeout Error