> ## Documentation Index
> Fetch the complete documentation index at: https://docs.case.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Events and messages

> Stream live Linc activity and replay durable session history.

Session creation returns three event URLs:

* `streamUrl` for the live native event stream
* `turnStreamUrl` for turn-oriented live delivery
* `replayUrl` for durable event recovery

Use the live stream for responsive interfaces. Persist the latest sequence number and use the
router replay endpoints after reconnecting.

## Replay native events

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl "https://api.case.dev/linc/v1/sessions/$SESSION_ID/events?cursor=120&limit=500" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
```

`cursor` is exclusive: the response contains events with a sequence number greater than the
cursor. `afterSeq` is an alias, and `excludeEventTypes` accepts a comma-separated list.

```json theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
{
  "sessionId": "linc_123",
  "cursor": 120,
  "lastSeq": 123,
  "events": [
    {
      "seq": 121,
      "type": "message_update",
      "data": {},
      "createdAt": "2026-07-28T14:00:00.000Z"
    }
  ]
}
```

## Replay completed messages

Use the stable message read model when you need conversation history rather than every native
runtime event:

```bash theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl "https://api.case.dev/linc/v1/sessions/$SESSION_ID/messages?cursor=0&limit=5000" \
  -H "Authorization: Bearer $CASEDEV_API_KEY"
```

The response includes completed messages, their source sequence numbers, the native session ID,
and the resumable session-file path. Both events and messages remain available after a session
ends.

## Reconnect safely

1. Track the highest processed `seq`.
2. Reconnect the live stream when possible.
3. Replay from the stored cursor to fill any gap.
4. De-duplicate by sequence number.

This keeps clients correct across network interruptions, sandbox idle stops, and process restarts.
