Cancel Running Scan
cancel-scan🔑 Requires the same API key that started the scan. Stops a scan that is still running (pending/crawling/scanning) and returns the quota unit it cost, if the scan was started within the last hour. Use it when check-compliance was called by mistake or the wrong URL was scanned. A scan that already completed or failed cannot be cancelled and nothing is refunded. Scans started with a different API key are reported as not found. Free — does not use quota itself.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scanId": "<scanId>"
},
"name": "cancel-scan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scanId | Yes | The scan ID returned by check-compliance |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| error | No | Set when nothing was cancelled (unknown/foreign scan, already finished, Trigger.dev error) | |
| scanId | No | ||
| status | No | "cancelled" on success; the actual status if the scan had already finished | |
| details | No | ||
| message | No | ||
| refunded | No | true if one quota unit was returned | |
| runsCancelled | No |