> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List a monitor's alerts

> Returns the alerts the rules of this monitor opened, open alerts first, then the newest opened. Alerts of a deleted rule are included.



## OpenAPI

````yaml https://api.galtea.ai/openapi.json get /monitors/{monitorId}/alerts
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /monitors/{monitorId}/alerts:
    get:
      tags:
        - monitors
      summary: List a monitor's alerts
      description: >-
        Returns the alerts the rules of this monitor opened, open alerts first,
        then the newest opened. Alerts of a deleted rule are included.
      operationId: getMonitorAlerts
      parameters:
        - schema:
            type: string
            description: Monitor ID
            example: monitor_123
          required: true
          description: Monitor ID
          name: monitorId
          in: path
        - schema:
            type: string
            enum:
              - OPEN
              - CLOSED
            description: Only open or only closed alerts
            example: OPEN
          required: false
          description: Only open or only closed alerts
          name: state
          in: query
        - schema:
            type: array
            items:
              type: string
            description: Only alerts opened by these rules
          required: false
          description: Only alerts opened by these rules
          style: form
          explode: true
          name: ruleIds
          in: query
        - schema:
            type: string
            format: date-time
            description: Only alerts still open at or after this time (ISO 8601)
          required: false
          description: Only alerts still open at or after this time (ISO 8601)
          name: from
          in: query
        - schema:
            type: string
            format: date-time
            description: Only alerts opened at or before this time (ISO 8601)
          required: false
          description: Only alerts opened at or before this time (ISO 8601)
          name: to
          in: query
        - schema:
            type: integer
            minimum: 0
            maximum: 1000
            default: 100
            description: Maximum number of results
          required: false
          description: Maximum number of results
          name: limit
          in: query
        - schema:
            type: integer
            minimum: 0
            default: 0
            description: Number of results to skip
          required: false
          description: Number of results to skip
          name: offset
          in: query
      responses:
        '200':
          description: Alerts retrieved successfully
          headers:
            Content-Range:
              schema:
                type: string
                description: Pagination range as `alerts <offset>-<upperBound>/<total>`.
              required: true
              description: Pagination range as `alerts <offset>-<upperBound>/<total>`.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MonitorAlert'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    MonitorAlert:
      type: object
      properties:
        id:
          type: string
          example: monitorAlert_123
        monitorId:
          type: string
          example: monitor_123
        ruleId:
          type: string
          example: monitorAlertRule_123
        ruleDeletedAt:
          type: string
          nullable: true
          format: date-time
          description: Set when the rule that opened the alert was deleted
        state:
          type: string
          enum:
            - OPEN
            - CLOSED
          example: OPEN
        openedAt:
          type: string
          format: date-time
        closedAt:
          type: string
          format: date-time
          nullable: true
        closeReason:
          type: string
          nullable: true
          enum:
            - RECOVERED
            - RULE_DELETED
            - RULE_EDITED
            - RULE_PAUSED
            - null
          example: null
        window:
          type: string
          enum:
            - FIFTEEN_MINUTES
            - ONE_HOUR
            - SIX_HOURS
            - TWENTY_FOUR_HOURS
          example: ONE_HOUR
        windowStart:
          type: string
          format: date-time
          description: Start of the window the check counted when the alert opened
        windowEnd:
          type: string
          format: date-time
          description: End of that window
        metricGroupId:
          type: string
          nullable: true
          description: >-
            The metric family the rule watches; null for an alert on a
            Specification
          example: metricGroup_123
        metricId:
          type: string
          nullable: true
          description: >-
            The metric revision the check counted; null for an alert on a
            Specification
          example: metric_123
        specificationId:
          type: string
          nullable: true
          description: >-
            The Specification the rule watches; null for an alert on a metric
            family
          example: null
        specificationName:
          type: string
          nullable: true
          description: >-
            The name of the Specification the rule watches, also when it was
            deleted since; null for an alert on a metric family
          example: Refunds follow the 30-day policy
        families:
          type: array
          items:
            $ref: '#/components/schemas/MonitorAlertFamily'
          description: >-
            The metric families the check measured when the alert opened, most
            failures first, at most 50. A Specification alert counts a session
            once when it fails any of them. Empty for a metric alert opened
            before Specification alert rules existed.
        samplingPercentage:
          type: number
          nullable: true
          description: The monitor's sampling rate
          example: 5
        threshold:
          type: number
          description: The threshold that opened the alert
          example: 10
        clearValue:
          type: number
          nullable: true
          description: >-
            The value at which an open alert closes, from the rule's current
            settings. A NO_SCORE_RATE alert also needs at least 5 settled
            sessions in the window to close. Null when the alert is closed, its
            rule was deleted, or its rule's target, window or bad session score
            changed. After a threshold-only edit it holds the new clear value.
          example: 6
        observation:
          oneOf:
            - $ref: '#/components/schemas/MonitorAlertBadSessionCountObservation'
            - $ref: '#/components/schemas/MonitorAlertNoScoreRateObservation'
          discriminator:
            propertyName: type
            mapping:
              BAD_SESSION_COUNT: '#/components/schemas/MonitorAlertBadSessionCountObservation'
              NO_SCORE_RATE: '#/components/schemas/MonitorAlertNoScoreRateObservation'
          description: >-
            What the check saw when the alert opened. The fields depend on the
            rule type.
      required:
        - id
        - monitorId
        - ruleId
        - ruleDeletedAt
        - state
        - openedAt
        - closedAt
        - closeReason
        - window
        - windowStart
        - windowEnd
        - metricGroupId
        - metricId
        - specificationId
        - specificationName
        - families
        - samplingPercentage
        - threshold
        - clearValue
        - observation
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
    MonitorAlertFamily:
      type: object
      properties:
        metricGroupId:
          type: string
          description: The metric family
          example: metricGroup_123
        metricId:
          type: string
          description: The newest metric revision of the family the check counted
          example: metric_123
        sampleSize:
          type: integer
          description: Sessions the check counted for this family in the window
          example: 40
        matchCount:
          type: integer
          description: >-
            Of those sessions, the ones that failed this family. A family with 0
            is not a cause of the alert.
          example: 5
      required:
        - metricGroupId
        - metricId
        - sampleSize
        - matchCount
    MonitorAlertBadSessionCountObservation:
      type: object
      properties:
        type:
          type: string
          enum:
            - BAD_SESSION_COUNT
        badSessionScore:
          type: number
          description: A session counted as bad at or below this score
          example: 0.5
        badSessionCount:
          type: integer
          description: >-
            Bad sessions in the window. An unreviewed not-applicable skip is
            left out.
          example: 12
        scoredSessionCount:
          type: integer
          description: >-
            Scored sessions in the window. An unreviewed not-applicable skip is
            left out.
          example: 240
      required:
        - type
        - badSessionScore
        - badSessionCount
        - scoredSessionCount
    MonitorAlertNoScoreRateObservation:
      type: object
      properties:
        type:
          type: string
          enum:
            - NO_SCORE_RATE
        noScoreRate:
          type: number
          description: Percent of the settled sessions in the window that produced no score
          example: 100
        noScoreSessionCount:
          type: integer
          description: >-
            Settled sessions in the window that produced no score. An unreviewed
            not-applicable skip is left out.
          example: 6
        settledSessionCount:
          type: integer
          description: >-
            Settled sessions in the window (a score, or FAILED or SKIPPED). An
            unreviewed not-applicable skip is left out.
          example: 6
      required:
        - type
        - noScoreRate
        - noScoreSessionCount
        - settledSessionCount
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.