Skip to Content
fastmon Docs
Error tracking

Content Security Policy reports browsers sent

Report an issue

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), as well as hour_of_day on the report's own time in timezone. 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".

Requires: analytics:read, held by every role.

Authorization

headerAuthorizationBearer <fm_… / fmo_…>

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.

Path Parameters

org_id*Org Id

An ID, a UUID in lowercase with hyphens.

Formatuuid

Request Body

application/json
  1. 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?GranularityRequest

Bucket size of the series: 'minute', 'five_minutes', 'fifteen_minutes', 'hour', 'six_hours', 'day', or 'auto' (default: the smallest width with at most 300 buckets over the window, and 'day' from 28 days). A width under an hour allows at most 1500 buckets.

Default"auto"
Value in"auto""minute""five_minutes""fifteen_minutes""hour""six_hours""day"
timezone?|

IANA time zone whose boundaries start the six_hours, day, week and month buckets, such as Europe/Berlin. A day is 23 or 25 hours long across a DST switch. Bucket timestamps stay UTC. In a zone whose offset is not whole hours a bucket starts at the UTC hour that holds the local boundary. Without it the buckets start at UTC boundaries

sparse_buckets?|

The sparse threshold of the page, the number POST /analytics/sparse-hours derives. With exclude the rows of the thin hours are left out. Without it the route only echoes the number in meta.sparse_buckets

Response Body

Successful Response

application/json
  1. 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 Count

Reports in the window

affected_visitors?Affected Visitors

Distinct 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.

POST
/organizations/{org_id}/analytics/csp
Example Request
curl -X POST 'https://api.fastmon.eu/organizations/019d8b65-a109-76c7-9f4a-bda57a7ab21d/analytics/csp' \  -H 'Content-Type: application/json' \  -d '{  "time_range": {    "from": "2026-04-14T09:50:01Z",    "to": "2026-04-14T09:50:01Z"  }}'
Example Response
{  "meta": {    "execution_time_ms": 0,    "total": 0,    "limit": 0,    "offset": 0,    "has_more": true,    "next_cursor": "string",    "sampling": {      "rate": 0,      "is_sampled": true,      "estimated_metrics": [        "string"      ]    },    "is_identity_mixed": true,    "complete_until": "2026-04-14T09:50:01Z",    "sparse_buckets": {      "min_pageviews": 0,      "excluded_hour_count": 0    },    "stitchless_site_ids": [      "019d8b65-a109-76c7-9f4a-bda57a7ab21d"    ]  },  "request": {    "time_range": {      "from": "2026-04-14T09:50:01Z",      "to": "2026-04-14T09:50:01Z"    },    "comparison_time_range": {      "from": "2026-04-14T09:50:01Z",      "to": "2026-04-14T09:50:01Z"    },    "granularity": "minute",    "identity": "stitch",    "window_seconds": 0,    "filters": {},    "url_param_key": "string"  },  "report_count": 0,  "affected_visitors": 0,  "reports_by_effective_directive": {    "property1": 0,    "property2": 0  },  "reports_by_disposition": {    "property1": 0,    "property2": 0  },  "series": [    {      "timestamp": "2026-04-14T09:50:01Z",      "report_count": 0,      "reports_by_effective_directive": {        "property1": 0,        "property2": 0      },      "reports_by_disposition": {        "property1": 0,        "property2": 0      },      "affected_visitors": 0    }  ]}