Event socket
/api/events/wsAuthenticate with Authorization: Bearer mbk_..., or ?ticket= from POST /api/events/tickets. Send {"op":"subscribe","types":[...],"subjects":[...],"cursor":"..."} within ten seconds; events arrive as {"kind":"event","event":{...}}. See https://docs.modbot.co/api/events-websocket/.
Authorization
apiKey An API key, made on Settings, API keys. Every key starts with mbk_.
In: header
Query Parameters
Response Body
curl -X GET "https://example.com/api/events/ws"Create event ticket POST
A one-use ticket for opening the event WebSocket from a browser. Lasts sixty seconds and works once. It stands for whoever asked for it: a session, or the key in the Authorization header.
Event polling GET
Authenticate with `Authorization: Bearer mbk_...`. Returns events after `cursor` at once when there are any, up to `limit` (default 100, at most 500); otherwise waits up to `wait` seconds (default 30, at most 60) for one and returns an empty list. No cursor means from now. Send the returned `cursor` back; `more` means poll again straight away. `types` and `subjects` repeat or are comma-separated. Field names in the answer are snake_case (`type_raw`, `occurred_at`, `world_id`); the keys inside an event's `data` are camelCase. See https://docs.modbot.co/api/long-polling/.