CentralCSP
APIReports

Get a drill-down view

Opens up one row of a breakdown. Pass the row's key to get the detail behind it. Rows here carry their own key, so you can drill further.

Views by report type: csp-hash has scripts (scripts served from an origin), pages (pages that load a script) and hashes (the hashes a script has had). Every other type has detail (the individual pages and URLs behind a row). A view the report type does not have returns 404.

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

GET
/v1/workspaces/{workspaceId}/websites/{websiteId}/reports/{type}/views/{view}

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"
view*string

Which drill-down to open. csp-hash has scripts, pages and hashes. Every other report type has detail.

Value in"detail""scripts""pages""hashes"

Query Parameters

sort?string

Order rows by report count, last seen or first seen. Views without a first-seen date ignore firstSeen and keep their default order.

Value in"count""lastSeen""firstSeen"
order?string

Sort direction. Defaults to newest or largest first, and oldest first for firstSeen.

Value in"asc""desc"
key?string

The key of the row you are drilling into. Without it the view covers the whole website.

range*string

How far back to look, counted from now. Reports are kept for 90 days, so 90d is the widest range available.

Default"7d"
Value in"24h""7d""30d""90d"
search?string

Match part of a URL or value in the row.

Lengthlength <= 4096
cursor?string

The nextCursor of the previous page.

limit*|

How many rows to return, from 1 to 200.

Range1 <= value <= 200
Default50

Response Body

A page of drill-down rows.

application/json
  1. response
data*array<>

The drill-down rows 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/views/detail?range=24h&limit=50'
Example Response
{  "data": [    {      "key": "string",      "dimensions": {},      "collected": {},      "attributes": {},      "count": 0,      "firstSeen": "2019-08-24T14:15:22Z",      "lastSeen": "2019-08-24T14:15:22Z"    }  ],  "pagination": {    "nextCursor": "string",    "hasMore": true,    "total": 0  }}