> ## 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
          description: The metric family the rule watches
          example: metricGroup_123
        metricId:
          type: string
          description: The metric revision the check counted
          example: metric_123
        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. Null when the alert is closed, its rule was deleted, or
            its rule's metric family, 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'
          discriminator:
            propertyName: type
            mapping:
              BAD_SESSION_COUNT: '#/components/schemas/MonitorAlertBadSessionCountObservation'
          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
        - samplingPercentage
        - threshold
        - clearValue
        - observation
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
    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
          example: 12
        scoredSessionCount:
          type: integer
          description: Scored sessions in the window
          example: 240
      required:
        - type
        - badSessionScore
        - badSessionCount
        - scoredSessionCount
  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.