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

# Get Alerts

> Get alerts for a workspace



## OpenAPI

````yaml /public-apis/openapi/alerts.json get /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:
    get:
      tags:
        - Alert
      summary: Get Alerts
      description: Get alerts for a workspace
      parameters:
        - schema:
            type: string
            description: Unique identifier for the alert
          required: false
          name: id
          in: query
        - schema:
            type: string
            minLength: 1
            description: Unique identifier for the workspace
          required: true
          name: workspaceId
          in: query
        - schema:
            type: string
            description: ID of the entity associated with the alert
          required: true
          name: entityId
          in: query
        - schema:
            type: number
            nullable: true
            maximum: 100
            default: 20
            description: 'Maximum number of records to return (max: 100)'
          required: false
          name: limit
          in: query
        - schema:
            type: string
            nullable: true
            description: Cursor for pagination
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: Alerts retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      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
                  pagination:
                    type: object
                    properties:
                      cursor:
                        type: string
                        nullable: true
                      hasMore:
                        type: boolean
                    required:
                      - cursor
                      - hasMore
                required:
                  - data
                  - pagination
        '400':
          description: Invalid request parameters
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-maxim-api-key
      description: API key for authentication

````