List issues across your sites
const url = 'https://api.us.headerhawk.com/v1/issues?limit=50';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.us.headerhawk.com/v1/issues?limit=50' \ --header 'Authorization: Bearer <token>'Issues from every site, or from one with siteId, most recently seen
first. An issue groups the reports that are about the same thing — for
a CSP violation, one directive blocking one host — whichever page sent
them. Reads reported data, so it spends the tenant’s budget too.
Window: the last 7 days by default; at most 31, longer is 400.
A page reads every report in its window whatever limit is. Measured
worst case: 94–101 ms for a page of 200 and 28–33 ms for the count,
reading 123,836 reports (32 MB) in 90 days, about 0.8 µs a report.
At most the first 10,000 issues of a query can be paged through;
narrow from and to to reach further.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only this site’s issues.
Only issues of these types, comma-separated. Defaults to every type.
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.
Only reports received before this instant. Defaults to now.
How many items a page holds.
The previous page’s nextCursor. Omit it for the first page.
Responses
Section titled “Responses”A page of issues
object
object
What kind of report an issue groups. An open enum.
A CSP directive, or what another type’s reports are about.
The host of the blocked resource, or of the source file.
The CSP directive. Null for every other type.
The host the CSP blocked. Null for every other type.
Reports stored for this issue in the window.
reportCount scaled up for the reports a sampling rate below 1
left out; equal to it when nothing was sampled.
How sure HeaderHawk is that an issue is real rather than noise, from how many reports and browser families sent it. An open enum.
Example
{ "data": [ { "reportType": "csp-violation", "confidence": "high" } ]}Headers
Section titled “Headers”The budget nearest to running out, per minute.
What is left of that budget this minute.
Seconds until that budget starts again.
A parameter was refused, or one the operation does not take was sent. The message names it.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
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.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
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.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}No such resource in your tenant.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}rate_limited: over a budget. Wait Retry-After seconds.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}Headers
Section titled “Headers”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.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}Headers
Section titled “Headers”Seconds to wait before trying again.