---
title: "POST /api/exploration/thread/{thread-id}/cancel"
method: POST
path: "/api/exploration/thread/{thread-id}/cancel"
tags: ["/api/exploration"]
---

# POST /api/exploration/thread/{thread-id}/cancel

`POST /api/exploration/thread/{thread-id}/cancel`

## Request

- Base URL: `` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/exploration/thread/{thread-id}/cancel`
- Auth: API key in header `X-API-Key`

Cancel an in-flight exploration thread. Stamps `canceled_at` and `completed_at` on the thread,
  and bulk-flips any still-`pending` ExplorationQuery rows to `canceled`. In-flight queries
  currently mid-QP-execution are left to run to natural completion — their result rows are
  orphaned but harmless (timeline scoring skips canceled threads).

  Idempotent: a thread with `completed_at IS NOT NULL` (already terminal — natural completion or
  prior cancel) returns 200 with its existing state. Authorization is the same write check as
  other thread-mutating endpoints.

## Path parameters

- `thread-id` integer, required

## Response `2XX`

Successful response

- MetabaseExplorationsApiCanceledThread: Schema for the cancel endpoint response — just the state-bearing fields the FE needs to reflect the cancellation. EQ status changes are picked up via the existing `/queries` poll.
  - `canceled_at` unknown, required
  - `completed_at` unknown, required
  - `id` integer, required: value must be an integer greater than zero.

## Other responses

- `4XX`: Client error response
- `5XX`: Server error response

## Changes

- **2026-11-04** `2e178f5a7934`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/metabase/apis/metabase-api/changes/api/exploration/thread/:thread-id/cancel/post.md)

---

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