Create Strategy
Create a new strategy from a template. The strategy is created in draft status and does not begin trading until Deploy is called.
Endpoint
POST /v1/strategies
Weight: 5 Authentication: Required (signed) — see Authentication.
Request
| Name | Type | Mandatory | Description |
|---|---|---|---|
name | string | YES | Human-readable label, 1–64 chars. Must be unique per account. |
template_id | string | YES | Template slug, e.g. tpl_grid, tpl_dca, tpl_momentum, tpl_meanrev. |
params | object | YES | Template-specific parameters. Opaque to the platform — passed through to the template runtime. Validated against the template's schema. |
symbols | array<string> | YES | One or more exchange-style uppercase tickers (e.g. BTCUSDT). Must match exchange-info. 1–10 entries. |
timeframe | enum<1m|5m|15m|1h|4h|1d> | YES | Candle interval the template operates on. |
capital | decimal | YES | Quote-currency notional allocated to the strategy. Decimal string. Must meet the template's minimum (typically 100.00). |
leverage | integer | NO | Leverage multiplier. Default 1. Range 1–20. |
Response
{
"id": "strat_8f2a1b",
"name": "BTC grid 1h",
"template_id": "tpl_grid",
"params": {
"grid_levels": 8,
"upper_price": "72000",
"lower_price": "60000",
"rebalance_threshold": "0.02"
},
"symbols": ["BTCUSDT"],
"timeframe": "1h",
"capital": "10000.00",
"leverage": 3,
"status": "draft",
"deployed_at": null,
"created_at": "2026-04-29T12:00:00Z",
"updated_at": "2026-04-29T12:00:00Z",
"stats": {
"open_positions": 0,
"total_pnl": "0.00",
"total_trades": 0,
"win_rate": "0.000"
}
}
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Strategy identifier, format strat_<6-8 hex>. |
name | string | The supplied label. |
template_id | string | Template slug. |
params | object | Template params as supplied. |
symbols | array | Symbols the strategy will trade. |
timeframe | string | Candle interval. |
capital | string | Quote-currency notional, decimal string. |
leverage | integer | Leverage multiplier in effect. |
status | enum | One of draft, deployed, paused, stopped, error. New strategies are draft. |
deployed_at | string|null | ISO 8601 UTC timestamp of the most recent deploy, or null. |
created_at | string | ISO 8601 UTC creation time. |
updated_at | string | ISO 8601 UTC last modification time. |
stats | object | Cumulative runtime stats. Zeroed for draft strategies. |
Errors
400 INVALID_PARAMETER— missing required field,paramsfailed template validation,capitalbelow minimum, orleverageout of range.404 NOT_FOUND—template_iddoes not exist.409 DUPLICATE_NAME— another strategy on the account already uses thisname.
See Errors for the full list.
Example
curl -X POST "https://api.pipai.example/v1/strategies" \
-H "X-PipAI-API-Key: $API_KEY" \
-H "X-PipAI-Timestamp: $TS" \
-H "X-PipAI-Signature: $SIG" \
-H "Content-Type: application/json" \
-d '{
"name": "BTC grid 1h",
"template_id": "tpl_grid",
"params": {
"grid_levels": 8,
"upper_price": "72000",
"lower_price": "60000",
"rebalance_threshold": "0.02"
},
"symbols": ["BTCUSDT"],
"timeframe": "1h",
"capital": "10000.00",
"leverage": 3
}'