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

# Create Alert

> Create a new alert



## OpenAPI

````yaml /public-apis/openapi/alerts.json post /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:
    post:
      tags:
        - Alert
      summary: Create Alert
      description: Create a new alert
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspaceId:
                  type: string
                  description: Unique identifier for the workspace
                entityId:
                  type: string
                  description: ID of the entity to create alert for
                type:
                  type: string
                  enum:
                    - WORKFLOW
                    - WORKFLOW_SIMULATION
                    - PROMPT_CHAIN
                    - DATASET
                    - DATASET_SPLIT
                    - PROMPT
                    - DATASOURCE
                    - PROMPT_EXPERIMENT
                    - LOG_REPOSITORY
                    - PROMPT_TOOL
                    - EVALUATOR
                    - SDK
                    - TEST_RUN
                    - RUN_REPORT
                  description: Type of entity for the alert
                enabled:
                  type: boolean
                  default: true
                  description: Whether the alert is enabled
                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
                notificationChannelIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    List of notification channel IDs eg: ["channel_123",
                    "channel_456"]
              required:
                - workspaceId
                - entityId
                - type
                - config
      responses:
        '201':
          description: Alert created successfully
          content:
            application/json:
              schema:
                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
        '400':
          description: Invalid request parameters
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-maxim-api-key
      description: API key for authentication

````