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

# Edit a monitor (partial update)

> **Security Requirements**

| Auth Types | Entities | Permissions | Required Roles |
|------------|----------|-------------|----------------|
| USER | AUDIT | WRITE | AUDIT:WRITE |



## OpenAPI

````yaml /openapi/swarmd.json patch /audit/v1/monitors/{monitorId}
openapi: 3.1.0
info:
  title: Relay
  version: v0
servers:
  - url: https://api.dev.swarmd.ai
    description: Development
security: []
tags:
  - name: Policy Groups
    x-displayName: Policy Groups
  - name: Policy Bindings
    x-displayName: Policy Bindings
  - name: Evaluation Packs
    x-displayName: Evaluation Packs
  - name: Webhooks
    x-displayName: Webhooks
  - name: MCP JSON-RPC
    x-displayName: MCP JSON-RPC
  - name: Conversations
    x-displayName: Conversations
  - name: Human JSON-RPC
    x-displayName: Human JSON-RPC
  - name: Channel JSON-RPC
    x-displayName: Channel JSON-RPC
  - name: HITL Approvals
    x-displayName: HITL Approvals
  - name: Agent JSON-RPC
    x-displayName: Agent JSON-RPC
  - name: Tasks
    x-displayName: Tasks
  - name: Push Notifications
    x-displayName: Push Notifications
  - name: Messaging
    x-displayName: Messaging
  - name: LLM Runtime
    x-displayName: LLM Runtime
  - name: Agent Discovery
    x-displayName: Agent Discovery
  - name: MCP Servers
    x-displayName: MCP Servers
  - name: LLM Gateways
    x-displayName: LLM Gateways
  - name: Agents
    x-displayName: Agents
  - name: User Subscriptions
    x-displayName: User Subscriptions
  - name: LLM Providers
    x-displayName: LLM Providers
  - name: LLM Gateway Subscriptions
    x-displayName: LLM Gateway Subscriptions
  - name: Kill Switches
    x-displayName: Kill Switches
  - name: Channels
    x-displayName: Channels
  - name: Channel Subscriptions
    x-displayName: Channel Subscriptions
  - name: Agent Subscriptions
    x-displayName: Agent Subscriptions
  - name: Marketplace
    x-displayName: Marketplace
  - name: Identity Providers
    x-displayName: Identity Providers
  - name: Groups
    x-displayName: Groups
  - name: Authentication
    x-displayName: Authentication
  - name: Users
    x-displayName: Users
  - name: Tenants
    x-displayName: Tenants
  - name: mcp-consent-controller
    x-displayName: mcp-consent-controller
  - name: Audit Monitors
    x-displayName: Audit Monitors
  - name: Audit Integrity
    x-displayName: Audit Integrity
  - name: Audit Events
    x-displayName: Audit Events
  - name: Audit Traces
    x-displayName: Audit Traces
  - name: audit-rest-controller
    x-displayName: audit-rest-controller
  - name: Audit Dashboard
    x-displayName: Audit Dashboard
  - name: A2A Payments
    x-displayName: A2A Payments
paths:
  /audit/v1/monitors/{monitorId}:
    patch:
      tags:
        - Audit Monitors
      summary: Edit a monitor (partial update)
      description: |-
        **Security Requirements**

        | Auth Types | Entities | Permissions | Required Roles |
        |------------|----------|-------------|----------------|
        | USER | AUDIT | WRITE | AUDIT:WRITE |
      operationId: editMonitor
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Audit_MonitorEditRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Audit_MonitorDetail'
      security:
        - Audit_bearerAuth: []
