# Close all orders

`POST /orders/{accountId}/close-all`

Cancels every active increase order on the account. Positions themselves stay open —
use `POST /accounts/{accountId}/close-all` to flatten the account instead.

Responds `204` with no body.

## Authorization

bearer: http · bearer (required). Personal API key, prefixed with `usk_`.

## Parameters

- path: accountId (string · uuid; required). Trader account identifier. Must belong to the caller.

Type: string · uuid

format: uuid

## Example · cURL

```bash
curl --request POST 'https://api.upscale.trade/orders/{accountId}/close-all' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Example · JavaScript

```javascript
const response = await fetch("https://api.upscale.trade/orders/{accountId}/close-all", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
});
console.log(response.status, await response.text());
```

## Example · Python

```python
import requests

response = requests.request(
    "POST",
    "https://api.upscale.trade/orders/{accountId}/close-all",
    headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
    timeout=30,
)
print(response.status_code, response.text)
```

## Response 401

**401**  — Unauthorized

## Response 403

**403**  — The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`).

## Response 404

**404**  — No account with this identifier.

## Response 429

**429**  — Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.