How many units there are, how many are stale or report through bundles, and by release
const url = 'https://example.com/v1/units/stats';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://example.com/v1/units/stats \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Counts
object
All units
Units whose last report was collected more than stale_days days ago
Units whose last report came through an offline bundle
Units linked to a release with an open finding that is affected or known exploited, stale ones included (upgrade=any lists them)
Of to_upgrade, the units with a newer release of their variant, with an SBOM, that has none of those findings open (upgrade=now); the rest wait for a fix (upgrade=waiting)
The release texts units report, most units first, at most 100; an empty release is the units that reported none
object
All distinct release texts, the empty one included
Up to 6 stale units, oldest report first
A unit’s latest report without its packages, as the unit list shows it. The fields are Report’s.
object
object
The product’s name.
The number of packages /units/report lists for the unit
Up to 6 units, newest report first
A unit’s latest report without its packages, as the unit list shows it. The fields are Report’s.
object
object
The product’s name.
The number of packages /units/report lists for the unit
Example
{ "stalest": [ { "delivery": "online" } ], "latest": [ { "delivery": "online" } ]}Missing or invalid API key
Over the operation’s rate-limit budget (x-affectra-budget): code request.rateLimited with params.budget. Wait Retry-After seconds before trying again.
Every error answer, Content-Type
application/problem+json. The web app and integrations translate code; detail is English,
for people reading curl output or CI logs, and may change wording at
any time. Match on code, never on detail.
object
The HTTP status
Stable error codes. A code is never renamed; new ones may be added, so
a client falls back to detail for a code it doesn’t know. Another
organization’s object answers notFound, the same as a missing one.
What went wrong
Values the code’s message needs, e.g. {“field”: “version”}. Only values the caller sent or may see. Empty when the message needs none.
object
Example
{ "code": "notFound"}Headers
Section titled “Headers”Seconds until a request would be allowed again, at least 1