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

# Update Alert Rule

> Update an alert rule.



## OpenAPI

````yaml https://api.getfloo.com/openapi.json patch /v1/apps/{app_id}/alerts/{alert_id}
openapi: 3.1.0
info:
  title: floo API
  version: 0.1.0
servers:
  - url: https://api.getfloo.com
security: []
paths:
  /v1/apps/{app_id}/alerts/{alert_id}:
    patch:
      tags:
        - alerts
      summary: Update Alert Rule
      description: Update an alert rule.
      operationId: alerts_update_alert_rule
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: App Id
        - name: alert_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Alert Id
        - $ref: '#/components/parameters/X-Floo-Org-Id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAlertRuleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertRuleResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    X-Floo-Org-Id:
      name: X-Floo-Org-Id
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: Organization to act in; defaults to the one joined most recently.
  schemas:
    UpdateAlertRuleRequest:
      properties:
        metric:
          anyOf:
            - $ref: '#/components/schemas/AlertMetric'
            - type: 'null'
        operator:
          anyOf:
            - $ref: '#/components/schemas/AlertOperator'
            - type: 'null'
        threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Threshold
        window_minutes:
          anyOf:
            - type: integer
              maximum: 1440
              minimum: 1
            - type: 'null'
          title: Window Minutes
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        cooldown_minutes:
          anyOf:
            - type: integer
              maximum: 1440
              minimum: 1
            - type: 'null'
          title: Cooldown Minutes
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
      type: object
      title: UpdateAlertRuleRequest
      description: Request body for updating an alert rule (all fields optional).
    AlertRuleResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        app_id:
          type: string
          format: uuid
          title: App Id
        metric:
          $ref: '#/components/schemas/AlertMetric'
        operator:
          $ref: '#/components/schemas/AlertOperator'
        threshold:
          type: number
          title: Threshold
        window_minutes:
          type: integer
          title: Window Minutes
        enabled:
          type: boolean
          title: Enabled
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        cooldown_minutes:
          type: integer
          title: Cooldown Minutes
        last_fired_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Fired At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - app_id
        - metric
        - operator
        - threshold
        - window_minutes
        - enabled
        - webhook_url
        - email
        - cooldown_minutes
        - last_fired_at
        - created_at
        - updated_at
      title: AlertRuleResponse
      description: Response schema for a single alert rule.
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Body of every error response except request validation (422).
    AlertMetric:
      type: string
      enum:
        - error_rate
        - latency_p95
        - request_count
      title: AlertMetric
      description: Metrics that can be monitored by alert rules.
    AlertOperator:
      type: string
      enum:
        - gt
        - lt
        - gte
        - lte
      title: AlertOperator
      description: Comparison operators for alert thresholds.
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
      additionalProperties: true
      type: object
      required:
        - code
        - message
      title: ErrorDetail
      description: Standard error envelope with operation-specific JSON context.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A `floo_` API key.

````

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