CentralCSP
APIScans

Run a scan

Runs one of the scanners against a website and saves the result to your history. The scan takes a while, so poll the result endpoint until it reports a finished scan.

Requires membership of the workspace.

POST
/v1/workspaces/{workspaceId}/scans

Authorization

AuthorizationBearer <token>

An OpenID Connect access token issued by Keycloak, acting as the signed-in user.

In: header

Path Parameters

workspaceId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

tool*string

Which scanner produced the scan. csp-scanner grades the Content Security Policy, header-scanner grades every security header, and reporting-api checks the reporting setup.

Value in

  • "csp-scanner"
  • "header-scanner"
  • "reporting-api"
target*string

Domain or URL to scan.

Length1 <= length <= 2048
followRedirects?boolean

Follow redirects and scan where they land.

Defaulttrue
listed?boolean

Whether the scan appears in your scan history. Set false for an automated check, such as verifying a site is configured: the scan is still kept and readable by its id, it is just not listed.

Defaulttrue

Response Body

application/json

curl -X POST "https://example.com/v1/workspaces/string/scans" \  -H "Content-Type: application/json" \  -d '{    "tool": "csp-scanner",    "target": "example.com"  }'
{  "id": "string",  "tool": "csp-scanner",  "target": "example.com",  "status": "running",  "outcome": "no_host",  "error": "bot protection interstitial detected",  "httpStatus": 403,  "urlAnalyzed": "https://example.com/",  "followRedirects": true,  "scanResultId": "string",  "scores": {    "overall": 0,    "security": 0,    "quality": 0  },  "findings": {    "critical": 0,    "high": 0,    "medium": 0,    "low": 0,    "info": 0,    "total": 0  },  "createdAt": "2019-08-24T14:15:22Z",  "finishedAt": "2019-08-24T14:15:22Z"}