---
title: "POST /datasources/{dataSourceName}/scans/{scanName}/runs/{runId}:cancel"
method: POST
path: "/datasources/{dataSourceName}/scans/{scanName}/runs/{runId}:cancel"
tags: ["ScanResult"]
---

# POST /datasources/{dataSourceName}/scans/{scanName}/runs/{runId}:cancel

`POST /datasources/{dataSourceName}/scans/{scanName}/runs/{runId}:cancel`

Cancels a scan.

## Path parameters

- `dataSourceName` string, required
- `scanName` string, required
- `runId` string, required

## Query parameters

- `api-version` string, required

## Response `202`

Success.

- OperationResponse — The operation response.
  - `scanResultId` string, uuid — The scan result identifier.
  - `startTime` string, date-time — The start time of the operation.
  - `endTime` string, date-time — The end time of the operation.
  - `status` 'Accepted' | 'InProgress' | 'TransientFailure' | 'Succeeded' | 'Failed' | 'Canceled' — Scan operation status.
  - `error` ErrorInfo — The error info.
    - `code` string — A unique error code that identifies the specific error.
    - `message` string — A human-readable error message that provides more details about the error.
    - `target` string — The specific component that the error is associated with.
    - `details` ErrorInfo[] — Error info detail.

## Other responses

- `default` — An error response received from the Scanning Service.

## Changes

- **2026-07-13** (2018-12-01-preview) `1dc732ab31fc` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/azure/apis/purview-scanning/changes/datasources/:dataSourceName/scans/:scanName/runs/:runId:cancel/post.md)

---

[API](https://skmtc.dev/azure/apis/purview-scanning.md) · [All operations](https://skmtc.dev/azure/apis/purview-scanning/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/purview-scanning/revisions/1dc732ab31fc/schema)
