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

# Update alert

> Replaces an alert with the supplied body. The full alert state must be sent (PUT semantics) so the metric/evaluation field-coupling rule can be enforced in one validation pass. To toggle a single field, GET the alert, mutate, and PUT.



## OpenAPI

````yaml /openapi.yaml put /v1/alerts/{alertId}
openapi: 3.0.3
info:
  contact:
    email: hello@agentmark.co
    url: https://docs.agentmark.co
  description: >-
    The AgentMark Gateway API lets you ingest traces, create scores, and
    retrieve prompt templates programmatically.


    Most developers should use the [AgentMark SDK](/introduction/overview) for
    integration.

    The REST API is for cases where you need direct HTTP access or are building
    a custom integration.


    Versioning: every endpoint is prefixed with `/v1/`. Breaking changes ship
    under a new version prefix (`/v2/`, etc.) with a 90-day-minimum deprecation
    window — see [API versioning & stability](/api-reference/versioning) for the
    full policy on what constitutes a breaking vs. additive change.
  title: AgentMark Gateway API
  version: '1.0'
servers:
  - description: Production (AgentMark Cloud)
    url: https://api.agentmark.co
  - description: Local dev server (`npx @agentmark-ai/cli dev`)
    url: http://localhost:9418
security:
  - AppId: []
    BearerAuth: []
tags:
  - description: Ingest, query, and export OpenTelemetry trace data.
    name: Traces
  - description: List and retrieve trace sessions.
    name: Sessions
  - description: Query individual spans across traces.
    name: Spans
  - description: Create, retrieve, list, and delete score records for spans and traces.
    name: Scoring
  - description: >-
      Structured-filter search across observability resources, plus the
      machine-readable filter schema.
    name: Search
  - description: Retrieve aggregated analytics metrics.
    name: Metrics
  - description: Retrieve the effective synced project configuration.
    name: Config
  - description: List and retrieve datasets.
    name: Datasets
  - description: List and retrieve experiment results.
    name: Experiments
  - description: List prompt files and look them up by frontmatter name.
    name: Prompts
  - description: List and retrieve individual runs within experiments.
    name: Runs
  - description: Query server feature availability.
    name: Capabilities
  - description: Retrieve prompt templates by path.
    name: Templates
  - description: Per-model LLM pricing data. Public, unauthenticated.
    name: Pricing
  - description: CRUD for annotation queues — lists, create, update, delete.
    name: Annotation Queues
  - description: >-
      Items enqueued for review + reviewer submissions. LLM-as-judge pipelines
      post through the reviews endpoint.
    name: Annotation Queue Items
  - description: >-
      Create, list, and revoke tenant API keys. Plaintext returned exactly once
      at creation.
    name: API Keys
  - description: >-
      List and retrieve score configuration definitions from the synced project
      config.
    name: Score Configs
  - description: >-
      Trigger and inspect managed deployments. POST returns 202; deployments run
      asynchronously and progress is observed via GET.
    name: Deployments
  - description: >-
      Per-app named environments (e.g. `dev`, `prod`). CRUD for env lifecycle;
      promote/rollback routes land alongside in this group as feature 054 lands
      the saga.
    name: Environments
  - description: >-
      Threshold-based monitors with Slack/webhook triggers. The agent
      provisioning use case is the primary design target.
    name: Alerts
  - description: >-
      App CRUD — the top-level tenant entity every other resource hangs off.
      Lets a headless agent provision an app without the dashboard.
    name: Apps
  - description: Service health checks.
    name: Health
paths:
  /v1/alerts/{alertId}:
    put:
      tags:
        - Alerts
      summary: Update alert
      description: >-
        Replaces an alert with the supplied body. The full alert state must be
        sent (PUT semantics) so the metric/evaluation field-coupling rule can be
        enforced in one validation pass. To toggle a single field, GET the
        alert, mutate, and PUT.
      operationId: update-alert
      parameters:
        - in: path
          name: alertId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                environment_id:
                  format: uuid
                  nullable: true
                  type: string
                evaluation_aggregation:
                  enum:
                    - avg
                    - individual
                  type: string
                evaluation_name:
                  maxLength: 255
                  minLength: 1
                  type: string
                evaluation_threshold_direction:
                  enum:
                    - above
                    - below
                  type: string
                metric:
                  enum:
                    - error_rate
                    - latency
                    - cost
                    - evaluation_score
                  type: string
                name:
                  maxLength: 100
                  minLength: 1
                  type: string
                threshold:
                  type: number
                time_window:
                  maximum: 100
                  minimum: 5
                  type: integer
                use_slack:
                  default: false
                  type: boolean
                use_webhook:
                  default: false
                  type: boolean
              required:
                - name
                - metric
                - threshold
                - time_window
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    properties:
                      app_id:
                        format: uuid
                        type: string
                      commit_sha:
                        nullable: true
                        type: string
                      created_at:
                        format: date-time
                        nullable: true
                        type: string
                      created_by:
                        nullable: true
                        type: string
                      environment_id:
                        format: uuid
                        nullable: true
                        type: string
                      evaluation_aggregation:
                        enum:
                          - avg
                          - individual
                          - null
                        nullable: true
                        type: string
                      evaluation_name:
                        nullable: true
                        type: string
                      evaluation_threshold_direction:
                        enum:
                          - above
                          - below
                          - null
                        nullable: true
                        type: string
                      id:
                        format: uuid
                        type: string
                      metric:
                        enum:
                          - error_rate
                          - latency
                          - cost
                          - evaluation_score
                        type: string
                      name:
                        type: string
                      status:
                        enum:
                          - triggered
                          - resolved
                        type: string
                      tenant_id:
                        format: uuid
                        type: string
                      threshold:
                        type: number
                      time_window:
                        type: integer
                      updated_at:
                        format: date-time
                        nullable: true
                        type: string
                      updated_by:
                        nullable: true
                        type: string
                      use_slack:
                        type: boolean
                      use_webhook:
                        type: boolean
                    required:
                      - id
                      - tenant_id
                      - app_id
                      - environment_id
                      - name
                      - metric
                      - threshold
                      - time_window
                      - status
                      - use_slack
                      - use_webhook
                      - evaluation_name
                      - evaluation_aggregation
                      - evaluation_threshold_direction
                      - commit_sha
                      - created_at
                      - created_by
                      - updated_at
                      - updated_by
                    type: object
                required:
                  - data
                type: object
          description: Alert updated.
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Invalid request body.
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Missing or invalid API key.
        '402':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - entitlement_required
                        type: string
                      current:
                        type: number
                      entitlement:
                        type: string
                      limit:
                        type: number
                      message:
                        type: string
                    required:
                      - code
                      - message
                      - entitlement
                    type: object
                required:
                  - error
                type: object
          description: Tenant tier does not include the 'alerts_enabled' feature.
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Caller lacks 'alert.update' permission.
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Alert not found.
        '409':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: An alert with this name already exists for the app.
components:
  securitySchemes:
    AppId:
      description: Application ID for tenant scoping
      in: header
      name: X-Agentmark-App-Id
      type: apiKey
    BearerAuth:
      description: API key (sk_agentmark_*)
      scheme: bearer
      type: http

````