> ## Documentation Index
> Fetch the complete documentation index at: https://oma-codex-339-workspace-permissions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 更新 Webhook

> 通过 OMA API 更新 Webhook。

<Info>每个请求都必须发送 `anthropic-beta: webhooks-2026-03-01`。创建接口只返回一次签名密钥。</Info>


## OpenAPI

````yaml /openapi/oma.zh.json post /v1/webhooks/{webhook_id}
openapi: 3.1.0
info:
  title: OMA API 参考
  version: 1.0.0
  description: Open Managed Agents 应用 API 参考。
servers:
  - url: http://localhost:38080
    description: 本地 OMA 服务器
security:
  - omaApiKey: []
  - omaBearer: []
paths:
  /v1/webhooks/{webhook_id}:
    post:
      summary: 更新 Webhook
      operationId: OMAUpdateWebhook
      parameters:
        - name: anthropic-beta
          in: header
          required: true
          schema:
            type: string
        - name: webhook_id
          in: path
          required: true
          schema:
            type: string
          description: Webhook 标识符。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookUpdate'
      responses:
        '200':
          description: 成功响应（OK）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
components:
  schemas:
    WebhookUpdate:
      type: object
      minProperties: 1
      properties:
        url:
          type: string
          format: uri
        name:
          type: string
        description:
          type: string
        enabled_events:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            type: string
            enum:
              - session.status_run_started
              - session.status_idled
              - session.status_rescheduled
              - session.status_terminated
              - session.deleted
              - session.updated
              - session.error
              - session.thread_created
              - session.thread_status_running
              - session.thread_status_idle
              - session.thread_status_rescheduled
              - session.thread_status_terminated
              - session.thread_idled
              - session.thread_terminated
              - session.outcome_evaluation_ended
              - vault.created
              - vault.archived
              - vault.deleted
              - vault_credential.created
              - vault_credential.archived
              - vault_credential.deleted
              - vault_credential.refresh_failed
        status:
          type: string
          enum:
            - enabled
            - disabled
    Webhook:
      type: object
      required:
        - id
        - type
        - url
        - name
        - description
        - enabled_events
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          example: wh_01H...
        type:
          type: string
          const: webhook
        url:
          type: string
          format: uri
        name:
          type: string
        description:
          type: string
        enabled_events:
          type: array
          items:
            type: string
            enum:
              - session.status_run_started
              - session.status_idled
              - session.status_rescheduled
              - session.status_terminated
              - session.deleted
              - session.updated
              - session.error
              - session.thread_created
              - session.thread_status_running
              - session.thread_status_idle
              - session.thread_status_rescheduled
              - session.thread_status_terminated
              - session.thread_idled
              - session.thread_terminated
              - session.outcome_evaluation_ended
              - vault.created
              - vault.archived
              - vault.deleted
              - vault_credential.created
              - vault_credential.archived
              - vault_credential.deleted
              - vault_credential.refresh_failed
        status:
          type: string
          enum:
            - enabled
            - disabled
        disabled_reason:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        signing_secret:
          type: string
          writeOnly: true
          description: 仅在创建 webhook 时返回。
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA 工作区 API 密钥。
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: 以 Bearer 令牌形式发送的 OMA 工作区 API 密钥。

````