---
title: "Cancel an async analysis task"
method: POST
path: "/analyze/tasks/{task_id}/cancel"
tags: ["analyzeAsync > tasks"]
---

# Cancel an async analysis task

`POST /analyze/tasks/{task_id}/cancel`

## Request

- Base URL: `https://api.twelvelabs.io/v1.3`
- URL: `https://api.twelvelabs.io/v1.3/analyze/tasks/{task_id}/cancel`
- Auth: API key in header `x-api-key`

Use this method to cancel an asynchronous analysis task in your account. To cancel a task created as part of a batch, use the [`POST`](/v1.3/api-reference/analyze-videos/batch-analysis/cancel-batch) method of the `/analyze/batches/{batch_id}/cancel` endpoint.

You can cancel a task with the `queued`, `pending`, or `processing` status. This action cannot be undone.

Processing that has already started can continue briefly after cancellation.

When you cancel a task, the platform can send an `analyze.task.canceled` webhook. Delivery is best-effort: a `200` response is not a delivery guarantee. When you receive the event, retrieve the task for its current state.

## Path parameters

- `task_id` string, required

## Response `200`

The task is canceled. This response is also returned when the task was canceled by a previous request.

- CancelAnalyzeTaskResponse: The task identifier and the `canceled` status.
  - `task_id` string, required: The unique identifier of the analysis task.
  - `status` 'canceled', required: The final status of the task.

## Other responses

- `400`: The identifier of the task is invalid.
- `401`: The API key is invalid or expired.
- `403`: Cancellation is not enabled for your account, or the API is unavailable in your region. The platform checks whether cancellation is enabled before it validates the task identifier. If cancellation is disabled for your account, the API returns `api_not_allowed` even when the task identifier is invalid.
- `404`: The task does not exist or is not accessible with your API key. The API returns the same response in both cases.
- `409`: The task cannot be canceled because it was created as part of a batch, has completed, or has failed. - `task_owned_by_batch`: The task was created as part of a batch. Use the [`POST`](/v1.3/api-reference/analyze-videos/batch-analysis/cancel-batch) method of the `/analyze/batches/{batch_id}/cancel` endpoint instead. - `task_completed`: The task has completed. - `task_failed`: The task has failed.
- `500`: An unexpected server error occurred.

## Changes

- **2026-10-01** `69c273061729`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/twelvelabs/apis/twelvelabs-api/changes/analyze/tasks/:task_id/cancel/post.md)

---

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