---
title: "Preview Deploy"
method: POST
path: "/v1/me/accounts/{account_id}/deploy/preview"
---

# Preview Deploy

`POST /v1/me/accounts/{account_id}/deploy/preview`

## 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/me/accounts/{account_id}/deploy/preview`
- Auth: none declared

PREVIEW, THEN COMMIT (2026-10-14): what POST .../deploy with this SAME
body would do — computed on the deploy's own code path — with NOTHING
written except one agent-audit row (action ``deploy_preview``).

Same auth as the deploy: the session owner, or the desk's OWN account
key pair (a pair for another desk is 403, an unknown pair 401, a
stranger's session the same 403 "not your account" a missing desk gets).
A pair needs only the 'read' capability — a preview changes nothing —
and rides the same per-key rate limit every pair read does.

Runs the deploy's spec resolution + normalization (side aliases, the
universe default, the name) and its checks (validate_spec(for_live=True),
the plan's clock, the walker's vehicles, survivorship) — the SAME helper
functions, not a copy — so ``errors`` are the deploy's own words and
``normalized_spec`` is exactly what a deploy would store. Returns the
resolved caps (named member-set / platform default / unset), the
disclosures + defaults the deploy response would carry, a per-trade cost
estimate where it is knowable, the desk's available buying power, a
plain-words risk summary, and ``preview_id`` to pass to the deploy.
ADVISORY ONLY: nothing here can refuse a later deploy.

## Path parameters

- `account_id` integer, required

## Request body

- DeployRequest: POST /v1/accounts/{id}/deploy — deploy a validated bulb onto a paper account. Provide exactly ONE source for the spec: - ``strategy_spec``: an inline strategy spec dict (validated server-side), or - ``strategy_id``: id of a strategy previously saved by the SAME principal. ``name`` is an optional human label for the deployment (e.g. "oversold-bounce"). Deploys are FORWARD-ONLY (founder rule, 2026-07-17): the desk starts trading at the moment of deployment and only ever shows trades that happened while it was deployed. Historical performance lives in the strategy's BACKTEST report (stored per deployment, shown separately) — it is never replayed onto the desk as if the desk had traded it. The old ``backfill_days`` field (default 60!) silently pre-filled two months of simulated trades on every deploy and was removed for exactly that reason; unknown fields sent by old clients are ignored by pydantic.
  - `strategy_spec` object, nullable
  - `strategy_id` integer, nullable
  - `name` string, nullable
  - `description` string, nullable
  - `acknowledge_weak` boolean
  - `requires_approval` boolean
  - `preview_id` string, nullable

## Response `200`

Successful Response

- DeployPreview: Response to POST /v1/me/accounts/{id}/deploy/preview — what a deploy of the SAME body would do, computed on the deploy's own code path, with NOTHING written (beyond one agent-audit row). ``valid``/``errors`` mirror exactly what the deploy would refuse with (same plain words). ``blocked_by`` lists the desk/account gates (maintenance, email verification, agent freeze, the key's capability, the desk's deploy cap, the plan's bot cap) that would refuse the deploy right now — each with the status and words the deploy would answer. ``would_deploy`` is true only when the spec is valid AND nothing blocks. ``preview_id`` is sha256(account_id + canonical JSON of ``normalized_spec``)[:16]; pass it to the deploy to get ``preview_match`` back. Money: ``estimated_trade_cost`` (a number only where the sizing makes one knowable before a fill, else "depends on the fill") and ``desk`` (equity + available buying power).
  - `preview_id` string, nullable
  - `account_id` integer, required
  - `read_only` boolean
  - `valid` boolean, required
  - `errors` string[]
  - `would_deploy` boolean
  - `blocked_by` object[]
  - `normalized_spec` object, nullable
  - `name` string, nullable
  - `mode` string
  - `status` string
  - `caps` object, nullable
  - `disclosures` string[]
  - `defaults_applied` string[]
  - `estimated_trade_cost` object, nullable
  - `desk` object, nullable
  - `risk_summary` string[]
  - `next_step` string, nullable

## 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)
