---
title: Stream agent run events (SSE)
description: Server-Sent Events stream.
api_method: GET
api_path: "/v1/agent-runs/{runId}/events"
canonical_url: https://wiblo.app/docs/developers/api/agent-runs/get-agent-run-events
last_updated: 2026-07-28T17:12:38+02:00
md_url: https://wiblo.app/docs/developers/api/agent-runs/get-agent-run-events.md
---

# Stream agent run events (SSE)

`GET /v1/agent-runs/{runId}/events`

Server-Sent Events stream. First replays durable events with `seq > after` (the `?after=` cursor, default 0), then emits live events as the run progresses. Each frame is `id: <seq>`, `event: <type>`, `data: <AgentEventEnvelope>`; the SSE `id` carries the DB `seq` so a reconnecting client's `Last-Event-ID` is the replay cursor. Disconnecting does NOT cancel the run — events are durable and a reconnect with `?after=<lastSeq>` resumes. Not rate-limited (long-lived stream).

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |

## Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | `integer \| null` | No | Replay cursor. The stream replays durable events with `seq` strictly greater than this value, then attaches live. Defaults to 0 (replay from the start). |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/agent-runs/{runId}/events \
  -H "Authorization: Bearer $WIBLO_TOKEN"
```

**TypeScript**

```ts
import { createSdk, getAgentRunEvents } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await getAgentRunEvents({
  client: sdk,
  path: { runId: "..." },
})
```

## Responses

**`200`** — An event stream. The body is `text/event-stream`; each `data:` line is one `AgentEventEnvelope` JSON object.

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`404`** — No run visible to the caller with this id (`AGENT_RUN_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`422`** — Path param failed UUID validation (`INVALID_PARAMS`). Returns `ApiErrorEnvelope`.
