---
title: "Close all open orders"
method: POST
path: "/v2/orders/close_all/"
tags: ["Orders"]
---

# Close all open orders

`POST /v2/orders/close_all/`

## Request

- Base URL: `https://magicmarkets.com` (the document declares no server; this is the origin it was published from)
- URL: `https://magicmarkets.com/v2/orders/close_all/`
- Auth: API key in header `X-Api-Key`

Request cancellation of all open orders. Optionally filter by sport and/or event.

## Request body

- object
  - `sport` string: Only close orders on this sport - see "Sports & bet types" in the introduction.
  - `event_id` string: Only close orders on this event (requires sport)

## Response `202`

Cancellation accepted. `data` is a list of the order-id lists being cancelled; an empty result is `[[]]`.

## Other responses

- `401`: Authentication failed - API key missing, malformed, or rejected.
- `403`: Authorization failed - the key is valid but cannot perform this action.
- `429`: Rate limit hit. Honour the `Retry-After` header.
- `500`: Unexpected internal error. Quote `data[1]` (the token) when contacting support.

---

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