CentralCSP
APIReports

List reported policies

Lists the distinct policies browsers reported as in force when a violation occurred, with how often each was seen and whether it was enforced or report-only. Useful for spotting an outdated policy that is still served. Covers all stored reports rather than a range. Only available for csp-violation.

Requires the viewer role on the website and the report type's plan feature.

GET
/v1/workspaces/{workspaceId}/websites/{websiteId}/reports/{type}/policies

Authorization

headerAuthorizationBearer <JWT>

An OpenID Connect access token from signing in to CentralCSP, acting as the signed-in user.

Path Parameters

workspaceId*string

The workspace's id.

websiteId*string

The website's id.

type*string

Which kind of report to read. A website only collects the types its plan includes and its settings allow.

Value in"csp-violation""csp-hash""integrity-violation""permissions-policy-violation""potential-permissions-policy-violation""document-policy-violation""connection-allowlist""intervention""deprecation""crash""coop""coep""network-error"

Query Parameters

search?string

Match part of the policy text.

Lengthlength <= 4096
cursor?string

The nextCursor of the previous page.

limit*|

How many policies to return, from 1 to 200.

Range1 <= value <= 200
Default50

Response Body

A page of reported policies.

application/json
  1. response
data*array<>

The reported policies on this page.

pagination*

Where this page sits in the full result set.

Example Request
curl -X GET 'https://api.centralcsp.com/v1/workspaces/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/websites/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/reports/csp-violation/policies?limit=50'
Example Response
{  "data": [    {      "policy": "string",      "dispositions": [        "enforce"      ],      "count": 0,      "firstSeen": "2019-08-24T14:15:22Z",      "lastSeen": "2019-08-24T14:15:22Z"    }  ],  "pagination": {    "nextCursor": "string",    "hasMore": true,    "total": 0  }}