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

# Update an alert

> Updates alert metadata, query, condition, notifiers, or enabled state. Query and condition changes restart the evaluation schedule; disabling stops it. `project_id` is immutable.



## OpenAPI

````yaml patch /v2/alerts/{alert_id}
openapi: 3.1.0
info:
  title: orq.ai API
  version: '2.0'
  description: orq.ai API documentation
servers:
  - url: https://api.orq.ai
security:
  - ApiKey: []
tags:
  - description: List models available through the AI Router.
    name: Models
  - name: Guardrail Rules
  - name: Policies
  - name: Routing Rules
  - name: Activities
    description: Activity timeline entries for comments and entity versions.
  - name: Alerts
    description: >-
      Alerts evaluate a Reporting API metric on a fixed interval and fire
      notifications through notifiers when the value breaches a threshold. Each
      breach opens a trigger that tracks the incident until the value recovers.
  - name: API keys
    description: >-
      API keys authenticate programmatic access to the workspace. The unified
      key model exposes opaque tokens, per-domain access grants, and budget /
      rate-limit constraints (see ADR 0001 and ADR 0002).
  - name: Budgets
    description: >-
      Budgets govern spend, token usage, and request rate across six scopes:
      workspace, project, identity, api-key, provider, and model. A budget is
      hierarchical and defense-in-depth — every applicable budget is a hard
      gate, and the most restrictive one wins per dimension (see ADR 0007).
  - name: Documentation
    description: >-
      Search the orq.ai documentation. Proxies the workspace's query to the
      hosted docs search index.
  - name: FeaturePreviews
    description: >-
      Internal: list and toggle per-user feature previews (beta features users
      can opt into).
  - name: Files
    description: File upload and retrieval operations.
  - name: Finder
    description: >-
      Finder entities back the studio navigation tree, project switcher, and
      cross-project resource references.
  - name: Identities
    description: >-
      Identities represent end users from your system for usage and engagement
      tracking.
  - name: Management keys
    description: >-
      Management keys are workspace-scoped credentials that authenticate
      programmatic access to workspace administration surfaces (API keys,
      budgets). Unlike project-scoped API keys, a management key always operates
      at the workspace level.
  - name: MCP Gateway
    description: >-
      Manage upstream MCP servers and client-facing MCP gateways. Create server
      connections, discover tools, assemble gateways, and review call logs.
  - name: Model Sharing
    description: >-
      Model sharing controls which projects a workspace model is available to.
      Workspace admins configure a model's Sharing (all projects / selected
      projects); the config ships inline on the models list response, so there
      is no separate read endpoint.
  - name: Notifiers
    description: Notifier destinations used to send delivery and workflow notifications.
  - name: People
    description: >-
      People are workspace members and invited users. Manage roles, groups, and
      invitations for your team.
  - name: Projects
    description: Projects organize resources within a workspace
  - name: Skills
    description: >-
      Skills are modular instructions you can use to codify processes and
      conventions
  - name: Smart Routers
    description: >-
      Smart Routers distribute an ordered pool of eligible language models
      across V2 routing bands.
  - name: Webhooks
    description: >-
      Create and manage webhooks that deliver workspace events to external HTTPS
      endpoints.
  - name: Workspace Settings
    description: >-
      Workspace-level settings managed with a workspace credential. A workspace
      is the tenant, so these settings are a singleton — there is nothing to
      create or delete, only read and update.
  - name: Responses
  - description: >-
      Run agents on a cadence — cron, interval, or one-off. Minimum firing
      interval is 1 hour.
    name: Agent Schedules
  - name: Embeddings
  - name: Logs
    description: >-
      OpenTelemetry log query API. Search, filter, aggregate, and facet log
      records ingested via OTLP.
  - name: Reporting
    description: >-
      GenAI reporting API over canonical analytics rollups. Accepts a metric
      name, time range, grain, group-by, and filters; returns a typed time
      series and optional totals.
  - name: Traces
    description: >-
      Query and inspect ingested trace data: search trace summaries, aggregate
      metrics, and read individual traces and their spans.
externalDocs:
  url: https://docs.orq.ai
  description: orq.ai Documentation
paths:
  /v2/alerts/{alert_id}:
    patch:
      tags:
        - Alerts
      summary: Update an alert
      description: >-
        Updates alert metadata, query, condition, notifiers, or enabled state.
        Query and condition changes restart the evaluation schedule; disabling
        stops it. `project_id` is immutable.
      operationId: AlertUpdate
      parameters:
        - name: alert_id
          in: path
          description: Alert ID to update.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAlertRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateAlertResponse'
