Skip to main content

How to pause and resume a scan

After starting a scan on a target, you can pause the scan execution and resume it later on at another time you decide.

Step 1: Pause the scan

You will need the scan and target identifiers to pause 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/pause/' \
-X POST \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H 'Content-Type: application/json'

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

Response
{
"id": "2TeAXi3hCYYV",
"target": {
"id": "3mX3wqKYBRQc",
"name": "",
"site": {
"id": "spMJGK2QAB7B",
"name": "My target",
"desc": "",
"url": "https://example.com",
"host": "example.com",
...
},
...
},
"status": "pausing",
"started": null,
"completed": null,
...
}

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

caution

If the scan is left paused for more than seven consecutive days, it is automatically canceled by Probely.

Step 2: Resume the scan

Once the scan is paused, you can resume it when you want.

In this request, the scan and target identifiers are the same as in step 1 (2TeAXi3hCYYV and 3mX3wqKYBRQc, respectively).

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

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

Response
{
"id": "2TeAXi3hCYYV",
"target": {
"id": "3mX3wqKYBRQc",
"name": "",
"site": {
"id": "spMJGK2QAB7B",
"name": "My target",
"desc": "",
"url": "https://example.com",
"host": "example.com",
...
},
...
},
"status": "resuming",
"started": null,
"completed": null,
...
}

The scan will soon be resumed, and the status will change to started. You can check the scan status using the Retrieve Scan endpoint. See also how to check when a scan is complete.

If, after pausing the scan, you decide you want to cancel the scan instead of resume it, use the Cancel Scan endpoint.