# Account & History Streams

Use these streams for private account events and public history broadcasts.

### Endpoint pages

* [Order Updates](/api/rest-api/websockets/account-and-history-streams/order-updates.md) — order execution and TP/SL status events
* [Balance Updates](/api/rest-api/websockets/account-and-history-streams/balance-updates.md) — initial balance snapshot and live balance deltas
* [Order Feed](/api/rest-api/websockets/account-and-history-streams/order-feed.md) — live order status events from the history service
* [Activity Feed](/api/rest-api/websockets/account-and-history-streams/activity-feed.md) — live event activity with subscribe and unsubscribe
* [Last Trades Feed](/api/rest-api/websockets/account-and-history-streams/last-trades-feed.md) — public stream of the latest platform trades

### Shared authentication

Only private streams need auth:

* Order Updates
* Balance Updates
* Order Feed

Send this message after connect.

```json
{
  "t": "AUTH",
  "d": {
    "apiKey": "<API_KEY>",
    "signature": "<SIGNATURE>",
    "timestamp": "<UNIX_EPOCH_SECONDS>"
  }
}
```

Build `signature` from `timestamp + "GET" + path`.

{% hint style="info" %}
After reconnect, authenticate again and restore every subscription.
{% endhint %}

### Public streams

* **Activity Feed** is public. Use subscribe and unsubscribe messages.
* **Last Trades Feed** is public. Connect and read messages.

### When to use which stream

* Use **Order Updates** right after placing or changing orders.
* Use **Balance Updates** for wallet and position balance changes.
* Use **Order Feed** for history-service order events.
* Use **Activity Feed** for per-event live activity.
* Use **Last Trades Feed** for public trade tape style updates.

### Common errors

```json
{
  "t": "error",
  "e": "event-id",
  "o": ["outcome-id"],
  "d": {
    "error": "Error description"
  }
}
```

| Error                          | Cause                         |
| ------------------------------ | ----------------------------- |
| Invalid or missing credentials | API key auth failed           |
| No outcome IDs provided        | Subscribe without outcome IDs |
| Invalid time range             | `from` is after `to`          |
| Invalid period                 | Unsupported history period    |
| Unknown message type           | Unsupported `t` value         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.outpoll.com/api/rest-api/websockets/account-and-history-streams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
