Skip to content

Incidents API

Incidents are automatically created when alert rules fire. They track the lifecycle of an alert event from detection through resolution. Incidents are managed through the dashboard API (not the client API).

INFO

These endpoints are dashboard APIs, authenticated via JWT session (not API tokens). They are used by the Cognipeer Console UI.

List Incidents

GET /api/alerts/incidents

Query Parameters

ParameterTypeRequiredDescription
ruleIdstringNoFilter by alert rule ID
statusstringNoFilter by status: open, acknowledged, investigating, resolved, closed
severitystringNoFilter by severity: critical, warning, info
limitnumberNoMax results (default: 50)
skipnumberNoPagination offset (default: 0)

Response

json
{
  "incidents": [
    {
      "_id": "inc_abc123",
      "ruleId": "rule_xyz",
      "ruleName": "High Error Rate",
      "metric": "model_usage_error_rate",
      "threshold": 5,
      "actualValue": 12.3,
      "severity": "critical",
      "status": "open",
      "notes": [],
      "statusHistory": [
        { "status": "open", "changedBy": "system", "changedAt": "2026-03-01T10:00:00.000Z" }
      ],
      "createdAt": "2026-03-01T10:00:00.000Z",
      "updatedAt": "2026-03-01T10:00:00.000Z"
    }
  ],
  "openCount": 3
}

Get Incident

GET /api/alerts/incidents/:incidentId

Response

json
{
  "incident": {
    "_id": "inc_abc123",
    "ruleId": "rule_xyz",
    "ruleName": "High Error Rate",
    "metric": "model_usage_error_rate",
    "threshold": 5,
    "actualValue": 12.3,
    "severity": "critical",
    "status": "acknowledged",
    "notes": [
      {
        "userId": "user_1",
        "userEmail": "admin@example.com",
        "content": "Investigating upstream provider issues",
        "createdAt": "2026-03-01T10:30:00.000Z"
      }
    ],
    "statusHistory": [
      { "status": "open", "changedBy": "system", "changedAt": "2026-03-01T10:00:00.000Z" },
      { "status": "acknowledged", "changedBy": "user_1", "changedAt": "2026-03-01T10:15:00.000Z" }
    ],
    "createdAt": "2026-03-01T10:00:00.000Z",
    "updatedAt": "2026-03-01T10:15:00.000Z"
  }
}

Update Incident Status

PATCH /api/alerts/incidents/:incidentId

Request

json
{
  "status": "acknowledged"
}

Valid Statuses

StatusDescription
openInitial state when incident is created
acknowledgedOperator has seen the incident
investigatingActive investigation in progress
resolvedRoot cause addressed
closedIncident fully closed

Status Workflow

open → acknowledged → investigating → resolved → closed
  ↑                                      │
  └──────────── reopen ──────────────────┘

Resolved incidents may be reopened back to open if the issue recurs.

Add Note

POST /api/alerts/incidents/:incidentId/notes

Request

json
{
  "content": "Identified root cause: upstream provider rate limiting"
}

Parameters

FieldTypeRequiredDescription
contentstringYesNote text (non-empty)

Response

Returns the updated incident with the new note appended.

Severity Levels

Severity is automatically calculated when an incident is created based on the metric type and how far the actual value exceeds the threshold:

SeverityDescription
criticalActual value significantly exceeds threshold
warningThreshold breached but within moderate range
infoMinor threshold violation

Errors

StatusDescription
400Missing or invalid status value
401Not authenticated
404Incident not found
500Internal server error

Community edition is AGPL-3.0. Commercial licensing and support are available separately.