> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Criar alerta

> Cria um novo alerta



## OpenAPI

````yaml /pt-BR/_specs/hyperdx-openapi.json post /api/v2/alerts
openapi: 3.0.0
info:
  description: API para gerenciar alertas e dashboards do HyperDX
  title: HyperDX External API
  version: 2.0.0
servers:
  - description: Servidor de API de produção
    url: https://api.hyperdx.io
  - description: Servidor atual
    url: /
security:
  - BearerAuth: []
tags:
  - description: Endpoints para gerenciar dashboards e suas visualizações
    name: Dashboards
  - description: Endpoints para gerenciar alertas de monitoramento
    name: Alerts
paths:
  /api/v2/alerts:
    post:
      tags:
        - Alerts
      summary: Criar alerta
      description: Cria um novo alerta
      operationId: createAlert
      requestBody:
        content:
          application/json:
            examples:
              tileAlert:
                summary: Criar um alerta baseado em tile
                value:
                  channel:
                    type: webhook
                    webhookId: 65f5e4a3b9e77c001a789012
                  dashboardId: 65f5e4a3b9e77c001a567890
                  interval: 1h
                  message: Error rate has exceeded 100 in the last hour
                  name: Error Spike Alert
                  source: tile
                  threshold: 100
                  thresholdType: above
                  tileId: 65f5e4a3b9e77c001a901234
            schema:
              $ref: '#/components/schemas/CreateAlertRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertResponse'
          description: Alerta criado com sucesso
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Não autorizado
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Erro do servidor ou falha na validação
components:
  schemas:
    CreateAlertRequest:
      properties:
        channel:
          properties:
            type:
              example: webhook
              type: string
            webhookId:
              example: 65f5e4a3b9e77c001a789012
              type: string
          type: object
        dashboardId:
          example: 65f5e4a3b9e77c001a567890
          type: string
        interval:
          example: 1h
          type: string
        message:
          example: Test Alert Message
          type: string
        name:
          example: Test Alert
          type: string
        source:
          enum:
            - tile
            - search
          example: tile
          type: string
        threshold:
          example: 100
          type: number
        thresholdType:
          enum:
            - above
            - below
          example: above
          type: string
        tileId:
          example: 65f5e4a3b9e77c001a901234
          type: string
      required:
        - threshold
        - interval
        - source
        - thresholdType
        - channel
      type: object
    AlertResponse:
      properties:
        data:
          $ref: '#/components/schemas/Alert'
      type: object
    Error:
      properties:
        message:
          type: string
      type: object
    Alert:
      properties:
        channel:
          properties:
            type:
              example: webhook
              type: string
            webhookId:
              example: 65f5e4a3b9e77c001a789012
              type: string
          type: object
        createdAt:
          example: '2023-01-01T00:00:00.000Z'
          format: date-time
          type: string
        dashboard:
          example: 65f5e4a3b9e77c001a567890
          type: string
        groupBy:
          nullable: true
          type: string
        id:
          example: 65f5e4a3b9e77c001a123456
          type: string
        interval:
          example: 15m
          type: string
        message:
          example: Error rate exceeds threshold
          type: string
        name:
          example: High Error Rate
          type: string
        savedSearch:
          nullable: true
          type: string
        silenced:
          nullable: true
          type: boolean
        source:
          enum:
            - tile
            - search
          example: tile
          type: string
        state:
          example: inactive
          type: string
        team:
          example: 65f5e4a3b9e77c001a345678
          type: string
        threshold:
          example: 100
          type: number
        thresholdType:
          enum:
            - above
            - below
          example: above
          type: string
        tileId:
          example: 65f5e4a3b9e77c001a901234
          type: string
        updatedAt:
          example: '2023-01-01T00:00:00.000Z'
          format: date-time
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API Key
      scheme: bearer
      type: http

````