components:
  schemas:
    Audit_MonitorEditRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
        owner:
          type: string
        priority:
          type: string
          enum:
            - P1
            - P2
            - P3
            - P4
            - P5
        sensitivity:
          type: string
          enum:
            - LOW
            - MEDIUM
            - HIGH
        enabled:
          type: boolean
        messageTemplate:
          type: string
        queryConfig:
          oneOf:
            - $ref: '#/components/schemas/Audit_Change'
            - $ref: '#/components/schemas/Audit_Outlier'
            - $ref: '#/components/schemas/Audit_Threshold'
        channelIds:
          type: array
          items:
            type: string
            format: uuid
        debounceSeconds:
          type: integer
          format: int32
        changeReason:
          type: string
    Audit_MonitorDetail:
      type: object
      properties:
        id:
          type: string
          format: uuid
        tenantId:
          type: string
          format: uuid
        monitorType:
          type: string
          enum:
            - SYSTEM_TEMPLATE
            - THRESHOLD
            - CHANGE
            - OUTLIER
        templateId:
          type: string
          enum:
            - POLICY_INVOCATION_ANOMALY
            - POLICY_BLOCK_ANOMALY
            - POLICY_WARN_ANOMALY
            - POLICY_HITL_HOLD_ANOMALY
            - AGENT_VOLUME_ANOMALY
            - USER_VOLUME_ANOMALY
            - MCP_SERVER_VOLUME_ANOMALY
            - LLM_GATEWAY_VOLUME_ANOMALY
            - CHANNEL_VOLUME_ANOMALY
            - TENANT_ERROR_SPIKE
            - TENANT_WARN_SPIKE
            - TENANT_HITL_SPIKE
            - LLM_PROVIDER_ERROR_RATE_SPIKE
            - LLM_GATEWAY_FAILOVER_SPIKE
            - MCP_SERVER_ERROR_RATE_SPIKE
            - DORMANT_AGENT_REACTIVATION
            - DORMANT_USER_REACTIVATION
            - NOVEL_TOOL_CALL
            - NEW_MCP_SERVER_BINDING
        name:
          type: string
        description:
          type: string
        tags:
          type: array
          items:
            type: string
        owner:
          type: string
        ownerLabel:
          type: string
        priority:
          type: string
          enum:
            - P1
            - P2
            - P3
            - P4
            - P5
        sensitivity:
          type: string
          enum:
            - LOW
            - MEDIUM
            - HIGH
        enabled:
          type: boolean
        state:
          type: string
          enum:
            - OK
            - ALERT
            - WARN
            - NO_DATA
            - MUTED
        coverageStatus:
          type: string
          enum:
            - HEALTHY
            - FAILED
            - STALE
            - NEVER_RUN
            - DISABLED
            - RUNNING
        lastEvaluatedAt:
          type: string
          format: date-time
        messageTemplate:
          type: string
        runbookSlug:
          type: string
        category:
          type: string
          enum:
            - BEHAVIORAL
            - STATISTICAL
            - INFRA
        queryConfig:
          oneOf:
            - $ref: '#/components/schemas/Audit_Change'
            - $ref: '#/components/schemas/Audit_Outlier'
            - $ref: '#/components/schemas/Audit_Threshold'
        createdBy:
          type: string
          format: uuid
        currentMute:
          $ref: '#/components/schemas/Audit_MonitorMuteState'
        scheduledDowntimes:
          type: array
          items:
            $ref: '#/components/schemas/Audit_MonitorDowntime'
        latestRevisionVersion:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        lastAlertAt:
          type: string
          format: date-time
        alertCount24h:
          type: integer
          format: int64
        channelIds:
          type: array
          items:
            type: string
            format: uuid
        debounceSeconds:
          type: integer
          format: int32
    Audit_Change:
      allOf:
        - $ref: '#/components/schemas/Audit_MonitorQueryConfig'
        - type: object
          properties:
            metric:
              type: string
              enum:
                - REQUESTS
                - BLOCKS
                - WARNS
                - MASKS
                - HITL_HOLDS
                - ERRORS
                - ERROR_RATE_PCT
                - LATENCY_AVG_MS
                - LATENCY_P50_MS
                - LATENCY_P95_MS
                - LATENCY_P99_MS
                - LLM_CALLS
                - LLM_FAILOVERS
                - TOOL_CALLS
                - MCP_REQUESTS
                - USER_DISTINCT
                - AGENT_DISTINCT
            aggregation:
              type: string
              enum:
                - SUM
                - AVG
                - MIN
                - MAX
                - P50
                - P95
                - P99
                - COUNT
                - COUNT_DISTINCT
                - RATE_PER_MIN
            window:
              type: string
              enum:
                - LAST_5M
                - LAST_15M
                - LAST_1H
                - LAST_4H
                - LAST_24H
                - LAST_7D
            groupBy:
              type: string
              enum:
                - NONE
                - AGENT
                - USER
                - MCP_SERVER
                - LLM_GATEWAY
                - LLM_PROVIDER
                - CHANNEL
                - POLICY
            filters:
              type: array
              items:
                $ref: '#/components/schemas/Audit_MonitorFilter'
            direction:
              type: string
              enum:
                - SPIKE
                - DROP
                - EITHER
            warningPercentChange:
              type: number
            criticalPercentChange:
              type: number
    Audit_Outlier:
      allOf:
        - $ref: '#/components/schemas/Audit_MonitorQueryConfig'
        - type: object
          properties:
            metric:
              type: string
              enum:
                - REQUESTS
                - BLOCKS
                - WARNS
                - MASKS
                - HITL_HOLDS
                - ERRORS
                - ERROR_RATE_PCT
                - LATENCY_AVG_MS
                - LATENCY_P50_MS
                - LATENCY_P95_MS
                - LATENCY_P99_MS
                - LLM_CALLS
                - LLM_FAILOVERS
                - TOOL_CALLS
                - MCP_REQUESTS
                - USER_DISTINCT
                - AGENT_DISTINCT
            aggregation:
              type: string
              enum:
                - SUM
                - AVG
                - MIN
                - MAX
                - P50
                - P95
                - P99
                - COUNT
                - COUNT_DISTINCT
                - RATE_PER_MIN
            window:
              type: string
              enum:
                - LAST_5M
                - LAST_15M
                - LAST_1H
                - LAST_4H
                - LAST_24H
                - LAST_7D
            groupBy:
              type: string
              enum:
                - NONE
                - AGENT
                - USER
                - MCP_SERVER
                - LLM_GATEWAY
                - LLM_PROVIDER
                - CHANNEL
                - POLICY
            filters:
              type: array
              items:
                $ref: '#/components/schemas/Audit_MonitorFilter'
    Audit_Threshold:
      allOf:
        - $ref: '#/components/schemas/Audit_MonitorQueryConfig'
        - type: object
          properties:
            metric:
              type: string
              enum:
                - REQUESTS
                - BLOCKS
                - WARNS
                - MASKS
                - HITL_HOLDS
                - ERRORS
                - ERROR_RATE_PCT
                - LATENCY_AVG_MS
                - LATENCY_P50_MS
                - LATENCY_P95_MS
                - LATENCY_P99_MS
                - LLM_CALLS
                - LLM_FAILOVERS
                - TOOL_CALLS
                - MCP_REQUESTS
                - USER_DISTINCT
                - AGENT_DISTINCT
            aggregation:
              type: string
              enum:
                - SUM
                - AVG
                - MIN
                - MAX
                - P50
                - P95
                - P99
                - COUNT
                - COUNT_DISTINCT
                - RATE_PER_MIN
            window:
              type: string
              enum:
                - LAST_5M
                - LAST_15M
                - LAST_1H
                - LAST_4H
                - LAST_24H
                - LAST_7D
            groupBy:
              type: string
              enum:
                - NONE
                - AGENT
                - USER
                - MCP_SERVER
                - LLM_GATEWAY
                - LLM_PROVIDER
                - CHANNEL
                - POLICY
            filters:
              type: array
              items:
                $ref: '#/components/schemas/Audit_MonitorFilter'
            comparison:
              type: string
              enum:
                - ABOVE
                - BELOW
                - OUTSIDE_RANGE
            warningThreshold:
              type: number
            criticalThreshold:
              type: number
    Audit_MonitorMuteState:
      type: object
      properties:
        id:
          type: string
          format: uuid
        monitorId:
          type: string
          format: uuid
        mutedBy:
          type: string
          format: uuid
        mutedByLabel:
          type: string
        mutedAt:
          type: string
          format: date-time
        until:
          type: string
          format: date-time
        reason:
          type: string
    Audit_MonitorDowntime:
      type: object
      properties:
        id:
          type: string
          format: uuid
        monitorId:
          type: string
          format: uuid
        createdBy:
          type: string
          format: uuid
        createdByLabel:
          type: string
        createdAt:
          type: string
          format: date-time
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
        reason:
          type: string
        cancelledAt:
          type: string
          format: date-time
        cancelledBy:
          type: string
          format: uuid
    Audit_MonitorQueryConfig:
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
        - type
    Audit_MonitorFilter:
      type: object
      properties:
        dimension:
          type: string
          enum:
            - AGENT
            - USER
            - MCP_SERVER
            - CHANNEL
            - POLICY
            - LLM_GATEWAY
            - LLM_PROVIDER
            - AUDIT_ACTION
            - MIDDLEWARE_TYPE
            - TRANSPORT
            - STAGE
            - POLICY_LEVEL
            - TASK_STATE
        operator:
          type: string
          enum:
            - IN
            - NOT_IN
        values:
          type: array
          items:
            type: string
          minItems: 1
      required:
        - dimension
        - operator
        - values
  securitySchemes:
    Audit_bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token (USER, AGENT, or SERVICE auth)

````