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.
| Name | Type | Mandatory | Description |
|---|---|---|---|
name | string | NO | New label, 1–64 chars. Must remain unique per account. |
template_id | string | NO | Switch to a different template. Resets params validation. |
params | object | NO | Replaces the current params object in full (not merged). Validated against the active template schema. |
symbols | array<string> | NO | Replaces the symbols list. 1–10 entries. |
timeframe | enum<1m|5m|15m|1h|4h|1d> | NO | New candle interval. |
capital | decimal | NO | New capital allocation. Decimal string. |
leverage | integer | NO | New 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.paramsdoes not match template schema,leverageout of range).404 NOT_FOUND— strategy does not exist or is not owned by the caller.409 INVALID_STATE— strategy status is notdraftorpaused. Pause it first.409 DUPLICATE_NAME— another strategy on the account already uses the newname.
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"
}'