---
type: api
title: Cancel a workflow execution
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-post-workflows-executions-executionid-cancel
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-post-workflows-executions-executionid-cancel
products:
  - Kibana
---

# Cancel a workflow execution

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/workflows/executions/{executionId}/cancel`
- `POST` `/s/{space_id}/api/workflows/executions/{executionId}/cancel`

#### Path parameters

- `executionId` (string · max length: 255) — required
  Workflow execution ID

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Cancel a running workflow execution by its ID.

## Required authorization

- Privileges: `workflowsManagement:cancelExecution`

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Response

Indicates a successful response

## Code examples

#### Console

```console
POST kbn://api/workflows/executions/{executionId}/cancel
```

#### curl

```curl
curl \
  -X POST "${KIBANA_URL}/api/workflows/executions/{executionId}/cancel" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true"
```

