Skip to main content

How to stop and cancel a scan

After starting a scan on a target, you can stop the scan execution to cancel it definitely.

Step 1: Stop the scan

You will need the scan and target identifiers to stop and cancel a scan. You obtain them, for example, after starting a scan or by listing scans and picking a scan that is running.

In this request, the scan identifier is 2TeAXi3hCYYV, and the target identifier is 3mX3wqKYBRQc.

Request
curl 'https://api.probely.com/targets/3mX3wqKYBRQc/scans/2TeAXi3hCYYV/cancel/' \
-X POST \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H 'Content-Type: application/json'

The response will return the scan with the status as canceling.

Response
{
"id": "2TeAXi3hCYYV",
"target": {
"id": "3mX3wqKYBRQc",
"name": "",
"site": {
"id": "spMJGK2QAB7B",
"name": "My target",
"desc": "",
"url": "https://example.com",
"host": "example.com",
...
},
...
},
"status": "canceling",
"started": "2024-09-20T14:49:39.894401Z",
"completed": null,
...
}

The scan will soon be stopped and canceled, and the status will change to canceled. You can check the scan status with the Retrieve Scan endpoint.