API Reference · Incidents
Count incidents
Query
incidentCountincidentCount returns the number of incidents that started within the last N days and match the optional IQL query, e.g. incidents published on a statuspage via "statuspage = <id>", or incidents of a team via "team = <publicId>".
incidentCount(
organizationId: ID!
days: Int!
query: String
): Int!Arguments
Field
Type
Returns
Int!
Example
query IncidentCount($organizationId: ID!, $days: Int!, $query: String) {
incidentCount(organizationId: $organizationId, days: $days, query: $query)
}Example response
{
"data": {
"incidentCount": 1
}
}Related
Get incident statistics
Returns daily incident statistics of an organization: `resolved-incidents`, `active-incidents`, `mtta`, `mttr` and `impact-duration`, in that order.
Create incident
Creates a new incident with a priority and title, optionally linked to affected services and the status pages it should be posted on.