Stream events
GET/v1/events
- Scope
messages:read
Server-Sent Events: each event arrives as event: <type> and data: <event JSON>, the same JSON webhooks get. Live only: events from before you connected aren't replayed, so use webhooks for anything you must not miss. A comment line every 15 seconds keeps the connection open.
Parameters
Query
profile_idstringOnly this line's events.
typesstringComma-separated event types, such as
message.received,message.sent.
Response
200 OKA stream of events.
A stream of text/event-stream messages; each data: line is one event:
idstringrequiredevt_…object"event"requiredtype"message.received" | "message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.fallback" | "message.reaction" | "draft.created" | "draft.approved" | "draft.rejected" | "chat.updated" | "profile.online" | "profile.offline" | "call.ringing" | "call.answered" | "call.transferred" | "call.ended" | "call.voicemail" | "call.transcription" | "calling.cap_warning" | "webhook.test"requiredcreated_attimestamprequiredprofile_idstring or nullrequireddatamaprequiredDepends on
type:{ message }formessage.*,{ draft }fordraft.*,{ call }forcall.*,{ chat, changed, by }forchat.updated.
Errors
| Status | Code | Means |
|---|---|---|
| 400 | validation_failed | A field is missing or invalid. |
| 401 | unauthorized | The API key is missing, unknown or revoked. |
| 403 | insufficient_scope | The API key lacks the scope this needs. |
| 404 | not_found | No such object, or the key can't see it. |
Every error is { "error": { "code", "message" } }. All error codes.