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

# Bootstrap

> Recover full stream state from snapshot plus retained updates in a single request.

Returns the stream's latest snapshot (if any) plus all retained updates after the snapshot offset, packed as a `multipart/mixed` response. This is the recommended way to initialize a client that needs the complete current state of a stream.

<ParamField path="bucket" type="string" required>
  Bucket ID.
</ParamField>

<ParamField path="stream" type="string" required>
  Stream ID within the bucket.
</ParamField>

## Response

| Status | Meaning                                       |
| ------ | --------------------------------------------- |
| `200`  | Bootstrap response with snapshot and updates. |
| `400`  | Invalid query parameters.                     |
| `404`  | Stream not found or expired.                  |
| `410`  | Requested offset has been trimmed.            |

Response headers include:

| Header                   | Description                                                     |
| ------------------------ | --------------------------------------------------------------- |
| `Content-Type`           | `multipart/mixed; boundary=...`                                 |
| `Stream-Next-Offset`     | The offset after the last included update.                      |
| `Stream-Snapshot-Offset` | The snapshot offset (or `none` if no snapshot exists).          |
| `Stream-Up-To-Date`      | `true` if the response includes all data up to the tail.        |
| `Stream-Closed`          | Present and `true` if the stream is closed and fully caught up. |

## Response body

The body is a `multipart/mixed` message:

<Steps>
  <Step title="Snapshot part">
    The first part is the snapshot blob (or an empty part if no snapshot exists).
  </Step>

  <Step title="Update parts">
    Subsequent parts are individual update messages appended after the snapshot offset. For JSON streams, each update is a separate `application/json` part.
  </Step>
</Steps>

<RequestExample>
  ```bash Example theme={null}
  curl 'https://stream.tonbo.dev/ds/demo/hello/bootstrap'
  ```
</RequestExample>

<Tip>
  After bootstrapping, switch to [SSE reads](/api/read) with `live=sse` starting from the `Stream-Next-Offset` to receive real-time updates.
</Tip>

<Info>
  See [bootstrap](/concepts/bootstrap) and [snapshots](/concepts/snapshots) for the conceptual model.
</Info>
