Skip to content

Incident rates

Reports module

GET/reports/incident-ratesreports.incidentRates

Incidents and open incidents per canon severity, optionally for one project and a window of occurrence. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requires the capability safety.incident.read.
  • OAuth scopes: safety.
  • Error statuses: 400, 401, 422, 429. Errors are RFC 9457 problem details.

Path and query parameters

reports.incidentRates: Path and query parameters
FieldTypeRequiredDescription
project_idstring (uuid)NoOnly this project; every visible project when omitted.
fromstring (date)NoOccurred on or after this day.
tostring (date)NoOccurred on or before this day.

Response 200: ReportMetricRowPage

reports.incidentRates: ReportMetricRowPage
FieldTypeRequiredDescription
dataarray of ReportMetricRowYesItems on this page, in the documented default order.
next_cursorstring | nullYesOpaque cursor for the next page; null on the last page.
{
  "data": [
    {
      "dimension": "NWL",
      "project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
      "measure": "worked_hours",
      "unit": "Hours",
      "value": 312.5
    }
  ],
  "next_cursor": null
}

Code samples

curl -X GET "$XOS_BASE_URL/reports/incident-rates" \
  -H "Authorization: Bearer $XOS_API_KEY"
const { data } = await xos.reports.incidentRates();
response = xos.reports.incident_rates()
xos reports incident-rates