---
title: "Cancel discovery sessions"
method: POST
path: "/api/v1/discoveries/bulk-cancel"
tags: ["Discoveries"]
---

# Cancel discovery sessions

`POST /api/v1/discoveries/bulk-cancel`

## Request

- Base URL: `https://app.scanopy.net`
- URL: `https://app.scanopy.net/api/v1/discoveries/bulk-cancel`
- Auth: one of:
  - API key in header `Authorization`
  - API key in cookie `session_id`

Cancels the running session of each discovery, given discovery IDs. Sessions still queued
are cancelled before running ones, so cancelling a running session never starts a queued one
that is also being cancelled. The request is refused, and nothing is cancelled, if any
discovery isn't running or its session is just starting on its daemon.

## Request body

- string[]

## Response `200`

Sessions cancelled

- ApiResponse: Envelope for a successful response. Failures are sent with a non-2xx status and an `ApiErrorResponse` body instead.
  - `data` TupleUnit: No payload. Present only so the envelope keeps its shape.
  - `error` string, nullable: Not sent on a successful response. Failure messages arrive in an `ApiErrorResponse`.
  - `meta` ApiMeta, required: API metadata included in all responses
    - `api_version` integer, required: API version (integer, increments on breaking changes)
    - `server_version` string, required: Server version (semver)
  - `success` boolean, required: Always `true` on a successful response.

## Other responses

- `400`: A discovery isn't running; the message names it
- `404`: A discovery was not found
- `409`: A session is starting on its daemon

## Changes

- **2026-10-26** `c9d9d46d1ae8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/scanopy/apis/scanopy-api/changes/api/v1/discoveries/bulk-cancel/post.md)

---

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