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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 删除 Webhook

> 删除 webhook，并停止 Yuno 向其 URL 发送通知

删除 webhook。Yuno 会停止向其 `url` 发送通知，并返回已删除的 webhook，以便您保留其订阅事件的记录。

如需停止通知但保留配置，请改用 [更新 Webhook](https://docs.y.uno/zh-hans/reference/webhooks/update-webhook.md) 将 `state` 设置为 `INACTIVE`。


## OpenAPI

````yaml openapi/zh-hans/webhooks/manage-webhooks.json DELETE /webhooks/{webhook_id}
openapi: 3.1.0
info:
  title: webhooks-manage-webhooks
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /webhooks/{webhook_id}:
    delete:
      summary: 删除 Webhook
      description: 删除一个 webhook。Yuno 会停止向其 URL 发送通知，并返回被删除的 webhook。
      operationId: delete-webhook
      parameters:
        - name: webhook_id
          in: path
          required: true
          description: >-
            webhook 的唯一标识符，由[列出
            Webhook](/zh-hans/reference/webhooks/list-webhooks)返回。
          schema:
            type: string
            example: '12345'
        - name: account_id
          in: query
          required: true
          description: webhook 所属账户的唯一标识符。
          schema:
            type: string
            format: uuid
            example: 493e9374-510a-4201-9e09-de669d75f256
            x-default: 493e9374-510a-4201-9e09-de669d75f256
      responses:
        '200':
          description: 您删除的 webhook。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
              example:
                id: '12345'
                account_id: 493e9374-510a-4201-9e09-de669d75f256
                name: Production payments listener
                state: ACTIVE
                url: https://api.acme.com/yuno/webhooks
                api_key: '***'
                secret: '***'
                hmac_client_secret: '***'
                oauth2_authentication_url: null
                oauth2_client_secret: null
                oauth2_client_id: null
                oauth2_grant_type: null
                oauth2_scope: null
                oauth2_authorization_name: null
                oauth2_include_client_id: false
                enrollment_triggers:
                  - ENROLL
                  - UNENROLL
                payment_triggers:
                  - AUTHORIZE
                  - CAPTURE
                  - REFUND
                report_triggers: []
                subscription_triggers:
                  - CREATE
                  - CLOSE_TO_RENEWAL
                onboarding_triggers: null
                renewal_days: 5
                created_at: '2026-07-09T13:05:36.482913Z'
                updated_at: '2026-07-09T13:05:36.482913Z'
        '400':
          $ref: '#/components/responses/InvalidAccountRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/WebhookNotFound'
        '502':
          $ref: '#/components/responses/UpstreamError'
components:
  schemas:
    Webhook:
      type: object
      properties:
        id:
          type: string
          description: webhook 的唯一标识符。
          example: '12345'
        account_id:
          type: string
          format: uuid
          description: webhook 所属账户的唯一标识符。
          example: 493e9374-510a-4201-9e09-de669d75f256
        name:
          type: string
          description: 您为 webhook 起的名称。
          example: Production payments listener
        state:
          type: string
          description: '`ACTIVE` 的 webhook 会接收通知，`INACTIVE` 的不会。webhook 创建时为 `ACTIVE`。'
          enum:
            - ACTIVE
            - INACTIVE
          example: ACTIVE
        url:
          type: string
          description: Yuno 发送通知的目标 endpoint。
          example: https://api.acme.com/yuno/webhooks
        api_key:
          type:
            - string
            - 'null'
          description: 以 `***` 掩码显示；如果您尚未配置，则为 `null`。
          example: '***'
        secret:
          type:
            - string
            - 'null'
          description: 以 `***` 掩码显示；如果您尚未配置，则为 `null`。
          example: '***'
        hmac_client_secret:
          type:
            - string
            - 'null'
          description: 以 `***` 掩码显示；如果您尚未配置，则为 `null`。
          example: '***'
        oauth2_authentication_url:
          type:
            - string
            - 'null'
          description: 您的令牌 endpoint。
          example: https://api.acme.com/oauth/token
        oauth2_client_secret:
          type:
            - string
            - 'null'
          description: 以 `***` 掩码显示；如果您尚未配置，则为 `null`。
          example: '***'
        oauth2_client_id:
          type:
            - string
            - 'null'
          description: Yuno 用于身份验证的客户端标识符。
          example: acme_client_id
        oauth2_grant_type:
          type:
            - string
            - 'null'
          description: Yuno 请求令牌时使用的授权类型。
          example: client_credentials
        oauth2_scope:
          type:
            - string
            - 'null'
          description: 请求令牌时使用的范围。
          example: webhooks:write
        oauth2_authorization_name:
          type:
            - string
            - 'null'
          description: Yuno 发送令牌所使用的标头。
          example: Authorization
        oauth2_include_client_id:
          type: boolean
          description: Yuno 是否同时在令牌请求中将客户端标识符作为标头发送。
          example: true
        enrollment_triggers:
          type:
            - array
            - 'null'
          description: webhook 订阅的注册事件。
          items:
            type: string
          example:
            - ENROLL
            - UNENROLL
        payment_triggers:
          type:
            - array
            - 'null'
          description: webhook 订阅的支付事件。
          items:
            type: string
          example:
            - AUTHORIZE
            - CAPTURE
            - REFUND
        report_triggers:
          type:
            - array
            - 'null'
          description: webhook 订阅的报告事件。
          items:
            type: string
          example:
            - UPDATE
        subscription_triggers:
          type:
            - array
            - 'null'
          description: webhook 订阅的订阅事件。
          items:
            type: string
          example:
            - CREATE
            - CLOSE_TO_RENEWAL
        onboarding_triggers:
          type:
            - array
            - 'null'
          description: webhook 订阅的 onboarding 事件。
          items:
            type: string
          example:
            - CREATED
            - SUCCEEDED
        renewal_days:
          type:
            - integer
            - 'null'
          description: Yuno 在续订前多少天发送 `CLOSE_TO_RENEWAL` 通知。
          example: 5
        created_at:
          type: string
          description: webhook 的创建日期和时间，采用 ISO 8601。
          example: '2026-07-09T13:05:36.482913Z'
          format: date-time
        updated_at:
          type: string
          description: webhook 的最近更新日期和时间，采用 ISO 8601。在您首次更新 webhook 之前，它与 `created_at` 相同。
          example: '2026-07-11T16:20:44.918330Z'
          format: date-time
    WebhookRequestError:
      type: object
      properties:
        code:
          type: string
          description: 机器可读的错误代码。
          enum:
            - WEBHOOK_INVALID_REQUEST
            - INVALID_ACCOUNT_ID
        messages:
          type: array
          description: 错误的可读描述。
          items:
            type: string
    WebhookAuthError:
      type: object
      properties:
        code:
          type: string
          description: 机器可读的错误代码。
          enum:
            - NOT_AUTHENTICATED
            - INVALID_CREDENTIALS
        messages:
          type: array
          description: 错误的可读描述。
          items:
            type: string
    WebhookNotFoundError:
      type: object
      properties:
        code:
          type: string
          description: 机器可读的错误代码。
          enum:
            - WEBHOOK_NOT_FOUND
        messages:
          type: array
          description: 错误的可读描述。
          items:
            type: string
    WebhookUpstreamError:
      type: object
      properties:
        code:
          type: string
          description: 机器可读的错误代码。
          enum:
            - WEBHOOK_UPSTREAM_ERROR
        messages:
          type: array
          description: 错误的可读描述。
          items:
            type: string
  responses:
    InvalidAccountRequest:
      description: '`account_id` 缺失或无效。'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookRequestError'
          examples:
            Missing account_id:
              value:
                code: WEBHOOK_INVALID_REQUEST
                messages:
                  - account_id is required.
            Invalid account_id:
              value:
                code: INVALID_ACCOUNT_ID
                messages:
                  - Account id is invalid
    Unauthorized:
      description: 您的 API 凭证缺失或无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookAuthError'
          examples:
            Not authenticated:
              value:
                code: NOT_AUTHENTICATED
                messages:
                  - Not authenticated
            Invalid credentials:
              value:
                code: INVALID_CREDENTIALS
                messages:
                  - Invalid Credentials
    WebhookNotFound:
      description: 账户上没有具有该标识符的 webhook。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookNotFoundError'
          examples:
            Not found:
              value:
                code: WEBHOOK_NOT_FOUND
                messages:
                  - The webhook does not exist for this account.
    UpstreamError:
      description: webhook 服务暂时不可用。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookUpstreamError'
          examples:
            Service unavailable:
              value:
                code: WEBHOOK_UPSTREAM_ERROR
                messages:
                  - The webhook service is temporarily unavailable.
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: private-secret-key
      x-default: <Your private-secret-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.