---
title: "Flatten every open position at the market. The strategies that opened them keep running unless paused (scope: trading:write)"
method: POST
path: "/v1/trading/positions/close-all"
---

# Flatten every open position at the market. The strategies that opened them keep running unless paused (scope: trading:write)

`POST /v1/trading/positions/close-all`

## Request

- Base URL: `https://app.texttoquant.com/api`
- URL: `https://app.texttoquant.com/api/v1/trading/positions/close-all`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Risk-reducing only. Nothing on the trading surface can open a position, place a resting order, or move funds. Rate-limited to 30 live-account actions per minute per user.

## Request body

- object
  - `connectionId` string, uuid: Limit to one account. Omit = every connected account.

## Response `200`

Success

- object
  - `success` true, required
  - `data` object[], required

## Other responses

- `403`: insufficient_scope — the key lacks trading:read/trading:write; or upgrade_required — the plan has no live trading
- `404`: not_found
- `429`: rate_limited
- `503`: plan_unavailable — the plan could not be resolved; retry

---

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