Skip to content

Group reports by one or two dimensions

GET
/v1/reports/grouped
curl --request GET \
--url 'https://api.us.headerhawk.com/v1/reports/grouped?groupBy=example&reportType=csp-violation&disposition=enforce&deviceType=desktop&limit=50' \
--header 'Authorization: Bearer <token>'

The largest groups of the reports GET /v1/reports would list with the same filters, grouped by one dimension or two, each with its count and its trend against the window of the same length just before from. Reads reported data, so it spends the tenant’s budget too.

This is a ranking, not a list: it answers the top limit groups (at most 100) and has no cursor.

Window: the last 7 days by default, as the list’s; at most 31, longer is 400. Grouping reads every report in the window and in the window of the same length before it, for the trend. Measured worst case: 33 ms for 110,777 reports (14 MB) in 90 days.

groupBy
required
string
/^(directive|blockedHost|documentHost|disposition|browserName|osName|deviceType|siteId|feature|blockedUrl|blockedOrigin|destination|effectivePolicy|otherOrigin|sourceFile)(,(directive|blockedHost|documentHost|disposition|browserName|osName|deviceType|siteId|feature|blockedUrl|blockedOrigin|destination|effectivePolicy|otherOrigin|sourceFile))?$/

One dimension, or two comma-separated. directive and blockedHost group CSP violations only; feature, blockedUrl, blockedOrigin, destination, effectivePolicy, otherOrigin and sourceFile group the types whose reports carry them, as the filters of the same names do; disposition groups a type whose reports carry one; documentHost, browserName, osName, deviceType and siteId group every type. Any other is 400.

siteId
string format: uuid

Only this site’s reports. Another tenant’s site, or none, is 404.

reportType

Every type of report HeaderHawk stores and lists. The issue types (IssueReportType) and deprecation, intervention, network-error and crash. An open enum.

string
Allowed values: csp-violation integrity-violation coep coop permissions-policy-violation document-policy-violation connection-allowlist deprecation intervention network-error crash

The type of report to read. Defaults to csp-violation.

directive
string
<= 64 characters /^[\x20-\x5B\x5D-\x7E]+$/

CSP violations only: the violated directive, such as script-src. _ matches any one character. Every text filter takes printable ASCII with no backslash.

blockedHost
string
<= 255 characters /^[\x20-\x5B\x5D-\x7E]+$/

CSP violations only: the host the policy blocked. _ matches any one character.

disposition
string
Allowed values: enforce report

Only enforced violations, or only report-only ones. Deprecations, interventions, network errors and crashes have no disposition, so it is 400 with those.

documentHost
string
<= 255 characters /^[\x20-\x5B\x5D-\x7E]+$/

The host of the page the report came from. _ matches any one character.

browserName
string
<= 64 characters /^[\x20-\x5B\x5D-\x7E]+$/

The browser that sent the report, such as Chrome.

osName
string
<= 64 characters /^[\x20-\x5B\x5D-\x7E]+$/

The operating system the browser ran on, such as Windows.

deviceType
string
Allowed values: desktop mobile tablet unknown

The kind of device the browser ran on.

feature
string
<= 128 characters /^[\x20-\x5B\x5D-\x7E]+$/

The policy-controlled feature or API the report names: COEP, COOP, permissions and document policy violations, deprecations, interventions, network errors (the error type) and crashes (the reason).

blockedUrl
string
<= 512 characters /^[\x20-\x5B\x5D-\x7E]+$/

Integrity violations only: the resource loaded without integrity metadata.

blockedOrigin
string
<= 255 characters /^[\x20-\x5B\x5D-\x7E]+$/

Integrity, COEP and connection allowlist violations only: the origin that was blocked.

destination
string
<= 64 characters /^[\x20-\x5B\x5D-\x7E]+$/

Integrity and COEP violations only: the request destination, such as script.

effectivePolicy
string
<= 128 characters /^[\x20-\x5B\x5D-\x7E]+$/

COOP violations only: the policy in effect.

otherOrigin
string
<= 255 characters /^[\x20-\x5B\x5D-\x7E]+$/

COOP violations only: the other document’s origin.

sourceFile
string
<= 512 characters /^[\x20-\x5B\x5D-\x7E]+$/

Permissions and document policy violations, deprecations and interventions: the script that used the feature, without its query.

from
string format: date-time

Only reports received at or after this instant. Defaults to the start of your retention window, or where the operation bounds its window, to that many days before to. Earlier than your retention reaches is 400.

to
string format: date-time

