API reference
Events API
Guide with types table: Events.
| Endpoint | Purpose |
|---|---|
GET /api/v1/events | Cursor poll: type, since, limit → {events, cursor} |
POST /api/v1/events/wait | Long-poll: {types[], timeout_ms ≤55000, since} |
GET /api/v1/events/stream | SSE stream (?token=klwst_…, ~50s runs, ≤6 concurrent) |
POST /api/v1/events/stream-token | Mint the 120s stream token |
POST /api/v1/events/wait
Blocks until a matching event arrives or the timeout passes. Returns {event} or {event: null, timed_out: true} — loop for continuous consumption. Default timeout 25s, max 55s. This powers the MCP wait_for_event tool.
Event envelope
Events carry id, type, created_at, and a type-specific payload (call ids, numbers, message bodies, metadata you attached to calls). The same envelope is delivered on webhooks, SSE frames, and poll responses.