Skip to main content
POST
/
api
/
scans
/
{id}
/
cancel
curl -X POST "https://api.heimdall.dev/api/scans/550e8400-e29b-41d4-a716-446655440000/cancel" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "cancelled"
  }
}

Path Parameters

id
string
required
The unique identifier (UUID) of the scan to cancel

Behavior

This endpoint cancels a scan that is currently in progress. The scan status will be updated to cancelled and any running analysis stages will be stopped. Important Notes:
  • Only scans with status other than completed, failed, or cancelled can be cancelled
  • The scan will be marked as cancelled immediately
  • SSE (Server-Sent Events) subscribers will receive status update events
  • The SSE channel for this scan will be cleaned up after a short delay (2 seconds)

Response

Returns a simplified scan object with the updated status:
id
string
The scan ID that was cancelled
status
string
The new status of the scan (always cancelled)
curl -X POST "https://api.heimdall.dev/api/scans/550e8400-e29b-41d4-a716-446655440000/cancel" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "cancelled"
  }
}

Build docs developers (and LLMs) love