Only reports received before this instant. Defaults to now.

limit
integer
default: 50 >= 1 <= 100

How many groups to answer, largest first.

The largest groups

Media typeapplication/json
object
groupBy
required

The dimensions asked for, in order.

Array<string>
>= 1 items <= 2 items
data
required
Array<object>
object
values
required

The group’s value for each groupBy dimension, in order.

Array<string>
>= 1 items <= 2 items
reportCount
required

Reports stored in the group in the window.

integer
firstSeen
required
string format: date-time
lastSeen
required
string format: date-time
trendPercent
required

The change against the window of the same length just before from, in percent; null when that window had none, or reaches back past your retention window, whose reports are deleted.

number
nullable
Examplegenerated
{
"groupBy": [
"example"
],
"data": [
{
"values": [
"example"
],
"reportCount": 1,
"firstSeen": "2026-04-15T12:00:00Z",
"lastSeen": "2026-04-15T12:00:00Z",
"trendPercent": 1
}
]
}
RateLimit-Limit
integer

The budget nearest to running out, per minute.

RateLimit-Remaining
integer

What is left of that budget this minute.

RateLimit-Reset
integer

Seconds until that budget starts again.

A parameter was refused, or one the operation does not take was sent. The message names it.

Media typeapplication/json
object
error
required
object
code
required

What went wrong. An open enum: treat a code you do not know by its HTTP status.

string
Allowed values: bad_request validation_error invalid_api_key plan_upgrade_required forbidden not_found rate_limited rate_limit_unavailable upstream_unavailable internal_error
message
required

For people. Branch on code.

string
requestId
required

Quote it when you write to us about this request.

string
Example
{
"error": {
"code": "bad_request"
}
}

invalid_api_key: no key, or one that is malformed, unknown, revoked or expired. One answer for all of them.

Media typeapplication/json
object
error
required
object
code
required

What went wrong. An open enum: treat a code you do not know by its HTTP status.

string
Allowed values: bad_request validation_error invalid_api_key plan_upgrade_required forbidden not_found rate_limited rate_limit_unavailable upstream_unavailable internal_error
message
required

For people. Branch on code.

string
requestId
required

Quote it when you write to us about this request.

string
Example
{
"error": {
"code": "bad_request"
}
}

plan_upgrade_required: the tenant’s plan does not include API access (the key works again when it does), or does not include what this operation reads.

Media typeapplication/json
object
error
required
object
code
required

What went wrong. An open enum: treat a code you do not know by its HTTP status.

string
Allowed values: bad_request validation_error invalid_api_key plan_upgrade_required forbidden not_found rate_limited rate_limit_unavailable upstream_unavailable internal_error
message
required

For people. Branch on code.

string
requestId
required

Quote it when you write to us about this request.

string
Example
{
"error": {
"code": "bad_request"
}
}

No such resource in your tenant.

Media typeapplication/json
object
error
required
object
code
required

What went wrong. An open enum: treat a code you do not know by its HTTP status.

string
Allowed values: bad_request validation_error invalid_api_key plan_upgrade_required forbidden not_found rate_limited rate_limit_unavailable upstream_unavailable internal_error
message
required

For people. Branch on code.

string
requestId
required

Quote it when you write to us about this request.

string
Example
{
"error": {
"code": "bad_request"
}
}

rate_limited: over a budget. Wait Retry-After seconds.

Media typeapplication/json
object
error
required
object
code
required

What went wrong. An open enum: treat a code you do not know by its HTTP status.

string
Allowed values: bad_request validation_error invalid_api_key plan_upgrade_required forbidden not_found rate_limited rate_limit_unavailable upstream_unavailable internal_error
message
required

For people. Branch on code.

string
requestId
required

Quote it when you write to us about this request.

string
Example
{
"error": {
"code": "bad_request"
}
}
Retry-After
integer

Seconds to wait before trying again.

rate_limit_unavailable or upstream_unavailable: HeaderHawk could not serve this now. Nothing is wrong with the request; try again after Retry-After seconds.

Media typeapplication/json
object
error
required
object
code
required

What went wrong. An open enum: treat a code you do not know by its HTTP status.

string
Allowed values: bad_request validation_error invalid_api_key plan_upgrade_required forbidden not_found rate_limited rate_limit_unavailable upstream_unavailable internal_error
message
required

For people. Branch on code.

string
requestId
required

Quote it when you write to us about this request.

string
Example
{
"error": {
"code": "bad_request"
}
}
Retry-After
integer

Seconds to wait before trying again.