---
title: "Cancel All Active Orders"
method: POST
path: "/v1/order/cancel/all"
tags: ["Orders"]
---

# Cancel All Active Orders

`POST /v1/order/cancel/all`

## Request

- Base URL: `https://api.gemini.com`
- URL: `https://api.gemini.com/v1/order/cancel/all`
- Auth: API key in header `X-GEMINI-APIKEY` and API key in header `X-GEMINI-SIGNATURE` and API key in header `X-GEMINI-PAYLOAD`

This will cancel all outstanding orders created by all [sessions](/authentication/api-key#sessions) owned by this account, including interactive orders placed through the UI.

<div class="p-4 text-sm section-icon section-info rounded-sm" role="alert">
  <div class="flex">
     <svg
        view-box="0 0 24 24"
      >
        <path
          fill-rule="evenodd"
          clip-rule="evenodd"
          d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM11 17V11H13V17H11ZM11 9V7H13V9H11Z"
        />
      </svg>
      Note that this cancels orders that were not placed using this API key.
      Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards.
  </div>
</div>

Typically [Cancel All Session Orders](/rest/orders#cancel-all-session-orders) is preferable, so that only orders related to the current connected session are cancelled.

### Roles
The API key you use to access this endpoint must have the Trader role assigned. See [Roles](/roles#roles) for more information.

The OAuth scope must have `orders:create` assigned to access this endpoint. See [OAuth Scopes](/authentication/oauth#oauth-scopes) for more information.

## Headers

- `X-GEMINI-APIKEY` string, required
- `X-GEMINI-SIGNATURE` string, required
- `X-GEMINI-PAYLOAD` string, required
- `Content-Type` string
- `Content-Length` string
- `Cache-Control` string

## Request body

- CancelAllOrdersRequest
  - `request` string, required: The literal string "/v1/order/cancel/all"
  - `nonce` union, required: timestamp
    - string: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------|-----------------------|------------------------| | string (seconds) | `1495127793` | `POST` only | | string (milliseconds) | `1495127793000` | `POST` only |
    - integer: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------------|---------------------------|------------------------| | whole number (seconds) | `1495127793` | `GET`, `POST` | | whole number (milliseconds) | `1495127793000` | `GET`, `POST` |
  - `account` string: Required for Master API keys as described in [Private API Invocation](/authentication/api-key#private-api-invocation). The name of the account within the subaccount group. Specifies the account on which you intend to cancel the orders. Only available for exchange accounts.

## Response `200`

JSON response

- CancelAllResult
  - `result` string
  - `details` object: cancelledOrders/cancelRejects with IDs of both
    - `cancelledOrders` integer[]
    - `cancelRejects` integer[]

## Other responses

- `400`: Bad request - malformed request or invalid parameters
- `401`: Unauthorized - missing or invalid authentication
- `403`: ApiKey fails IP Filtering Check
- `404`: Resource not found
- `429`: Too many requests - you have exceeded the rate limit
- `500`: Internal server error

---

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