Skip to main content

GET /api/incidents

Retrieves all incidents for the current user. Returns incidents in reverse chronological order (most recent first), excluding merged incidents.

Authentication

Requires user authentication via cookies or headers. The user_id is extracted from the request.

Query Parameters

This endpoint does not accept query parameters. Results are limited to 100 incidents.

Response

Returns an object containing an array of incident objects.
incidents
array
Array of incident objects

Example Request

cURL
curl -X GET "https://api.aurora.example.com/api/incidents" \
  -H "Cookie: session_token=YOUR_SESSION_TOKEN"

Example Response

{
  "incidents": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "sourceType": "grafana",
      "sourceAlertId": "12345",
      "status": "investigating",
      "severity": "critical",
      "alert": {
        "title": "High CPU usage on web-server-01",
        "service": "web-server",
        "source": "grafana",
        "sourceUrl": "https://grafana.com/alerting/12345",
        "metadata": {
          "threshold": "80%",
          "currentValue": "95%"
        }
      },
      "auroraStatus": "running",
      "summary": "Investigating high CPU usage...",
      "chatSessionId": "abc123-session-id",
      "activeTab": "thoughts",
      "correlatedAlertCount": 3,
      "affectedServices": ["web-server", "api-gateway"],
      "startedAt": "2024-03-03T10:30:00Z",
      "analyzedAt": null,
      "createdAt": "2024-03-03T10:30:05Z",
      "updatedAt": "2024-03-03T10:45:00Z"
    }
  ]
}

Response Codes

200
Success
Successfully retrieved incidents
400
Bad Request
Missing user_id (authentication failed)
500
Internal Server Error
Failed to retrieve incidents

Notes

  • Results are limited to 100 most recent incidents
  • Incidents with status merged are excluded from results
  • Results are ordered by started_at in descending order (most recent first)
  • Requires Row Level Security (RLS) context to be set with the user’s ID

Build docs developers (and LLMs) love