Skip to content
brain.GitHub
Developer docs OPEN SOURCE
HTTP APIEndpoints

Read or stream events

GET
/sessions/{id}/events

Returns a page of retained events as JSON, or streams history and live updates when called with Accept: text/event-stream. Pass after (or Last-Event-ID) with the last retained event's cursor to resume from a known position. Returns 409 cursor_unavailable if the cursor points to an unsynced tail lost during restore.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Opaque session ID.

Match^[a-fA-F0-9]{32}$

Query Parameters

after?string

Opaque cursor from the last retained event.

limit?integer

Maximum number of items to return (JSON mode).

Range1 <= value <= 1000
Default100

Header Parameters

Last-Event-ID?string

SSE reconnect cursor (used when the after query parameter is omitted).

Response Body

Read or stream events

  1. response
events*array<>
next_cursor*string
curl -X GET 'http://127.0.0.1:8080/sessions/string/events' \  -H 'Authorization: Bearer <BRAIN_TOKEN>'
{  "events": [    {      "cursor": "string",      "data": null,      "id": "string",      "input_id": "string",      "time": "2019-08-24T14:15:22Z",      "type": "string"    }  ],  "next_cursor": "string"}