---
title: "API reference"
url: https://docs.truemarkets.co/api
description: "Every endpoint of every True Markets API. Requests and responses are JSON, and authenticated calls carry a bearer token."
---

Docs index: https://docs.truemarkets.co/llms.txt

# API reference

Every endpoint of every True Markets API. Requests and responses are JSON, and authenticated calls carry a bearer token.

Trading, Accounts, Authentication and Market data share one host, `api.truemarkets.co`. CeFi direct REST, which institutional clients use to trade on the exchange, has its own host, `api.truex.co`.

## How the reference is organized

Each API has its own section below, with its base URL and every endpoint. The REST sections are generated from our OpenAPI specs, and the WebSocket sections from our AsyncAPI specs. Each endpoint page lists every field, response and error code, and has a Try it panel.

The reference tells you what each endpoint accepts. For which calls to make and in what order, follow the guides for [Gateway](https://docs.truemarkets.co/gateway) or the [Trading API](https://docs.truemarkets.co/trading-api).

## Authentication

Mint a token from your API key with `POST /v1/auth/api-key/token`, then send it in `Authorization: Bearer`. When a Gateway client acts for one of its users, the request also carries `TM-On-Behalf-Of`. [Authentication](https://docs.truemarkets.co/developer-resources/authentication) has the flow, and [API keys](https://docs.truemarkets.co/developer-resources/api-keys) explains the keys.

CeFi direct REST takes the same token, on its own host, plus an `x-truex-auth-timestamp` header. [Trade over REST](https://docs.truemarkets.co/institutional/trade-over-rest) has the headers.

An authenticated request

```bash
curl https://api.truemarkets.co/v1/gateway/balances \
  -H "Authorization: Bearer $TOKEN"
```

## Errors

Every error returns the same body. `type` sets the HTTP status, `code` names the specific condition, and `request_id` identifies the request when you write to support. [Errors](https://docs.truemarkets.co/developer-resources/errors) has the full table and what to retry.

## Authentication REST

Exchange an API key signature for a token, and refresh it.

[Open reference](https://docs.truemarkets.co/api/auth/auth-service-api)

Base URL

`https://api.truemarkets.co/v1/auth`

Endpoints

Authentication

[POST`/token/refresh`Refresh access token](https://docs.truemarkets.co/api/auth/refresh-token)[POST`/api-key/token`Exchange API key for tokens](https://docs.truemarkets.co/api/auth/exchange-api-key-token)

OAuth

[GET`/oauth/authorize`Start an authorization request](https://docs.truemarkets.co/api/auth/oauth-authorize)[POST`/oauth/consent`Record a consent decision](https://docs.truemarkets.co/api/auth/oauth-consent)[POST`/oauth/token`Exchange a grant for tokens](https://docs.truemarkets.co/api/auth/oauth-token)[GET`/.well-known/oauth-resource-jwks.json`OAuth resource token key set](https://docs.truemarkets.co/api/auth/oauth-resource-jwks)[GET`/oauth/authorize/details`Describe an authorization request](https://docs.truemarkets.co/api/auth/oauth-authorize-details)[GET`/oauth/consents`List connected apps](https://docs.truemarkets.co/api/auth/list-o-auth-consents)[DELETE`/oauth/consents/{client_id}`Revoke a connected app](https://docs.truemarkets.co/api/auth/revoke-o-auth-consent)[POST`/oauth/register`Register an OAuth client](https://docs.truemarkets.co/api/auth/register-o-auth-client)[GET`/.well-known/oauth-authorization-server`Authorization server metadata](https://docs.truemarkets.co/api/auth/oauth-authorization-server-metadata)

## Accounts REST

Create the users your organization trades for, with their wallets, and read deposit details.

[Open reference](https://docs.truemarkets.co/api/account/true-markets-account-api)

Base URL

`https://api.truemarkets.co/v1/account`

Endpoints

Organizations

[POST`/organizations/{organization_id}/users`Create a user your organization trades for](https://docs.truemarkets.co/api/account/create-organization-user)[GET`/organizations/{organization_id}/users`List the users your organization trades for](https://docs.truemarkets.co/api/account/list-organization-users)[GET`/organizations/{organization_id}/users/{user_id}`Get a user your organization trades for](https://docs.truemarkets.co/api/account/get-organization-user)

Trading Setup

[GET`/me/trading`Get the user's trading setup](https://docs.truemarkets.co/api/account/get-trading-setup)

## Trading REST

Quotes, orders, transfers, balances and transactions, for your own account or for a user you act for.

[Open reference](https://docs.truemarkets.co/api/gateway/true-markets-gateway-api)

Base URL

`https://api.truemarkets.co/v1/gateway`

Endpoints

Quotes

[POST`/quotes`Compute market quote (CeFi only)](https://docs.truemarkets.co/api/gateway/compute-quote)

Orders

[POST`/orders`Create new order](https://docs.truemarkets.co/api/gateway/create-order)[GET`/orders`List user orders](https://docs.truemarkets.co/api/gateway/list-orders)[POST`/orders/{id}/execute`Execute pending order](https://docs.truemarkets.co/api/gateway/execute-order)[POST`/orders/all/cancel`Cancel all open orders on a venue](https://docs.truemarkets.co/api/gateway/cancel-all-orders)[POST`/orders/{id}/cancel`Cancel a limit or TP/SL order (CeFi or DeFi)](https://docs.truemarkets.co/api/gateway/prepare-cancel-order)[POST`/orders/{id}/cancel/execute`Execute a resting DeFi order cancellation](https://docs.truemarkets.co/api/gateway/execute-cancel-order)[GET`/orders/{id}`Get a single order](https://docs.truemarkets.co/api/gateway/get-order)[PATCH`/orders/{id}`Modify an active limit order](https://docs.truemarkets.co/api/gateway/modify-order)[GET`/orders/{id}/status`Get order status](https://docs.truemarkets.co/api/gateway/get-order-status)

Transfers

[POST`/transfers`Create new transfer](https://docs.truemarkets.co/api/gateway/create-transfer)[GET`/transfers`List user transfers](https://docs.truemarkets.co/api/gateway/list-transfers)[POST`/transfers/{id}/execute`Execute pending transfer](https://docs.truemarkets.co/api/gateway/execute-transfer)[GET`/transfers/{id}`Get transfer by ID](https://docs.truemarkets.co/api/gateway/get-transfer)

Ramps

[POST`/ramps`Create a ramp](https://docs.truemarkets.co/api/gateway/create-ramp)[GET`/ramps`List user ramps](https://docs.truemarkets.co/api/gateway/list-ramps)[GET`/ramps/{id}`Get ramp by ID](https://docs.truemarkets.co/api/gateway/get-ramp)[POST`/ramps/{id}/bridge/execute`Execute a ramp's bridge plan](https://docs.truemarkets.co/api/gateway/execute-ramp-bridge)[POST`/ramps/{id}/prepare`Prepare a ramp's on-chain transfer](https://docs.truemarkets.co/api/gateway/prepare-ramp-transfer)[POST`/ramps/{id}/execute`Execute a ramp's on-chain transfer](https://docs.truemarkets.co/api/gateway/execute-ramp-transfer)

Custody

[GET`/custody/allocations`List allocations](https://docs.truemarkets.co/api/gateway/list-allocations)[POST`/custody/allocations`Allocate funds to CeFi](https://docs.truemarkets.co/api/gateway/create-allocation)[GET`/custody/allocations/{id}`Get allocation](https://docs.truemarkets.co/api/gateway/get-allocation)[GET`/custody/releases`List releases](https://docs.truemarkets.co/api/gateway/list-releases)[POST`/custody/releases`Release funds from CeFi](https://docs.truemarkets.co/api/gateway/create-release)[GET`/custody/releases/{id}`Get release](https://docs.truemarkets.co/api/gateway/get-release)

Paper Trading

[POST`/paper/deposits`Add test funds (paper trading only)](https://docs.truemarkets.co/api/gateway/create-paper-deposit)[POST`/paper/withdrawals`Remove test funds (paper trading only)](https://docs.truemarkets.co/api/gateway/create-paper-withdrawal)

Transactions

[GET`/transactions`List user transactions](https://docs.truemarkets.co/api/gateway/list-transactions)[GET`/organizations/{organization_id}/transactions`List organization transactions](https://docs.truemarkets.co/api/gateway/list-organization-transactions)

Assets

[GET`/assets/availability`Get asset availability for the caller's country](https://docs.truemarkets.co/api/gateway/get-asset-availability)[GET`/assets`List tradeable assets](https://docs.truemarkets.co/api/gateway/list-assets)[GET`/assets/{chain}/{address}`Get one asset by chain and address](https://docs.truemarkets.co/api/gateway/get-asset)

Balances

[GET`/balances/unified`List balances](https://docs.truemarkets.co/api/gateway/list-balances)[GET`/balances`Get user balances](https://docs.truemarkets.co/api/gateway/get-balances)[GET`/portfolio`Get the authenticated user's portfolio](https://docs.truemarkets.co/api/gateway/get-portfolio)

Positions

[GET`/positions`List open positions](https://docs.truemarkets.co/api/gateway/list-positions)

## CeFi direct REST

Order entry, balances and market data on the CeFi venue, for firms with direct access.

[Open reference](https://docs.truemarkets.co/api/institutional/true-markets-cefi-rest)

Base URL

`https://api.truex.co`

Endpoints

Service

[GET`/v1/cefi/health`Get service health](https://docs.truemarkets.co/api/institutional/get-service-health-cefi)[GET`/v1/cefi/versions`Get supported API versions](https://docs.truemarkets.co/api/institutional/get-api-versions-cefi)

Assets

[GET`/v1/cefi/assets`Get assets](https://docs.truemarkets.co/api/institutional/get-assets-cefi)

Instruments

[GET`/v1/cefi/instruments`Get instruments](https://docs.truemarkets.co/api/institutional/get-instruments-cefi)

Market Data

[GET`/v1/cefi/market/quote`Get markets](https://docs.truemarkets.co/api/institutional/get-market-data-cefi)[GET`/v1/cefi/market/auction`Get auction state and indicative](https://docs.truemarkets.co/api/institutional/get-market-auction-cefi)[POST`/v1/cefi/markets/quote`Compute market quote](https://docs.truemarkets.co/api/institutional/post-markets-quote-cefi)

Clients

[GET`/v1/cefi/clients`Get clients](https://docs.truemarkets.co/api/institutional/get-clients-cefi)[PATCH`/v1/cefi/clients`Update settings](https://docs.truemarkets.co/api/institutional/patch-clients-cefi)[GET`/v1/cefi/clients/fees`Get client fees](https://docs.truemarkets.co/api/institutional/get-client-fees-cefi)

Orders

[GET`/v1/cefi/orders`Get orders](https://docs.truemarkets.co/api/institutional/get-orders-plural-cefi)[POST`/v1/cefi/orders`Create order](https://docs.truemarkets.co/api/institutional/add-orders-cefi)[PATCH`/v1/cefi/orders`Modify order](https://docs.truemarkets.co/api/institutional/modify-orders-cefi)[DELETE`/v1/cefi/orders/{ref_id}`Cancel order](https://docs.truemarkets.co/api/institutional/cancel-orders-cefi)[DELETE`/v1/cefi/orders/all`Cancel all orders](https://docs.truemarkets.co/api/institutional/cancel-all-orders-cefi)[GET`/v1/cefi/orders/active`Active orders](https://docs.truemarkets.co/api/institutional/get-orders-active-cefi)[GET`/v1/cefi/orders/trade`All order trades](https://docs.truemarkets.co/api/institutional/get-orders-trades-plural-cefi)[GET`/v1/cefi/orders/activity`All order activity](https://docs.truemarkets.co/api/institutional/get-orders-activity-plural-cefi)[GET`/v1/cefi/orders/status/{ref_id}`Status order](https://docs.truemarkets.co/api/institutional/get-orders-status-cefi)

Balances

[GET`/v1/cefi/balances`Get balance](https://docs.truemarkets.co/api/institutional/get-balances-cefi)[GET`/v1/cefi/balances/activity`Get balance activity](https://docs.truemarkets.co/api/institutional/get-balance-activity-cefi)

Transfers

[GET`/v1/cefi/transfers`Get transfer](https://docs.truemarkets.co/api/institutional/get-transfers-plural-cefi)[POST`/v1/cefi/transfers`Initiate transfer](https://docs.truemarkets.co/api/institutional/add-transfers-plural-cefi)[GET`/v1/cefi/transfers/active`Get Active transfers](https://docs.truemarkets.co/api/institutional/get-active-transfers-plural-cefi)

WebSocket

[CeFi direct WebSocket](https://docs.truemarkets.co/api/websocket/institutional) Order book, trades, auction and drop-copy streams from the CeFi venue.

`/v1/cefi/market`[send subscribe](https://docs.truemarkets.co/api/websocket/institutional#subscribe)[receive welcome](https://docs.truemarkets.co/api/websocket/institutional#welcome)[receive heartbeat](https://docs.truemarkets.co/api/websocket/institutional#heartbeat)[receive confirmation](https://docs.truemarkets.co/api/websocket/institutional#confirmation)[receive instrument](https://docs.truemarkets.co/api/websocket/institutional#instrument)[receive trade](https://docs.truemarkets.co/api/websocket/institutional#trade)[receive ebbo](https://docs.truemarkets.co/api/websocket/institutional#ebbo)[receive depth](https://docs.truemarkets.co/api/websocket/institutional#depth)[receive auction](https://docs.truemarkets.co/api/websocket/institutional#auction)[receive index](https://docs.truemarkets.co/api/websocket/institutional#index)[receive dropcopy](https://docs.truemarkets.co/api/websocket/institutional#dropcopy)

## CeFi direct FIX

Order entry, drop copy and market data over FIX 5.0 SP2 sessions, for Institutional clients.

[Open reference](https://docs.truemarkets.co/api/fix/overview)

Pages

[FIX`Overview`Session model, versions and the TrueX\_FIX50SP2.xml spec](https://docs.truemarkets.co/api/fix/overview)[FIX`Administrative`Logon, heartbeat, test request, logout](https://docs.truemarkets.co/api/fix/admin)[FIX`Common components`Header, trailer and shared groups](https://docs.truemarkets.co/api/fix/common)[FIX`Order entry`New order, cancel, replace, execution reports](https://docs.truemarkets.co/api/fix/order-entry)[FIX`Drop copy`Execution report copies for a session](https://docs.truemarkets.co/api/fix/drop-copy)[FIX`Market data`Snapshots and incremental refresh](https://docs.truemarkets.co/api/fix/market-data)[FIX`Change log`What changed in the FIX spec](https://docs.truemarkets.co/api/fix/changes)

## Market data REST

Prices, candles and history across venues, without a token.

[Open reference](https://docs.truemarkets.co/api/market-data/market-data-service-api)

Base URL

`https://api.truemarkets.co`

Endpoints

Prices

[GET`/v1/defi/market/prices`Get price candles by symbol](https://docs.truemarkets.co/api/market-data/get-prices)[GET`/v1/defi/market/prices/history`Get price history for a symbol](https://docs.truemarkets.co/api/market-data/get-price-history)[GET`/v1/defi/market/prices/history/point`Get price at a point in time](https://docs.truemarkets.co/api/market-data/get-price-at-time)[GET`/v1/defi/market/prices/history/batch`Get price history for multiple symbols](https://docs.truemarkets.co/api/market-data/get-price-history-batch)[GET`/v1/defi/market/prices/indicators`Get a technical indicator series](https://docs.truemarkets.co/api/market-data/get-price-indicators)[GET`/v1/defi/market/prices/range`Get min/max price over a window](https://docs.truemarkets.co/api/market-data/get-price-range)[GET`/v1/defi/market/prices/candles`Get OHLC candles for a symbol](https://docs.truemarkets.co/api/market-data/get-candles)[GET`/v1/assets/prices/history`Get price history for an asset](https://docs.truemarkets.co/api/market-data/get-asset-price-history)[GET`/v1/assets/prices/range`Get the min and max price for an asset](https://docs.truemarkets.co/api/market-data/get-asset-price-range)[GET`/v1/assets/prices/indicators`Get technical indicator lines for an asset](https://docs.truemarkets.co/api/market-data/get-asset-price-indicators)

Market Cap

[GET`/v1/defi/market/market-data/market-cap`Get market cap by symbol](https://docs.truemarkets.co/api/market-data/get-market-cap)[GET`/v1/defi/market/market-data/market-caps`List top assets by market cap](https://docs.truemarkets.co/api/market-data/list-market-caps)[GET`/v1/defi/market/market-data/market-cap/history`Get reported market-cap history](https://docs.truemarkets.co/api/market-data/get-market-cap-history)

Market Feed

[GET`/v1/defi/market/market-data/perp/history`Get perp funding rate and open interest history](https://docs.truemarkets.co/api/market-data/get-perp-market-history)[GET`/v1/defi/market/market-data/volume/history`Get reported 24h volume history](https://docs.truemarkets.co/api/market-data/get-volume-history)[GET`/v1/defi/market/market-data/scans/history`Get a market ranking at every bucket of a window](https://docs.truemarkets.co/api/market-data/get-scan-history)[GET`/v1/defi/market/market-data/trending`List trending assets](https://docs.truemarkets.co/api/market-data/list-trending-assets)[GET`/v1/defi/market/market-data/surging`List surging assets](https://docs.truemarkets.co/api/market-data/list-surging-assets)

Streams

[GET`/v1/defi/market/stream/bbo`Stream BBO quotes](https://docs.truemarkets.co/api/market-data/stream-bbo-quotes)[HEAD`/v1/defi/market/stream/bbo`Probe the BBO stream](https://docs.truemarkets.co/api/market-data/probe-bbo-stream)

CeFi

[GET`/v1/cefi/market/prices/history`Get CeFi instrument price history](https://docs.truemarkets.co/api/market-data/get-cefi-price-history)[GET`/v1/cefi/market/prices/indicators`Get a technical indicator series for a CeFi instrument](https://docs.truemarkets.co/api/market-data/get-cefi-price-indicators)[GET`/v1/cefi/market/prices/range`Get CeFi min/max price over a window](https://docs.truemarkets.co/api/market-data/get-cefi-price-range)

WebSocket

[Market data WebSocket](https://docs.truemarkets.co/api/websocket/market-data) Batched candles, trending and surging assets, and reference prices as they update.

`/v1/defi/market`[send subscribe](https://docs.truemarkets.co/api/websocket/market-data#subscribe)[receive subscriptionResponse](https://docs.truemarkets.co/api/websocket/market-data#subscriptionresponse)[receive priceCandles](https://docs.truemarkets.co/api/websocket/market-data#pricecandles)[receive trendingAssets](https://docs.truemarkets.co/api/websocket/market-data#trendingassets)[receive surgingAssets](https://docs.truemarkets.co/api/websocket/market-data#surgingassets)[receive referencePrices](https://docs.truemarkets.co/api/websocket/market-data#referenceprices)[receive orderbook](https://docs.truemarkets.co/api/websocket/market-data#orderbook)[receive price](https://docs.truemarkets.co/api/websocket/market-data#price)[receive candles](https://docs.truemarkets.co/api/websocket/market-data#candles)[receive reference](https://docs.truemarkets.co/api/websocket/market-data#reference)[receive error](https://docs.truemarkets.co/api/websocket/market-data#error)