How to list scans
Manage the scans by listing them using pagination. You can list scans at two different levels:
- By account - List scans of all the targets in your account.
- By target - List scans of a specific target.
Step 1: List the scans (first page)
Start by listing the first page of scans.
- By Account
- By Target
In this request, no path parameters are needed since it is for the whole account.
curl https://api.probely.com/scans/ \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"
The response returns the information on:
- The total number of scans (
”count”: 784
). - The total number of pages (
”page_total”: 79
). - The current page (
”page”: 1
). - The page size (
”length”: 10
). - The list of scans on the page (
”results”: [...]
).
{
"count": 784,
"page_total": 79,
"page": 1,
"length": 10,
"results": [
{
"id": "4dPZ1tRAg1vr",
"target": {
"id": "3n51GK9X1on9",
"name": "",
"site": {
"id": "29uiNA1Th5uP",
"name": "My API target",
"desc": "",
"url": "http://api.example.com/",
"host": "api.example.com",
...
}
...
},
"status": "canceled",
"started": "2024-09-11T15:51:56.221238Z",
"completed": "2024-09-11T15:52:23.161521Z",
"scan_profile": "api_normal",
"lows": 0,
"mediums": 0,
"highs": 0,
"created": "2024-09-11T15:51:51.385561Z",
...
}
{
"id": "NrcdAkeRok3V",
"target": {
"id": "44VJ7XFUgnSx",
"name": "",
"site": {
"id": "3Vm6PFiywcif",
"name": "My Web App target",
"desc": "",
"url": "https://app.example.com/",
"host": "app.example.com",
...
}
...
},
"status": "completed",
"started": "2024-09-07T11:13:35.315624Z",
"completed": "2024-09-07T15:54:44.088946Z",
"scan_profile": "normal",
"lows": 19,
"mediums": 2,
"highs": 2,
"created": "2024-09-07T11:13:28.059029Z",
...
}
...
]
}
In this request, the target identifier is 3n51GK9X1on9
.
curl https://api.probely.com/targets/3n51GK9X1on9/scans/ \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"
The response returns the information on:
- The total number of scans (
”count”: 14
). - The total number of pages (
”page_total”: 2
). - The current page (
”page”: 1
). - The page size (
”length”: 10
). - The list of scans on the page (
”results”: [...]
)
{
{
"count": 14,
"page_total": 2,
"page": 1,
"length": 10,
"results": [
{
"id": "4dPZ1tRAg1vr",
"target": {
"id": "3n51GK9X1on9",
"name": "",
"site": {
"id": "29uiNA1Th5uP",
"name": "My API target",
"desc": "",
"url": "http://api.example.com/",
"host": "api.example.com",
...
}
...
},
"status": "completed",
"started": "2024-09-11T15:51:56.221238Z",
"completed": "2024-09-11T15:52:23.161521Z",
"scan_profile": "api_normal",
"lows": 5,
"mediums": 5,
"highs": 8,
"created": "2024-09-11T15:51:51.385561Z",
...
}
{
"id": "2cYZ1AZxAhz2",
"target": {
"id": "3n51GK9X1on9",
"name": "",
"site": {
"id": "29uiNA1Th5uP",
"name": "My API target",
"desc": "",
"url": "http://api.example.com/",
"host": "api.example.com",
...
}
...
},
"status": "canceled",
"started": "2024-08-29T10:54:17.030645Z",
"completed": "2024-08-29T11:16:28.498084Z",
"scan_profile": "api_normal",
"lows": 0,
"mediums": 0,
"highs": 0,
"created": "2024-08-29T10:54:13.185446Z",
...
}
...
]
}
Step 2: List the scans (second page)
Since there are more scans, list the scans on the second page by adding the page=2
query parameter.
- By Account
- By Target
curl https://api.probely.com/scans/?page=2 \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"
The response returns the second page (”page”: 2
) with the second set of scans (”results”: [...]
).
{
{
"count": 784,
"page_total": 79,
"page": 2,
"length": 10,
"results": [
{
"id": "3yptz5Xqd3cC",
"target": {
"id": "KLj1KcyGAE6v",
"name": "",
"site": {
"id": "38zqVR1Jtd5N",
"name": "My Web App II target",
"desc": "",
"url": "http://example2.com/",
"host": "example2.com",
...
}
...
},
"status": "completed",
"started": "2024-08-24T04:00:27.414415Z",
"completed": "2024-08-24T04:38:58.903206Z",
"scan_profile": "safe",
"lows": 12,
"mediums": 4,
"highs": 10,
"created": "2024-08-24T04:00:10.377318Z",
...
}
{
"id": "2GuVT1s5U3ua",
"target": {
"id": "3jWDPrNpAhSK",
"name": "",
"site": {
"id": "44r1jaiKbqHP",
"name": "My API II target",
"desc": "",
"url": "http://api.example2.com/",
"host": "api.example2.com",
...
}
...
},
"status": "completed",
"started": "2024-08-16T04:00:31.905272Z",
"completed": "2024-08-16T18:27:50.110955Z",
"scan_profile": "api_normal",
"lows": 2,
"mediums": 7,
"highs": 20,
"created": "2024-08-16T04:00:13.228359Z",
...
}
...
]
}
curl https://api.probely.com/targets/3n51GK9X1on9/scans/?page=2 \
-X GET \
-H 'Authorization: JWT <YOUR_API_TOKEN>' \
-H "Content-Type: application/json"
The response returns the second page (”page”: 2
) with the second set of scans (”results”: [...]
).
{
"count": 14,
"page_total": 2,
"page": 2,
"length": 10,
"results": [
{
"id": "2X1XhanfXfGv",
"target": {
"id": "3n51GK9X1on9",
"name": "",
"site": {
"id": "29uiNA1Th5uP",
"name": "My API target",
"desc": "",
"url": "http://api.example.com/",
"host": "api.example.com",
...
}
...
}
"status": "completed",
"started": "2024-06-06T15:40:16.661042Z",
"completed": "2024-06-06T16:59:16.244758Z",
"scan_profile": "api_normal",
"lows": 0,
"mediums": 5,
"highs": 4,
"created": "2024-06-06T15:40:12.254699Z",
...
}
{
"id": "412botER1cnJ",
"target": {
"id": "3n51GK9X1on9",
"name": "",
"site": {
"id": "29uiNA1Th5uP",
"name": "My API target",
"desc": "",
"url": "http://api.example.com/",
"host": "api.example.com",
...
}
...
}
"status": "completed",
"started": "2024-05-18T14:37:22.682714Z",
"completed": "2024-05-18T15:26:36.865666Z",
"scan_profile": "api_normal",
"lows": 2,
"mediums": 5,
"highs": 3,
"created": "2024-05-18T14:37:20.440686Z",
...
}
...
]
}
Change the page number to move on to the scans on the other pages.
You can use other query parameters to adjust the pagination or to filter scans according to your needs. Check the API reference documentation on the List Account's Scans and List Target's Scans endpoints for more details.