Skip to content

Strategies

Manage trading strategies.

MethodPathDescription
GET/v1/strategiesList strategies
GET/v1/strategies/:idGet strategy
POST/v1/strategiesCreate strategy
PATCH/v1/strategies/:idUpdate strategy
DELETE/v1/strategies/:idDelete strategy
POST/v1/strategies/:id/copiersLink copiers to strategy

GET /v1/strategies
Terminal window
curl https://api.tokenbot.com/v1/strategies \
-H "X-API-Key: tb_live_your_key"

GET /v1/strategies/:id
Terminal window
curl https://api.tokenbot.com/v1/strategies/str_abc123 \
-H "X-API-Key: tb_live_your_key"

POST /v1/strategies

Request Body:

{
"exchange_account_id": "exc_abc123",
"name": "BTC Momentum",
"description": "Momentum-based BTC/USDT strategy",
"is_public": false,
"risk_level": 3,
"max_drawdown": 10.0,
"max_allocation": 50.0,
"trading_pairs": ["BTC/USDT"]
}
Terminal window
curl -X POST https://api.tokenbot.com/v1/strategies \
-H "X-API-Key: tb_live_your_key" \
-H "Content-Type: application/json" \
-d '{"exchange_account_id":"exc_abc123","name":"BTC Momentum","risk_level":3}'

PATCH /v1/strategies/:id
Terminal window
curl -X PATCH https://api.tokenbot.com/v1/strategies/str_abc123 \
-H "X-API-Key: tb_live_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"Updated Name","risk_level":2}'

DELETE /v1/strategies/:id
Terminal window
curl -X DELETE https://api.tokenbot.com/v1/strategies/str_abc123 \
-H "X-API-Key: tb_live_your_key"

POST /v1/strategies/:id/copiers

Request Body:

{
"copier_ids": ["cop_abc123", "cop_def456"]
}
Terminal window
curl -X POST https://api.tokenbot.com/v1/strategies/str_abc123/copiers \
-H "X-API-Key: tb_live_your_key" \
-H "Content-Type: application/json" \
-d '{"copier_ids":["cop_abc123"]}'