components:
  schemas:
    UpdateAlertRequest:
      required: []
      type: object
      properties:
        display_name:
          type: string
          description: New workspace-unique display name. Omit to keep the current name.
        description:
          type: string
          description: New description. Omit to keep the current description.
        signal:
          type: string
          description: New UI signal preset. Omit to keep the current value.
        query:
          allOf:
            - $ref: '#/components/schemas/AlertQuery'
          description: Replacement query. Omit to keep the current query.
        condition:
          allOf:
            - $ref: '#/components/schemas/AlertCondition'
          description: Replacement condition. Omit to keep the current condition.
        notifier_ids:
          type: array
          items:
            type: string
          description: Replacement notifier set. Omit to keep the current notifiers.
        enabled:
          type: boolean
          description: New enabled state. Omit to keep the current state.
    UpdateAlertResponse:
      required:
        - alert
      type: object
      properties:
        alert:
          allOf:
            - $ref: '#/components/schemas/Alert'
          description: Updated alert.
    AlertQuery:
      required:
        - metric
      type: object
      properties:
        metric:
          type: string
          description: |-
            Reporting API catalogue metric, e.g. `genai.cost` or
             `genai.latency.avg`. Validated against the catalogue when the alert
             is saved.
        filters:
          type: array
          items:
            $ref: '#/components/schemas/MonitorFilter'
          description: Reporting filters combined with AND.
    AlertCondition:
      required:
        - comparator
        - threshold
        - window
        - interval
      type: object
      properties:
        comparator:
          enum:
            - gt
            - gte
            - lt
            - lte
            - eq
          type: string
          description: Comparison applied as `value <comparator> threshold`.
        threshold:
          type: number
          description: |-
            Critical-tier threshold. Breaching it opens (or escalates) a
             trigger at critical severity.
          format: double
        degraded_threshold:
          type: number
          description: |-
            Optional degraded-tier threshold. Values past it but short of
             `threshold` open a trigger at degraded severity. Must sit on the
             recovery side of `threshold` for the chosen comparator and is not
             supported with `eq`.
          format: double
        resolve_threshold:
          type: number
          description: |-
            Optional custom resolve bound (hysteresis). An open trigger
             resolves only once the value recovers past this bound; defaults to
             the lowest configured tier. Must sit at or past that tier on the
             recovery side. Not supported with `eq`.
          format: double
        window:
          enum:
            - 5m
            - 15m
            - 30m
            - 1h
            - 4h
            - 1d
          type: string
          description: Look-back window aggregated on each evaluation tick.
        interval:
          enum:
            - 30s
            - 5m
            - 15m
            - 1h
            - 1d
          type: string
          description: How often the alert is evaluated. `30s` is a testing cadence.
        delay:
          enum:
            - 30s
            - 60s
            - 120s
            - 300s
            - 600s
          type: string
          description: >-
            Ingestion delay subtracted from the evaluation window. Defaults to
            `120s`.
    Alert:
      required:
        - alert_id
        - display_name
        - description
        - project_id
        - signal
        - query
        - condition
        - notifier_ids
        - enabled
        - status
        - created_at
        - updated_at
        - created_by_id
        - updated_by_id
      type: object
      properties:
        alert_id:
          type: string
          description: |-
            Unique alert identifier assigned by ORQ, for example `alert_01H...`.
             Use this value in retrieve, update, and delete requests.
        display_name:
          type: string
          description: Workspace-unique display name.
        description:
          type: string
          description: Short human-readable summary of what the alert watches.
        project_id:
          type: string
          description: Project that owns the alert. Immutable after creation.
        signal:
          enum:
            - cost
            - latency
            - errors
            - evals
            - custom
          type: string
          description: UI signal preset the alert was created from.
        query:
          allOf:
            - $ref: '#/components/schemas/AlertQuery'
          description: Metric query evaluated on each tick.
        condition:
          allOf:
            - $ref: '#/components/schemas/AlertCondition'
          description: Threshold condition applied to the query result.
        notifier_ids:
          type: array
          items:
            type: string
          description: |-
            Notifiers that receive trigger-open and trigger-resolve
             notifications.
        enabled:
          type: boolean
          description: |-
            Whether the alert is evaluated. Disabled alerts keep their trigger
             history but stop firing.
        status:
          enum:
            - ok
            - degraded
            - triggered
          type: string
          description: Current runtime status, maintained by the evaluation engine.
        last_triggered_at:
          type: string
          description: Time when the alert last opened a trigger.
          format: date-time
        recent_runs:
          type: array
          items:
            $ref: '#/components/schemas/AlertRun'
          description: |-
            Rolling window of the most recent evaluation ticks, oldest first.
             Maintained by the evaluation engine; read-only.
        created_at:
          type: string
          description: Time when the alert was created.
          format: date-time
        updated_at:
          type: string
          description: Time when the alert was last updated.
          format: date-time
        created_by_id:
          type: string
          description: User ID that created the alert.
        updated_by_id:
          type: string
          description: User ID that last updated the alert.
    MonitorFilter:
      required:
        - field
        - op
        - values
      type: object
      properties:
        field:
          type: string
          description: |-
            Reporting dimension to filter on. Valid fields depend on the
             metric; validated when the monitor is saved.
        op:
          enum:
            - eq
            - neq
            - in
            - not_in
          type: string
          description: >-
            Predicate operator. `eq` and `neq` accept exactly one value; `in`
            and `not_in` accept 1-100 values.
        values:
          type: array
          items:
            type: string
          description: Values compared against the selected field.
    AlertRun:
      required:
        - at
        - value
        - breached
        - has_data
      type: object
      properties:
        at:
          type: string
          description: Time of the evaluation tick.
          format: date-time
        value:
          type: number
          description: Observed metric value. Zero when `has_data` is false.
          format: double
        breached:
          type: boolean
          description: Whether the value breached the alert condition.
        has_data:
          type: boolean
          description: Whether the evaluation window contained any data.
        severity:
          enum:
            - critical
            - degraded
          type: string
          description: Tier the value landed in when breached. Empty when not breached.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````