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

# Stream the thread

> Read the agent's full activity thread across all of a migration's runs — as a snapshot you cursor through, or a live SSE stream.

```http theme={null}
GET https://app.vern.so/api/v1/migrations/{migration_id}/thread
GET https://app.vern.so/api/v1/migrations/{migration_id}/thread/stream
```

The agent records every step it takes to a durable **thread**. A migration's
thread is the union of those events across **all** its runs (generate, update,
clarify, execute), in a stable order — so you can render a live activity feed, a
transcript, or just watch progress without tight-polling the run.

Read it two ways: a **snapshot** you page through with a cursor, or a **live SSE
stream**.

## Authentication

Requires an `x-api-key` header. See [Authentication](https://docs.vern.so/migration-api/authentication.md).

## Query parameters

Both endpoints accept the same parameters:

**after** `number`

Return only events with a `sequence` greater than this. Pass the previous
response's `last_sequence` to page forward (snapshot) or resume (stream). Omit
to start from the beginning.

**include** `string` (default: user)

Verbosity:

* **`user`** (default) — prose, status, preview, the agent's questions,
  completion, and errors.
* **`tools`** — the above plus tool calls, tool results, and task IDs.
* **`all`** — everything, including the agent's thinking and internal prepared
  inputs.

## Snapshot

```http theme={null}
GET https://app.vern.so/api/v1/migrations/{migration_id}/thread
```

`200 OK`

```json theme={null}
{
  "events": [
    {
      "sequence": 1042,
      "type": "status",
      "data": { "message": "Reading your files" },
      "created_at": "2026-06-19T15:32:13.000Z"
    },
    {
      "sequence": 1043,
      "type": "message",
      "data": { "text": "Mapped 4 of 5 columns; one needs your input." },
      "created_at": "2026-06-19T15:32:20.000Z"
    }
  ],
  "last_sequence": 1043
}
```

**events\[].sequence** `number`

The event's stable cross-run ordinal. Use the response's `last_sequence` as the
next `after`.

**events\[].type** `string`

The public event type — one of `message`, `thinking`, `status`, `tool_call`,
`tool_result`, `task`, `request_input`, `prepared`, `preview`, `completed`,
`error`. Which types appear depends on `include`.

**events\[].data** `object`

The event payload, kept intact so you can render tool calls, previews, and
prompts.

**events\[].created\_at** `string`

ISO 8601 timestamp.

**last\_sequence** `number | null`

The highest sequence in this page — pass it as `after` to fetch what's next.

## Live stream (SSE)

```http theme={null}
GET https://app.vern.so/api/v1/migrations/{migration_id}/thread/stream
```

A [Server-Sent Events](https://developer.mozilla.org/docs/Web/API/Server-sent_events)
stream of the same events. Each message is `event: <type>` + `data: <json>`:

```
event: status
data: {"sequence":1042,"type":"status","data":{"message":"Reading your files"},"created_at":"2026-06-19T15:32:13.000Z"}

event: message
data: {"sequence":1043,"type":"message","data":{"text":"Mapped 4 of 5 columns; one needs your input."},"created_at":"2026-06-19T15:32:20.000Z"}

event: done
data: {"last_sequence":1043}
```

The stream tails new events until the migration has no active run and the backlog
is drained, then sends a final `event: done` carrying the last sequence. It also
closes after a time budget (\~29 minutes) — when it does, **reconnect** with
`?after=<last_sequence>` to continue exactly where you left off. Watch for an
`event: error` message, which signals a stream-side error before close.

```bash theme={null}
curl -N "https://app.vern.so/api/v1/migrations/c0a8012e-.../thread/stream?include=tools" \
  -H "x-api-key: $VERN_API_KEY"
```

## Errors

| Status | Meaning |
| - | - |
| `401` | API key missing or invalid. |
| `404` | The migration isn't in your account. |
| `429` | **30 requests per minute** per account (the Reads class). Check `Retry-After`. See [Rate limits](https://docs.vern.so/migration-api/errors.md#rate-limits). |
| `500` | Server error. |
| `503` | (snapshot) The migration's history couldn't be loaded this time — a transient failure. Retry; it's never answered with an empty thread instead. The stream reports the same kind of failure as an `event: error` frame. |

## Next

* [Poll a run](https://docs.vern.so/migration-api/poll-a-run.md) — the per-run status and report.
* [Get the preview](https://docs.vern.so/migration-api/get-the-preview.md) — the structured output.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.