Skip to main content

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

NameTypeMandatoryDescription
namestringYESHuman-readable label, 1–64 chars. Must be unique per account.
template_idstringYESTemplate slug, e.g. tpl_grid, tpl_dca, tpl_momentum, tpl_meanrev.
paramsobjectYESTemplate-specific parameters. Opaque to the platform — passed through to the template runtime. Validated against the template's schema.
symbolsarray<string>YESOne or more exchange-style uppercase tickers (e.g. BTCUSDT). Must match exchange-info. 1–10 entries.
timeframeenum<1m|5m|15m|1h|4h|1d>YESCandle interval the template operates on.
capitaldecimalYESQuote-currency notional allocated to the strategy. Decimal string. Must meet the template's minimum (typically 100.00).
leverageintegerNOLeverage 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

FieldTypeDescription
idstringStrategy identifier, format strat_<6-8 hex>.
namestringThe supplied label.
template_idstringTemplate slug.
paramsobjectTemplate params as supplied.
symbolsarraySymbols the strategy will trade.
timeframestringCandle interval.
capitalstringQuote-currency notional, decimal string.
leverageintegerLeverage multiplier in effect.
statusenumOne of draft, deployed, paused, stopped, error. New strategies are draft.
deployed_atstring|nullISO 8601 UTC timestamp of the most recent deploy, or null.
created_atstringISO 8601 UTC creation time.
updated_atstringISO 8601 UTC last modification time.
statsobjectCumulative runtime stats. Zeroed for draft strategies.

Errors

  • 400 INVALID_PARAMETER — missing required field, params failed template validation, capital below minimum, or leverage out of range.
  • 404 NOT_FOUNDtemplate_id does not exist.
  • 409 DUPLICATE_NAME — another strategy on the account already uses this name.

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