Skip to content

Events

Receive realtime events: Socket.IO, SSE, polling. · 3 endpoints

Event type catalog

GET/api/v1/events/typesNo API key needed

Example request

bash
curl "http://127.0.0.1:9900/api/v1/events/types"

Get events after a seq cursor (polling)

GET/api/v1/eventsScope: events:subscribe

Call repeatedly with since = pagination.next_since. Events are kept for 7 days / 50,000 records; change this in Settings (Cài đặt).

Parameters

since
query · optional
integer
≥ 0 · default 0
The last seq you received
limit
query · optional
integer
≥ 1 · ≤ 1000 · default 200
types
query · optional
string[]
max 50 items
Filter by event type, e.g. message.*,friend.request.received
account_ids
query · optional
string[]
max 200 items

Example request

bash
curl "http://127.0.0.1:9900/api/v1/events" \
  -H "Authorization: Bearer dpk_xxx"

Server-Sent Events stream

GET/api/v1/events/streamScope: events:subscribe

Each event: id: <seq>, event: <type>, data: <json>. Reconnect with the Last-Event-ID header or ?since= to receive what you missed. A : ping comment is sent every 15 seconds.

Parameters

since
query · optional
integer
≥ 0
types
query · optional
string[]
max 50 items
Filter by event type, e.g. message.*,friend.request.received
account_ids
query · optional
string[]
max 200 items

Example request

bash
curl "http://127.0.0.1:9900/api/v1/events/stream" \
  -H "Authorization: Bearer dpk_xxx"