# Stream

> A WebSocket of the index's updates as they happen.

Source: https://docs.tapehouse.xyz/api/stream

`GET /v1/stream`

Text messages, each a JSON object: `{"type":"event","event":Event,"finalized":n}` for each event selected, `{"type":"head","head":Head,"finalized":n}` after each indexing step, and `{"type":"rewind","block":n,...}` when a reorganisation removed every event above block `n`. A client that falls 256 messages behind is disconnected with code 1008 and resumes from /v1/events.

## Query parameters

- `contract`: 
- `event`: 

## Example

```bash
curl "https://indexer-production-f5dc.up.railway.app/v1/stream?contract=tapehouse.MarginAccounts&event=Borrow"
```

## Errors

- 101: Switching to the WebSocket protocol.
- 400: Why the request was not served.
- 401: An X-API-Key the operator did not issue.
- 404: Why the request was not served.
- 426: Not a WebSocket upgrade.
- 429: Over the tier's rate.
