API Reference
Every integration makes the same three moves: read a snapshot with POST /info, keep it live over WebSocket, and write with a signed POST /exchange action. Reads are unauthenticated. Writes are signed locally by your own agent key, so there are no API keys to provision.
New here? Run Try Testnet to see a full client work in your browser, follow the call order in Integration flows, then read Signing before writing your own client — or let the TypeScript SDK handle it.
Find the right API
Pick what you are building. Each line lists its calls in order; live marks a WebSocket subscription. Hover a name to see what it does.
Trading
- Place an order and know when it fillsapproveAgent,order,orderUpdateslive,userFillsFlow →
- Show, cancel, or amend open ordersfrontendOpenOrders,orderUpdateslive,cancel,modify2
- Show positions and marginclearinghouseStatelive,updateLeverage,updateMarginMode
- Fill the order ticket (max size, leverage, liq. price)activeAssetDatalive,getMaxPositions,getLiquidationPrices
- Set and show take-profit / stop-lossorder,tpslOrders,positionTpslOrders,historicalTpslOrders
Market data
Account & funds
- Deposit USDCsettings,depositWithPermit,userNonFundingLedgerUpdates,TxRelayFlow →
- Withdraw fundswithdraw3,tokenSend,userNonFundingLedgerUpdates,TxRelayFlow →
- Move funds between perp and OutcometokenSend,perpClearinghouseState,clearinghouseState
- Show order and trade historyhistoricalOrders,userFills,orderDetails
- Show the funding rate and paymentsactiveAssetCtx,userFundingslive
- Show a user’s fee rateuserFees,feeTierRates,feeTierInfo
Outcome markets
- Browse Outcome marketsoutcomeMeta,outcomeAssetCtxs,outcomeBboslive
- Trade an Outcome markettokenSend,order,outcomeOrderUpdatelive,outcomeOrderUpdateslive,outcomePositionsFlow →
- Chart an Outcome probabilityoutcomeProbability,candlelive
Builders & keys
- Earn builder fees on the flow you routeapproveBuilderFee,order,builderState,claimBuilderRewardsFlow →
- Manage agent (API) keysapproveAgent,approvedAgents,agentOwner
Browse by data instead
Pick the row for the data, then the column for how you need it. A dash means that transport has no equivalent — public trades, for example, exist only as a stream.
POST /infoStreamWebSocketWritePOST /exchangeEndpoints
| Endpoint | What it does | Reference |
|---|---|---|
POST /info | Read-only queries — balances, positions, orders, fills, history, the book, market metadata, deposit settings | Info API |
POST /exchange | Every write — orders, cancels, margin, fund movements, builder codes. One signed action per request. | Exchange API |
WS /ws | Node stream — books, trades, account updates, chain data | WebSocket API |
WS /api-ws | API-service stream — tickers, trade lists, candles, history snapshots, and async Outcome failures | WebSocket API |
WS /ws-rtds | Crypto reference prices for Outcome underlyings — spot, Chainlink, TWAP | WebSocket API |
TxRelay /api/v1/bridge/… | Cross-chain deposit / peg addresses, on a separate host | TxRelay API |
The Info, WebSocket, Exchange, and TxRelay references are Beta: endpoints are live and stable in shape, but some pages are still being written. Limits are on Rate limits.
Networks
One host per network serves /info, /exchange, /ws, /api-ws, /ws-rtds, /account, and the testnet faucet — it routes each request to the node or the API service for you. TxRelay has its own host.
| Mainnet | Testnet | |
|---|---|---|
| API host | https://rpc.txflow.com | https://rpc.txflow-testnet.xyz |
Faucet — POST /request-fund | — | same as API host |
TxRelay — /api/v1/bridge | https://api-bridge.txflow.com | https://devnet-bridge.txflow.net |
| EIP-712 network name | TxFlow-Mainnet | TxFlow-Testnet |
| Chain ID | 869 | 2511 |
Signing apiVersion (EIP-712 version) | 1 | 1 |
The network name and chain ID go into the EIP-712 domain, which keeps a testnet signature from replaying on mainnet.
Every code sample and Try it panel targets testnet, so nothing copied from these docs can hit mainnet by accident. Swap the host and the domain values above when you go live.
Conventions
| Content type | application/json on both POST endpoints |
| Version header | send x-api-version: 2026-08-16 on every /info and /exchange request — every sample here does, and responses are documented in that format |
| Responses | /info: { "success": true, "code": 0, "data": … }, or success: false with code and message on error. /exchange: see Response |
| Field case | camelCase, except the Outcome metadata responses, which are snake_case |
| Numbers | quantities and prices are strings, to avoid float rounding |
| Instrument ids | The index from perpMeta, or an Outcome market's instrument_id from outcomeMeta. In requests, coin and the /info asset filter take it as a numeric string ("coin": "1") — every endpoint accepts that form, and node reads such as l2Book accept no other; instrumentId / instrumentIds and the /exchange fields a / asset take it as an integer ("a": 1). In responses, coin is a display name whose form varies by endpoint (BTC-USDC, BTC, OUTCOME-4991183) — match rows on asset / instrumentId instead, compared as numbers (asset is "1" in some responses and 1 in others). |
| Account types | accountType is perp or outcome (perps is accepted as an alias) |
| Nonces | millisecond timestamps, unique per signer |
| Time | the consensus timestamp is the chain's only clock — see Consensus & Execution |