---
title: "Cancel a specific set of orders atomically at the selection layer"
method: POST
path: "/orders/cancel-batch"
tags: ["Orders"]
---

# Cancel a specific set of orders atomically at the selection layer

`POST /orders/cancel-batch`

## Request

- Base URL: `https://execution.kairos.trade`
- URL: `https://execution.kairos.trade/orders/cancel-batch`
- Auth: API key in header `X-Client-Id` and API key in header `X-Api-Key` and API key in header `X-Api-Secret`

Validates the ENTIRE selection before sending any venue request — if any requested order is missing, not owned by the caller, already terminal, on a mismatched exchange, or has no exchange order id yet (pre-submission), the whole request is rejected with no venue call made and no partial cancels. Once validation passes, the venue's native batch-cancel endpoint determines the per-order result; a venue-refused cancel is reported in `failures` without marking the local row cancelled.
All selected orders must belong to the SAME `exchange_id` — a mixed-venue batch is rejected with `400`.
**Auth & scope.** Requires `trade:execute`.

## Request body

- OrderCancelBatchRequest: Body for `POST /orders/cancel-batch`.
  - `order_ids` string[], required: Internal order ids to cancel. Deduplicated server-side; must be non-empty and at most 100 entries.

## Response `200`

Per-order batch-cancel outcome.

- OrderCancelBatchResponse: Response for `POST /orders/cancel-batch`.
  - `success` boolean, required: True iff `failed_count == 0`.
  - `cancelled_count` integer, required
  - `noop_count` integer, required: Orders the venue reported as a no-op (e.g. already filled/cancelled at the venue) — still counted as handled, not a failure.
  - `failed_count` integer, required
  - `cancelled_order_ids` string[], required
  - `noop_order_ids` string[], required
  - `failures` OrderCancelBatchFailure[], required
    - `order_id` string, uuid, required
    - `exchange_order_id` string, required: The venue-side order id that was rejected.
    - `reason` string, required: Venue-reported reason the cancel was refused.

## Other responses

- `400`: Empty `order_ids` (after de-duplication), more than 100 ids, the selected orders span more than one `exchange_id`, no executor is registered for that exchange, or the venue rejected the batch-cancel as an unsupported request. Empty body (status code only).
- `401`: No valid credential presented — missing/invalid API-key headers or an invalid/expired session token.
- `403`: One of the selected orders belongs to another user, missing `trade:execute` scope, or API-key access to the provider is disabled. Empty body (status code only).
- `404`: One of the requested order ids does not exist. Empty body (status code only).
- `409`: One of the requested orders is already terminal, or has no exchange order id yet (pre-submission). Empty body (status code only).
- `500`: Database read/write failed, or the venue's batch-cancel call failed unexpectedly. Empty body (status code only).

---

[API](https://skmtc.dev/kairos/apis/kairos-order-execution-api.md) - [All operations](https://skmtc.dev/kairos/apis/kairos-order-execution-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kairos/apis/kairos-order-execution-api/revisions/9ba7d463d505?raw)
