---
title: "Cancel commands"
method: POST
path: "/commands/cancel"
tags: ["commands"]
---

# Cancel commands

`POST /commands/cancel`

Cancels commands that are currently in progress. Can cancel either the most recent command or commands matching a query.

## Query parameters

- `query` string
- `force` boolean

## Headers

- `Client-ID` string, required

## Response `202`

Accepted: Commands are being canceled.

- ModelCancelCommandResponse
  - `CommandIds` string[]
  - `Forced` boolean — Forced is true when the cancellation was requested with --force. The CLI uses this to surface the force-cancel warning and the list of resources that were abandoned mid-operation.
  - `ResourceUpdateStates` object

## Other responses

- `400` — Bad Request: Invalid query or missing Client-ID.
- `404` — Not Found: No in-progress commands found to cancel.
- `500` — Internal Server Error.

---

[API](https://skmtc.net/platform-engineering-labs/apis/formae-rest-api.md) · [All operations](https://skmtc.net/platform-engineering-labs/apis/formae-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/platform-engineering-labs/formae-rest-api/versions/e4ee5fb76a4f/schema)
