# sessions.events

`GET /api/public/v1/session-events`

Session and app-hold events in id order after a cursor (after = the last id you processed; duplicates are safe to skip by id); kept 7 days, gap=true when events after your cursor are already gone.

- Capability: `session.read`
- Command: no
- MCP tool: `sessions_events`

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `after` | query | integer | no | The last event id you processed (0 = from the oldest kept) (min 0, max 9007199254740991) Default: `0`. |
| `limit` | query | integer | no | (min 1, max 500) Default: `100`. |
| `session_id` | query | string (uuid) | no |  |
| `profile_id` | query | string (uuid) | no |  |

## Response

`200` with `{ data, correlation_id }`.

| Field | Type | Always present | Description |
|---|---|---|---|
| `data` | array<object> | yes |  |
| `data[].id` | integer | yes | Cursor: pass the last one you processed as `after` (min -9007199254740991, max 9007199254740991) |
| `data[].kind` | string | yes |  |
| `data[].session_id` | string (uuid) | yes |  |
| `data[].profile_id` | string (uuid) | yes |  |
| `data[].occurred_at` | string (date-time) | yes |  |
| `data[].data` | object | yes |  |
| `correlation_id` | string (uuid) | yes |  |
| `gap` | boolean | no | true when events after your cursor were already pruned: resync with sessions.list |
| `oldest_id` | integer \| null | no |  |
| `retention_days` | integer | no | (min -9007199254740991, max 9007199254740991) |
| `page` | object | no |  |
| `page.limit` | integer | yes | (min -9007199254740991, max 9007199254740991) |
| `page.next_after` | integer | yes | (min -9007199254740991, max 9007199254740991) |
| `page.has_more` | boolean | yes |  |

New fields can appear at any time; ignore the ones you do not know.

## Errors

| Code | HTTP | Retryable |
|---|---|---|
| `UNAUTHENTICATED` | 401 | no |
| `FORBIDDEN` | 403 | no |
| `RATE_LIMITED` | 429 | yes |
| `VALIDATION_FAILED` | 422 | no |
| `DEPENDENCY_UNAVAILABLE` | 503 | yes |
| `UNKNOWN` | 500 | no |

## Example (curl)

```bash
curl "https://browlix.com/api/public/v1/session-events" \
  -H "Authorization: Bearer $BROWLIX_API_KEY"
```

## Example (TypeScript SDK)

```ts
import { Browlix } from "@browlix/sdk";

const bx = new Browlix({ apiKey: process.env.BROWLIX_API_KEY! });
const reply = await bx.call("sessions.events");
console.log(reply.data);
```

## Example (Python)

```python
import os
import requests

r = requests.get(
    "https://browlix.com/api/public/v1/session-events",
    headers={"Authorization": f"Bearer {os.environ['BROWLIX_API_KEY']}"},
    timeout=60,
)
print(r.status_code, r.json())
```

## Example (MCP)

```json
{
  "method": "tools/call",
  "params": {
    "name": "sessions_events",
    "arguments": {}
  }
}
```
