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

# Update Alert

> Update an alert



## OpenAPI

````yaml /public-apis/openapi/alerts.json put /v1/alerts
openapi: 3.0.0
info:
  version: 1.0.0
  contact:
    name: Maxim Engineering
    email: eng@getmaxim.ai
  title: Maxim SDK API - alerts
  description: API documentation for Maxim SDK alerts endpoints
servers:
  - url: https://api.getmaxim.ai
security: []
paths:
  /v1/alerts:
    put:
      tags:
        - Alert
      summary: Update Alert
      description: Update an alert
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  minLength: 1
                  description: Unique identifier for the alert
                workspaceId:
                  type: string
                  minLength: 1
                  description: Unique identifier for the workspace
                type:
                  anyOf:
                    - type: string
                      enum:
                        - LOG_REPOSITORY
                    - type: string
                      enum:
                        - EVALUATOR
                  description: Type of entity for the alert
                  enum:
                    - LOG_REPOSITORY
                    - EVALUATOR
                config:
                  type: object
                  properties:
                    metric:
                      type: string
                      minLength: 1
                      description: Metric to monitor
                    duration:
                      type: number
                      minimum: 1
                      description: Duration in seconds
                    minimumThreshold:
                      type: number
                      minimum: 1
                      description: Minimum threshold for the alert
                    operator:
                      type: string
                      minLength: 1
                      description: Comparison operator for the alert condition
                    value:
                      type: string
                      minLength: 1
                      description: Value to compare against
                  required:
                    - metric
                    - duration
                    - minimumThreshold
                    - operator
                    - value
                  description: Alert configuration
                enabled:
                  type: boolean
                  description: Whether the alert is enabled
                notificationChannelIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    List of notification channel IDs eg: ["channel_123",
                    "channel_456"]
              required:
                - id
                - workspaceId
                - type
                - config
      responses:
        '200':
          description: Alert updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      workspaceId:
                        type: string
                      entityId:
                        type: string
                      type:
                        type: string
                      enabled:
                        type: boolean
                      config:
                        type: object
                        properties:
                          metric:
                            type: string
                            description: Metric to monitor
                          minimumThreshold:
                            type: number
                            minimum: 1
                            description: Minimum threshold for the alert
                          duration:
                            type: number
                            description: >-
                              Duration must be one of: 60, 300, 600, 1800, 3600
                              or 86400 (seconds)
                          operator:
                            type: string
                            description: Comparison operator for the alert condition
                          value:
                            type: string
                            description: Value to compare against
                          renotifyTTL:
                            type: number
                            default: -1
                            description: >-
                              Time to live for renotification in seconds. -1
                              means no TTL
                        required:
                          - metric
                          - minimumThreshold
                          - duration
                          - operator
                          - value
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      notificationChannels:
                        type: array
                        items:
                          type: object
                          properties:
                            notificationChannel:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: >-
                                    Unique identifier for the notification
                                    channel
                                type:
                                  type: string
                                  enum:
                                    - SLACK
                                    - PAGER_DUTY
                                  description: Type of notification channel.
                                name:
                                  type: string
                                  description: Name of the notification channel
                                config:
                                  type: object
                                  additionalProperties:
                                    nullable: true
                                  description: Channel-specific configuration
                              required:
                                - id
                                - type
                                - name
                                - config
                          required:
                            - notificationChannel
                    required:
                      - id
                      - workspaceId
                      - entityId
                      - type
                      - enabled
                      - config
                      - createdAt
                      - updatedAt
                required:
                  - data
        '400':
          description: Invalid request parameters
        '404':
          description: Alert not found
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-maxim-api-key
      description: API key for authentication

````