GET /alerts/trend

Returns trend data for resolved alerts over a specified period with daily data points. Compares the current period with the previous period of equal length. Requires read:systems permission.

Query parameters

  • period integer

    Trend period in days

    Values are 7, 30, 180, or 365. Default value is 7.

Responses

  • 200 application/json

    Alert trend data

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • period integer
      • period_label string
      • current_total integer
      • previous_total integer
      • delta integer
      • delta_percentage number
      • trend string

        Values are up, down, or stable.

      • data_points array[object]
        Hide data_points attributes Show data_points attributes object
        • date string(date)
        • count integer
  • 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
GET /alerts/trend
curl \
 --request GET 'https://api.your-domain.com/api/alerts/trend' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "message": "alerts trend retrieved successfully",
  "data": {
    "period": 42,
    "period_label": "string",
    "current_total": 42,
    "previous_total": 42,
    "delta": 42,
    "delta_percentage": 42.0,
    "trend": "up",
    "data_points": [
      {
        "date": "2026-05-04",
        "count": 42
      }
    ]
  }
}
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": {}
}