/systems/{id}/alerts/history - Get system alert history

GET /systems/{id}/alerts/history

Get paginated history of resolved and inactive alerts for a specific system. Alerts are stored by the collect service when Alertmanager sends webhook notifications. Requires read:systems permission.

Path parameters

  • id string Required

    System ID (logto_id)

Query parameters

  • page integer

    Page number

    Minimum value is 1. Default value is 1.

  • page_size integer

    Items per page

    Minimum value is 1, maximum value is 200. Default value is 20.

  • sort_by string

    Field to sort by

    Values are id, alertname, severity, status, starts_at, ends_at, or created_at. Default value is created_at.

  • sort_direction string

    Sort direction. Unlike the shared default of asc, this endpoint defaults to desc so the natural "most recent first" ordering is applied when the caller omits the param.

    Values are asc or desc. Default value is desc.

  • from_date string(date-time)

    Lower bound on created_at (inclusive). RFC3339 timestamp.

  • to_date string(date-time)

    Upper bound on created_at (exclusive). RFC3339 timestamp. Must be after from_date.

  • alertname array[string]

    Filter by alertname. Supports multiple values (OR within filter).

  • severity array[string]

    Filter by severity. Supports multiple values.

    Values are critical, warning, or info.

  • status array[string]

    Filter by status. Supports multiple values.

Responses

  • 200 application/json

    Alert history retrieved successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • alerts array[object]
        Hide alerts attributes Show alerts attributes object

        A single resolved or inactive alert stored from an Alertmanager webhook

        • id integer(int64)

          Auto-incrementing record ID

        • organization_id string

          Tenant the alert belongs to (logto_id of the owning org)

        • system_key string

          System key extracted from alert labels

        • alertname string

          Alert name from labels

        • severity string | null

          Severity from alert labels

        • status string

          Alert status at time of receipt

          Values are resolved or inactive.

        • fingerprint string

          Alertmanager fingerprint for the alert

        • starts_at string(date-time)

          When the alert started firing

        • ends_at string(date-time) | null

          When the alert resolved. Null when the end time is unknown.

        • summary string | null

          Human-readable summary from alert annotations

        • labels object

          All labels from the alert

          Hide labels attribute Show labels attribute object
          • * string Additional properties
        • annotations object

          All annotations from the alert

          Hide annotations attribute Show annotations attribute object
          • * string Additional properties
        • receiver string | null

          Alertmanager receiver that handled this alert

        • created_at string(date-time)

          When the record was created in the database

      • pagination object
        Hide pagination attributes Show pagination attributes object
        • page integer

          Current page number

          Minimum value is 1.

        • page_size integer

          Number of items per page

          Minimum value is 1, maximum value is 200.

        • total_count integer

          Total number of items

          Minimum value is 0.

        • total_pages integer

          Total number of pages

          Minimum value is 0.

        • has_next boolean

          Whether there is a next page

        • has_prev boolean

          Whether there is a previous page

        • next_page integer | null

          Next page number if available

        • prev_page integer | null

          Previous page number if available

        • sort_by string | null

          Field used for sorting

        • sort_direction string | null

          Sort direction

          Values are asc or desc.

  • 400 application/json

    Bad request - validation error

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 403 application/json

    Forbidden - insufficient permissions

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 404 application/json

    Resource not found

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

GET /systems/{id}/alerts/history
curl \
 --request GET 'https://api.your-domain.com/api/systems/sys_123456789/alerts/history' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
Records are scoped to the path system's `system_key`. The response is identical in shape to `GET /alerts/history` but filtered to one system without needing to pass it as a query param.
{
  "code": 200,
  "message": "alert history retrieved successfully",
  "data": {
    "alerts": [
      {
        "id": 55,
        "organization_id": "m4m3mdjdiizs",
        "system_key": "NETH-D417-A2C2-7810-43D2-984B-2164-34C1-B22E",
        "alertname": "PlainBodyTest",
        "severity": "critical",
        "status": "resolved",
        "fingerprint": "11a9302b0fa6526e",
        "starts_at": "2026-05-12T07:46:50Z",
        "ends_at": "2026-05-12T07:51:50Z",
        "summary": "plain body check",
        "labels": {
          "alertname": "PlainBodyTest",
          "severity": "critical",
          "system_key": "NETH-D417-A2C2-7810-43D2-984B-2164-34C1-B22E"
        },
        "annotations": {
          "summary": "plain body check",
          "description": "resolved"
        },
        "receiver": "severity-critical-receiver",
        "created_at": "2026-05-12T07:52:00Z"
      },
      {
        "id": 54,
        "organization_id": "m4m3mdjdiizs",
        "system_key": "NETH-D417-A2C2-7810-43D2-984B-2164-34C1-B22E",
        "alertname": "HistFlowTest",
        "severity": "critical",
        "status": "resolved",
        "fingerprint": "9c1a23e87f4d0a11",
        "starts_at": "2026-05-12T08:01:07Z",
        "ends_at": "2026-05-12T08:06:06Z",
        "summary": "history flow check",
        "labels": {
          "alertname": "HistFlowTest",
          "severity": "critical",
          "system_key": "NETH-D417-A2C2-7810-43D2-984B-2164-34C1-B22E"
        },
        "annotations": {
          "summary": "history flow check",
          "description": "resolved"
        },
        "receiver": "severity-critical-receiver",
        "created_at": "2026-05-12T08:11:30Z"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 50,
      "total_count": 2,
      "total_pages": 1,
      "has_next": false,
      "has_prev": false
    }
  }
}
{
  "code": 200,
  "message": "alert history retrieved successfully",
  "data": {
    "alerts": [],
    "pagination": {
      "page": 1,
      "page_size": 50,
      "total_count": 0,
      "total_pages": 0,
      "has_next": false,
      "has_prev": false
    }
  }
}
Response examples (400)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (403)
{
  "code": 403,
  "message": "insufficient permissions",
  "data": {}
}
Response examples (404)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}