Exchanges
Manage connected exchange accounts.
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
| GET | /v1/exchanges | List exchange accounts |
| GET | /v1/exchanges/:id | Get exchange account |
| POST | /v1/exchanges | Add exchange account |
| DELETE | /v1/exchanges/:id | Remove exchange account |
| POST | /v1/exchanges/test | Test exchange credentials |
| POST | /v1/exchanges/:id/sync | Sync exchange balance |
List Exchange Accounts
Section titled “List Exchange Accounts”GET /v1/exchangescurl https://api.tokenbot.com/v1/exchanges \ -H "X-API-Key: tb_live_your_key"Response:
{ "success": true, "data": [ { "id": "exc_abc123", "exchange_name": "binance", "account_name": "Main Binance", "trading_type": "spot", "is_active": true, "balance": { "BTC": 1.5, "USDT": 10000 }, "last_sync_at": "2026-02-20T12:00:00Z", "created_at": "2026-01-15T10:30:00Z" } ]}Get Exchange Account
Section titled “Get Exchange Account”GET /v1/exchanges/:idcurl https://api.tokenbot.com/v1/exchanges/exc_abc123 \ -H "X-API-Key: tb_live_your_key"Add Exchange Account
Section titled “Add Exchange Account”POST /v1/exchangesRequest Body:
{ "exchange_name": "binance", "account_name": "My Binance", "trading_type": "spot", "api_key": "your_exchange_api_key", "api_secret": "your_exchange_api_secret", "passphrase": "optional_passphrase"}curl -X POST https://api.tokenbot.com/v1/exchanges \ -H "X-API-Key: tb_live_your_key" \ -H "Content-Type: application/json" \ -d '{"exchange_name":"binance","account_name":"My Binance","trading_type":"spot","api_key":"...","api_secret":"..."}'Remove Exchange Account
Section titled “Remove Exchange Account”DELETE /v1/exchanges/:idcurl -X DELETE https://api.tokenbot.com/v1/exchanges/exc_abc123 \ -H "X-API-Key: tb_live_your_key"Test Exchange Credentials
Section titled “Test Exchange Credentials”POST /v1/exchanges/testTest exchange API credentials before saving.
Request Body:
{ "exchange_name": "binance", "api_key": "your_exchange_api_key", "api_secret": "your_exchange_api_secret", "trading_type": "spot"}Sync Exchange Balance
Section titled “Sync Exchange Balance”POST /v1/exchanges/:id/syncForce a balance sync with the exchange.
curl -X POST https://api.tokenbot.com/v1/exchanges/exc_abc123/sync \ -H "X-API-Key: tb_live_your_key"
