Skip to main content
GET
/
v1
/
analytics
/
incidents
Incident statistics
curl --request GET \
  --url https://api.example.com/v1/analytics/incidents

Overview

Returns aggregated incident statistics for the current tenant over a specified time period. Use this endpoint to track incident trends, resolution rates, and mean time to resolution (MTTR). Required role: Any authenticated user

Query parameters

period
string
The time period to aggregate statistics over. One of: 7d, 30d, 90d. Defaults to 30d.

Response

Returns 200 OK with aggregated incident statistics.
{
  "totalIncidents": 47,
  "resolvedIncidents": 43,
  "mttr": 1800,
  "resolutionRate": 0.915,
  "bySeverity": {
    "critical": 3,
    "high": 12,
    "medium": 22,
    "low": 10
  }
}
FieldTypeDescription
totalIncidentsintegerTotal number of incidents created in the period
resolvedIncidentsintegerNumber of incidents that reached resolved status in the period
mttrintegerMean time to resolution in seconds, averaged across all resolved incidents
resolutionRatenumberProportion of incidents resolved: resolvedIncidents / totalIncidents (0 to 1)
bySeverity.criticalintegerNumber of incidents with critical severity
bySeverity.highintegerNumber of incidents with high severity
bySeverity.mediumintegerNumber of incidents with medium severity
bySeverity.lowintegerNumber of incidents with low severity

Error responses

StatusError codeDescription
400validation_errorThe period parameter is not one of the allowed values

Examples

# Default 30-day period
curl "https://api.causeflow.ai/v1/analytics/incidents" \
  -H "Authorization: Bearer <token>"

# Last 90 days
curl "https://api.causeflow.ai/v1/analytics/incidents?period=90d" \
  -H "Authorization: Bearer <token>"