> ## 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.

# Get a monitor alert rule

> Returns one alert rule. 404 for a rule id belonging to another monitor or already deleted.



## OpenAPI

````yaml https://api.galtea.ai/openapi.json get /monitors/{monitorId}/alert-rules/{alertRuleId}
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}/alert-rules/{alertRuleId}:
    get:
      tags:
        - monitors
      summary: Get a monitor alert rule
      description: >-
        Returns one alert rule. 404 for a rule id belonging to another monitor
        or already deleted.
      operationId: getMonitorAlertRule
      parameters:
        - schema:
            type: string
            description: Monitor ID
            example: monitor_123
          required: true
          description: Monitor ID
          name: monitorId
          in: path
        - schema:
            type: string
            description: Alert rule ID
            example: monitorAlertRule_123
          required: true
          description: Alert rule ID
          name: alertRuleId
          in: path
      responses:
        '200':
          description: Alert rule retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorAlertRule'
        '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:
    MonitorAlertRule:
      type: object
      properties:
        id:
          type: string
          example: monitorAlertRule_123
        monitorId:
          type: string
          example: monitor_123
        type:
          type: string
          enum:
            - BAD_SESSION_COUNT
            - NO_SCORE_RATE
            - AVERAGE_SCORE
          example: BAD_SESSION_COUNT
        metricGroupId:
          type: string
          nullable: true
          description: >-
            The metric family the rule watches; null for a rule that watches a
            Specification
          example: metricGroup_123
        specificationId:
          type: string
          nullable: true
          description: >-
            The Specification the rule watches; null for a rule that watches a
            metric family
          example: null
        window:
          type: string
          enum:
            - FIFTEEN_MINUTES
            - ONE_HOUR
            - SIX_HOURS
            - TWENTY_FOUR_HOURS
          example: ONE_HOUR
        badSessionScore:
          type: number
          nullable: true
          example: 0.5
        threshold:
          type: number
          example: 3
        recipients:
          type: array
          items:
            type: string
          example:
            - team@example.com
        webhookUrlHost:
          type: string
          nullable: true
          description: >-
            The host and port of the webhook URL, such as hooks.slack.com or
            hooks.example.com:8443 (the port shows only when it is not the
            default); null when the rule has none. The URL is never returned.
          example: hooks.slack.com
        userId:
          type: string
          nullable: true
          example: user_123
        createdAt:
          type: string
          format: date-time
        pausedAt:
          type: string
          nullable: true
          format: date-time
          description: When the rule was paused; null while it is active
          example: null
        readiness:
          type: object
          nullable: true
          properties:
            settledSessions:
              type: integer
              description: >-
                Settled sessions in the rule's current window. An unreviewed
                not-applicable skip is left out.
              example: 3
            requiredSessions:
              type: integer
              description: >-
                The minimum the window needs before the rule opens or closes an
                alert
              example: 5
            isEvaluating:
              type: boolean
              description: >-
                Whether the window holds enough settled sessions for the rule to
                open or close an alert
              example: false
          required:
            - settledSessions
            - requiredSessions
            - isEvaluating
          description: >-
            How close the rule is to deciding. Null for a rule whose window is
            never too small (BAD_SESSION_COUNT), and when the count could not be
            read right now. While isEvaluating is false, the rule opens and
            closes nothing. isEvaluating is also false while the rule is paused.
      required:
        - id
        - monitorId
        - type
        - metricGroupId
        - specificationId
        - window
        - badSessionScore
        - threshold
        - recipients
        - webhookUrlHost
        - userId
        - createdAt
        - pausedAt
        - readiness
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  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.