> For the complete documentation index, see [llms.txt](https://docs.tokenbot.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tokenbot.com/home/api-docs/rest-api/strategies.md).

# Strategies

Manage trading strategies.

## Endpoints

| Method | Path                         | Description              |
| ------ | ---------------------------- | ------------------------ |
| GET    | `/v1/strategies`             | List strategies          |
| GET    | `/v1/strategies/:id`         | Get strategy             |
| POST   | `/v1/strategies`             | Create strategy          |
| PATCH  | `/v1/strategies/:id`         | Update strategy          |
| DELETE | `/v1/strategies/:id`         | Delete strategy          |
| POST   | `/v1/strategies/:id/copiers` | Link copiers to strategy |

***

### List Strategies

```
GET /v1/strategies
```

```bash
curl https://api.tokenbot.com/v1/strategies \
  -H "X-API-Key: tb_live_your_key"
```

***

### Get Strategy

```
GET /v1/strategies/:id
```

```bash
curl https://api.tokenbot.com/v1/strategies/str_abc123 \
  -H "X-API-Key: tb_live_your_key"
```

***

### Create Strategy

```
POST /v1/strategies
```

**Request Body:**

```json
{
  "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"]
}
```

```bash
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}'
```

***

### Update Strategy

```
PATCH /v1/strategies/:id
```

```bash
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 Strategy

```
DELETE /v1/strategies/:id
```

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

***

### Link Copiers to Strategy

```
POST /v1/strategies/:id/copiers
```

**Request Body:**

```json
{
  "copier_ids": ["cop_abc123", "cop_def456"]
}
```

```bash
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"]}'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tokenbot.com/home/api-docs/rest-api/strategies.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
