---
title: streamRunEvents
description: Gateway RPC for replayable run event streams.
maturity: stable
apiVersion: v1
---

`streamRunEvents` subscribes to per-run events over WebSocket.

- Method: `streamRunEvents`
- Scope: `run:read`
- Transport: WebSocket RPC (streaming only)
- Request: `{ runId, afterSeq? }`
- Response: `{ streamId, runId, afterSeq, currentSeq }`

Errors are versioned as `v1` and include `InvalidRequest`, `Unauthorized`, `Forbidden`, `RunNotFound`, `SeqOutOfRange`, and `Internal`.

- **Reconnect:** pass the last seen `seq` as `afterSeq`.
- **Gap resync:** if the requested `seq` has been truncated (window default: `10000`), the stream emits `GapResync { fromSeq, toSeq }` with a full run snapshot, then continues.
- **Heartbeat:** `Heartbeat` frames are emitted separately from event frames.
