---
title: "Submit Portfolio Backtest"
method: POST
path: "/v1/portfolio/backtests"
---

# Submit Portfolio Backtest

`POST /v1/portfolio/backtests`

## Request

- Base URL: `https://api.quantradin.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.quantradin.com/v1/portfolio/backtests`
- Auth: none declared

Phase D (D1): enqueue a PORTFOLIO backtest over 2..8 of the caller's OWN
saved strategies, combining them into one honest book view (combined
equity/drawdown, correlation matrix, overlap, contributions, concentration).

Body: {strategy_ids: [int, ...]} — bounds 2..8 and distinctness are enforced
by the request model (422 otherwise). Ownership is enforced HERE per id:
  * no such strategy id            → 404
  * strategy owned by another user → 403 (never leaks its contents)
Auth: session cookie wins, else X-Vega-Key (require_backtest_submitter),
matching the single-backtest surface. Reuses the job/poll machinery: a row
is created (kind='portfolio'), a background task runs + combines, and the
run is polled via the SAME GET /v1/backtests/{run_id}.

## Headers

- `x-vega-key` string, nullable

## Request body

- PortfolioBacktestRequest: POST /v1/portfolio/backtests — combine 2..8 of the caller's saved strategies. strategy_ids must be a list of DISTINCT integers, length in [2, 8]. Bounds and integer-ness are enforced here (422 on violation) before any DB/ownership work; ownership (own-strategies-only, 403/404) is enforced in the route.
  - `strategy_ids` integer[], required

## Response `200`

Successful Response

- PortfolioBacktestQueued
  - `run_id` string, required
  - `status` string
  - `kind` string

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/quantradin/apis/vega-api.md) · [All operations](https://skmtc.dev/quantradin/apis/vega-api/llms.txt) · [OpenAPI document](https://skmtc.dev/quantradin/apis/vega-api/revisions/47add154ef38?raw)
