---
title: "Close all account positions"
method: POST
path: "/rest/api/v1/accounts/{accountId}/actions/closeAllPositions"
tags: ["Trading API"]
---

# Close all account positions

`POST /rest/api/v1/accounts/{accountId}/actions/closeAllPositions`

## Request

- Base URL: `https://api.metacopier.io`
- URL: `https://api.metacopier.io/rest/api/v1/accounts/{accountId}/actions/closeAllPositions`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/metacopier/apis/metacopier-api/docs/rest/api/v1/accounts/:accountId/actions/closeAllPositions/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `accountId` string, uuid, required

## Response `204`

No Content

## Changes

- **2025-02-07** `f3a76dd2ff82`: 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `204`

[Operation history](https://skmtc.dev/metacopier/apis/metacopier-api/changes/rest/api/v1/accounts/:accountId/actions/closeAllPositions/post.md)

---

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