POST /v1/lab/paper-runs/{id}/orders/cancel-all
Cancel every resting limit order of one of the caller’s paper runs (reason user); the run keeps running and places new orders on new signals. Answers how many were cancelled. Needs no plan. 404 `lab_paper_disabled` while LAB_PAPER_ENABLED is off.
Cancel every resting limit order of one of the caller’s paper runs (reason user); the run keeps running and places new orders on new signals. Answers how many were cancelled. Needs no plan. 404 lab_paper_disabled while LAB_PAPER_ENABLED is off.
API key: Authorization: Bearer pk_live_… (mint at polyrank.app/api-keys)
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/lab/paper-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/orders/cancel-all"{ "cancelled": 0}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}{ "error": "string", "message": "string", "feature": "string", "field": "string", "plan": "string", "retry_after_sec": 0, "retry_after_seconds": 0, "reason": "string", "running": 0, "limit": 0, "issues": [ null ], "trace_id": "string"}POST /v1/lab/backtests POST
Queue a backtest of one of the caller’s strategies (strategy_id) or of an unsaved spec, over [from, to) (at most 366 days), optionally with explicit re-rank cuts. Answers 202 with the run; poll GET /lab/backtests/:id. The spec and a Builder source’s config are frozen into the run. Results are SIMULATED: every report names its fill model and the measured optimism. A strategy that copies no wallet (own rules, Lab Pro and up) is tested on the recorded order books: 400 `rules_before_book_history` for a window before 2026-07-23; its report covers the first three quarters of the window unless final_test asks for the sealed last quarter (400 `final_test_rules_only` for a copy strategy; 400 `final_test_needs_strategy` for an unsaved spec; 409 `final_test_already_run` once the strategy’s final test was run — once per strategy, a failed run aside). 403 `plan_required` (strategy_lab; own rules); 429 `lab_daily_limit` at the plan’s backtests per UTC day (Retry-After = seconds to midnight UTC); 429 `lab_busy` at the plan’s runs queued or running at once (Pro and Lab Pro 3, Quant 4, Quant Max 6). 404 `lab_disabled` while LAB_ENABLED is off.
POST /v1/lab/paper-runs/{id}/orders/{orderId}/cancel POST
Cancel one resting limit order of one of the caller’s paper runs (reason user): it takes no fill from now on; what it filled stays, and its signal’s row is written from it by the engine within seconds. 409 `order_not_open` when it already ended. Needs no plan. 404 `lab_paper_disabled` while LAB_PAPER_ENABLED is off.