Alpaca trade_updates
One message per order event on the account: the event name, the whole order object as the REST API returns it, and for fills the price, quantity and resulting position.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
This is a subscription of the Alpaca WebSocket streams, not an HTTP endpoint. It has no method and no path: it is sent as JSON, or as MessagePack where the client asks for it, over an open WebSocket connection.
The Placing Orders page points to this stream, rather than polling, for keeping the state of open orders. The page's multi leg options example adds at, event_id, position_qtys and legs. Values in the sample are invented.
The message
- Name
- trade_updates
- Direction
- Subscription, opened by the client and then fed by the server
- Subscribed to as
- trade_updates
- Carried by
- WebSocket. Alpaca's page says the stream speaks JSON or MessagePack, the latter when the client sends the header Content-Type: application/msgpack, and that trade_updates from the paper address arrives in binary frames.
- Paper account stream
- wss://paper-api.alpaca.markets/stream
- Live account stream
- wss://api.alpaca.markets/stream
- Answers
Fields
The vendor's page does not say which of these fields are required or always present.
| Name | Type | Description |
|---|---|---|
| stream | string | trade_updates. |
| data.event | string | What happened. Common: new, fill, partial_fill, canceled, expired, done_for_day, replaced. Less common: accepted, rejected, pending_new, stopped, pending_cancel, pending_replace, calculated, suspended, order_replace_rejected, order_cancel_rejected. |
| data.order | object | The order, in the same shape as GET /v2/orders/{order_id} returns it. |
| data.timestamp | string | When the event happened. Present on fill, partial_fill, canceled, expired, replaced and rejected. |
| data.price | string | fill and partial_fill: the price of this execution. |
| data.qty | string | fill and partial_fill: the quantity of this execution. |
| data.position_qty | string | fill and partial_fill: the position in the symbol after this execution. |
| data.execution_id | string | fill and partial_fill: the id of the execution, in the page's single leg example. |
Sample
Written by this site from the fields recorded on this page. It has not been run against a terminal, a server or an account, and the values in it are placeholders. No credential is typed into it: where a field holds one, the placeholder says where it comes from. Nothing is entered on this site.
{
"stream": "trade_updates",
"data": {
"event": "fill",
"timestamp": "2026-11-30T14:30:01.000000000Z",
"price": "100.50",
"qty": "1",
"position_qty": "1",
"execution_id": "<an execution id>",
"order": {
"id": "<the order id>",
"symbol": "MOCK",
"side": "buy",
"type": "market",
"status": "filled"
}
}
}Return codes documented for this message
The page lists rejected, order_replace_rejected and order_cancel_rejected among the events of this stream, and the unauthorized status and the error action as the other messages the account stream sends; this site holds each as a record. docs.alpaca.marketschecked
- internal server errorThe error_message of an error action on the account stream, which the page says the server sends before closing the connection.
- order_cancel_rejectedAn event on the trade_updates stream: a request to cancel the order was rejected.
- order_replace_rejectedAn event on the trade_updates stream: a request to replace the order was rejected.
- rejectedAn event on the trade_updates stream: the order was rejected.
- unauthorizedThe status in an authorization message on the account stream: the auth message failed, or a listen message was sent before the connection was authorised (then the message carries action listen).
Limits that apply at Alpaca
| Limit | Value | Scope | Source |
|---|---|---|---|
| client_order_id length | 128 | POST /v2/orders and PATCH /v2/orders/{order_id} | docs.alpaca.marketschecked |
| Crypto order size | 200,000 | Crypto spot orders, buy or sell | docs.alpaca.marketschecked |
| Market data historical API, Basic plan | 200 | Market Data API historical calls, Basic (free) plan | docs.alpaca.marketschecked |
| Market data points per page | 10,000 | Market Data API historical bars, trades and quotes, counted across all symbols | docs.alpaca.marketschecked |
| Market data historical API, Algo Trader Plus | 10,000 | Market Data API historical calls, Algo Trader Plus plan (99 US dollars a month) | docs.alpaca.marketschecked |
| GTC order age | 90 | Orders with time in force gtc | docs.alpaca.marketschecked |
| Trading API request rate | HTTP 429 above the limit, with X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers on replies; no figure on the pages opened | Trading API, per account | docs.alpaca.marketschecked |
| Market data WebSocket authentication timeout | 10 | Market data WebSocket, from connecting to the auth message | docs.alpaca.marketschecked |
| Market data WebSocket connections | Depends on the subscription; 1 for many subscriptions and with none. A second connection is answered with error 406 connection limit exceeded | Market data WebSocket, per account | docs.alpaca.marketschecked |
| Market data WebSocket symbols, Basic plan | 30 | Market data WebSocket, US equities, Basic (free) plan; Algo Trader Plus is unlimited | docs.alpaca.marketschecked |