---
title: "Cancel workflow"
method: POST
path: "/v1/workflows/{key}/cancel"
tags: ["Workflows"]
---

# Cancel workflow

`POST /v1/workflows/{key}/cancel`

When invoked for a workflow using a specific workflow key and cancellation key, will cancel any queued workflow runs associated with that key/cancellation key pair. Can optionally be provided one or more recipients to scope the request to.

## Path parameters

- `key` string, required

## Request body

- CancelWorkflowRequest — When invoked using a specific workflow key and cancellation key, will cancel any queued workflow runs associated with that key/cancellation key pair. Can optionally provide one or more recipients to scope the request to.
  - `cancellation_key` string, required — An optional key that is used to reference a specific workflow trigger request when issuing a [workflow cancellation](/send-notifications/canceling-workflows) request. Must be provided while triggering a workflow in order to enable subsequent cancellation. Should be unique across trigger requests to avoid unintentional cancellations.
  - `recipients` RecipientReference[], nullable — A list of recipients to cancel the notification for. If omitted, cancels for all recipients associated with the cancellation key.
    - union — A reference to a recipient, either a user identifier (string) or an object reference (ID, collection).
      - string — The ID of the user which is used as the reference for the recipient.
      - object — A reference to a recipient object.
        - `collection` string — The collection the recipient object belongs to.
        - `id` string — An identifier for the recipient object.

## Response `204`

No Content

---

[API](https://skmtc.net/knocklabs/apis/knock-api.md) · [All operations](https://skmtc.net/knocklabs/apis/knock-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/knocklabs/knock-api/revisions/4b8499dddbc5/schema)
