Content Security Policy reports browsers sent
Content Security Policy violations on the organization's sites.
A site whose policy names fastmon in report-to or report-uri gets a
report from the browser for every script, style or request the policy
blocked, or would have blocked under Content-Security-Policy-Report-Only.
The answer counts them over the window, per bucket, per directive and per
disposition.
Beside each count stands affected_visitors, the distinct visitors behind
it. A visitor is a non-zero stitch, so only sites with store_stitch
count them, and meta.stitchless_site_ids names the sites that do not.
The counts are the reports the browsers sent. The edge does not sample
them, so meta.sampling does not describe them. disposition tells
blocked violations (enforce) from merely reported ones (report), and
'' counts the reports whose browser did not say.
Filters: the site scope, stitch, the report's own report_id,
disposition, effective_directive, blocked_url, source_url,
page_url and status_code_range, and the edge-derived dimensions
(country, asn, device_type, browser, browser_version, os,
bot_class, is_bot, is_datacenter, bot_name, bot_type,
datacenter, ua_anomaly). exclude takes disposition,
effective_directive, blocked_url, source_url, page_url and the
nine edge labels. Any other filter is a 422 naming it, since an empty
answer would read as "no violations".
bearerAuthAuthentifizierungBearer <token>API token generated from the fastmon dashboard (Account → API Token) or at organization level (fmo_…, one that outlives its creator). Send as Authorization: Bearer fm_... or paste the full token (including its prefix) into the Authorize dialog.
org_id*Org Iduuidapplication/json- body
Request for the Content Security Policy reports of the organization's sites.
time_range*Time range, on the time the browser saw the violation
filters?Optional filters. The site scope, stitch, the report's own fields and the edge-derived dimensions are accepted, because a report carries those and no pageview or metric. Anything else is a 422 naming it under its own path, since an empty answer would read as 'no violations'.
granularity?GranularityRequestBucket size of the series: 'minute' (windows up to 6h), 'hour', 'day', or 'auto' (default; <=48h windows give hourly, longer daily).
"auto""auto""minute""hour""day"Successful Response
application/json- response
The Content Security Policy reports of the organization's sites.
Every count is the number of reports the browsers sent. The edge does not
sample them, so meta.sampling does not describe them.
meta*Facts about the result
request*The request as the server resolved it
report_count*Report CountReports in the window
affected_visitors?Affected VisitorsDistinct visitors behind the reports of the window, each once however many buckets it appears in. Counted over the non-zero stitch. Only sites with store_stitch carry a stitch, and a report that came without a valid stitch is left out. The stitch salt rotates daily and on every edge restart, so a report uploaded after a rotation loses its visitor. Absent when no site in scope stores a stitch
reports_by_effective_directive*The directive the violation broke to its reports in the window
reports_by_disposition*enforce and report to their reports, and '' for the reports whose browser did not say, in the window
series*array<>One point per bucket with at least one report. A bucket with none is absent rather than zero-filled, as in /analytics/query.
curl -X POST 'https://api.fastmon.eu/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/analytics/csp' \ -H 'Content-Type: application/json' \ -d '{ "time_range": { "from": "2019-08-24T14:15:22Z", "to": "2019-08-24T14:15:22Z" }}'{ "meta": { "execution_time_ms": 0, "total": 0, "limit": 0, "offset": 0, "has_more": true, "next_cursor": "string", "sampling": { "sampling_rate": 0, "is_sampled": true, "estimated_metrics": [ "string" ] }, "is_identity_mixed": true, "stitchless_site_ids": [ "69469e5a-8ce7-4bbc-8031-8525fff71fc6" ] }, "request": { "time_range": { "from": "2019-08-24T14:15:22Z", "to": "2019-08-24T14:15:22Z" }, "comparison_time_range": { "from": "2019-08-24T14:15:22Z", "to": "2019-08-24T14:15:22Z" }, "granularity": "minute", "identity": "stitch", "window_seconds": 0, "filters": {} }, "report_count": 0, "affected_visitors": 0, "reports_by_effective_directive": { "property1": 0, "property2": 0 }, "reports_by_disposition": { "property1": 0, "property2": 0 }, "series": [ { "timestamp": "2019-08-24T14:15:22Z", "report_count": 0, "reports_by_effective_directive": { "property1": 0, "property2": 0 }, "reports_by_disposition": { "property1": 0, "property2": 0 }, "affected_visitors": 0 } ]}