Skip to main content

Update Strategy

Update parameters of an existing strategy. Only strategies in draft or paused status can be updated; deploy a paused strategy again to apply changes.

Endpoint

PATCH /v1/strategies/{id}

Weight: 5 Authentication: Required (signed) — see Authentication.

Request

Path parameter: id — the strategy identifier (e.g. strat_8f2a1b).

All body fields are optional. Only the fields you supply will be modified; everything else is left untouched.

NameTypeMandatoryDescription
namestringNONew label, 1–64 chars. Must remain unique per account.
template_idstringNOSwitch to a different template. Resets params validation.
paramsobjectNOReplaces the current params object in full (not merged). Validated against the active template schema.
symbolsarray<string>NOReplaces the symbols list. 1–10 entries.
timeframeenum<1m|5m|15m|1h|4h|1d>NONew candle interval.
capitaldecimalNONew capital allocation. Decimal string.
leverageintegerNONew leverage. Range 1–20.

Response

Returns the updated strategy object.

{
"id": "strat_8f2a1b",
"name": "BTC grid 1h v2",
"template_id": "tpl_grid",
"params": {
"grid_levels": 12,
"upper_price": "74000",
"lower_price": "58000",
"rebalance_threshold": "0.015"
},
"symbols": ["BTCUSDT"],
"timeframe": "1h",
"capital": "12000.00",
"leverage": 3,
"status": "draft",
"deployed_at": null,
"created_at": "2026-04-28T15:30: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

Same shape as Create Strategy. Only updated_at and the fields you modified will change.

Errors

  • 400 INVALID_PARAMETER — body failed validation (e.g. params does not match template schema, leverage out of range).
  • 404 NOT_FOUND — strategy does not exist or is not owned by the caller.
  • 409 INVALID_STATE — strategy status is not draft or paused. Pause it first.
  • 409 DUPLICATE_NAME — another strategy on the account already uses the new name.

See Errors for the full list.

Example

curl -X PATCH "https://api.pipai.example/v1/strategies/strat_8f2a1b" \
-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 v2",
"params": {
"grid_levels": 12,
"upper_price": "74000",
"lower_price": "58000",
"rebalance_threshold": "0.015"
},
"capital": "12000.00"
}'