---
title: "Alpha Delete"
method: DELETE
path: "/v1/me/accounts/{account_id}/alphas/{deploy_id}"
---

# Alpha Delete

`DELETE /v1/me/accounts/{account_id}/alphas/{deploy_id}`

## 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}/alphas/{deploy_id}`
- Auth: none declared

Delete a deployed bot that NEVER traded. A bot that traded is RETIRED.

SESSION-OWNER ONLY, mirroring /approve: destroying a bot is a human act, so
an account key PAIR (the agent credential) can never do it — a pair-only
caller gets 401 from require_session_user. `?confirm=true` is REQUIRED (400
otherwise). 404 "Deployment not found" for a desk that isn't the caller's or
a bot that isn't on it — byte-identical to a bot that never existed.

THE HONEST-MONEY RULE. Hard delete is allowed ONLY when the deployment has
ZERO position history AND ZERO order history (db.deployment_history_counts:
positions open or closed, and the orders tied to them). If either ever
existed the answer is 409 and the bot can only be RETIRED — the money ledger
has to stay auditable, and retiring keeps every trade on the record.

OPEN POSITIONS CANNOT BE ORPHANED, by construction: an open position IS
position history, so such a bot is refused here and retired instead. What
RETIRE actually does to an open position (verified in paper_sim, 2026-07-29;
settlement clause added 2026-08-19 — do not soften either half): the
strategy's own exit rule NEVER runs again on that position. No stop-loss, no
take-profit, no ratchet, no rule/hold exit, no time-stop or flatten, no desk
stop. The position stays `status='open'` and honest — it is still re-marked
(both by the walk and by every positions read, since
paper_manual.positions_view marks every open row on the desk regardless of
which bot opened it) and any protective order already resting on it still
fills from the desk matcher — but nothing will close it on the strategy's
terms. Closing it is the member's move (the manual close on the desk).

THE ONE EXIT THAT STILL RUNS IS THE MARKET'S OWN: contract-mandated
SETTLEMENT — an option at expiry, a credit/covered structure at its expiry,
an equity that delists. That is not the strategy trading; the contract ended
on its own. Without it a retired bot's expired contract could be closed by
NOBODY: the walk skipped it and a dead contract has no live quote, so the
manual close refuses it too (NoLiveQuote). Measured on the live desk —
position 4416, an AMZN call that expired 2026-08-17 on a bot retired
2026-08-03. So a retired bot now walks exactly the SHELF path: mark, never
trade, settle what the market has already ended.

A retired bot's open position is MARKED and STILL TRADEABLE BY HAND; it is
not auto-managed by the strategy.

A zero-history delete cascades `vega_deployment_transitions` then the
deployment row (one transaction). Returns
``{"deleted": deploy_id, "cascade": {...}}``.

## Path parameters

- `account_id` integer, required
- `deploy_id` string, required

## Query parameters

- `confirm` boolean

## Response `200`

Successful Response

- unknown

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