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

# Chatwoot webhook 端点

> 从 Chatwoot 接收网络钩子事件，并向WhatsApp 发送消息。
在您的Chatwoot inbox webhook 设置中配置此 URL。

当CHATWOOT_WEBHOOK_SECRET 被设置时，请求必须证明对
的了解。 推荐：使用 Chatwoot 自身的签名。当 API 渠道设置了 webhook 密钥时，
Chatwoot 会发送 `X-Chatwoot-Timestamp`（Unix 时间戳，单位为秒）和
`X-Chatwoot-Signature: sha256=<hex HMAC-SHA256 of "<timestamp>.<raw body>">`。
时间戳必须在服务器时钟的 CHATWOOT_WEBHOOK_SIGNATURE_TOLERANCE (5m, 含
默认值)。 还接受：`X-Hub-Signature-256`
（原始请求体的 HMAC-SHA256）、通过 `X-Chatwoot-Webhook-Secret`
或 `X-Gowa-Chatwoot-Secret` 传入的密钥，或 `secret` 查询参数（不推荐：
这会导致密钥出现在 URL 和日志中）。

所应用的秘密是有效负载的设备的
的秘密：当它有一个设备时，该设备配置的 `webhook_secret` (然后不接受它的
全局秘密)， 否则，在没有设备解析的情况下，CHATWOOT_WEBHOOK_SECRET
 一个由 Chatwoot-签名的请求，即
已经在容忍窗口内被接受 (答案 2xxx) 是一个
承认，并且没有再次行动。 一个回答了任何其他状态的
的人未被记住，所以再次发送相同的
请求将被处理。




## OpenAPI

````yaml /zh/openapi.yml post /chatwoot/webhook
openapi: 3.0.0
info:
  title: WhatsApp API 多设备
  version: 9.7.0
  description: |
    此 API 用于通过 API 发送什么应用。

    Web 仪表板是一个单独的项目(gowa-ui)； 服务器下载它的
    最新版本资产并在 `/` 处服务(或在
    APP_UI_ENABLED=false时返回一个 JSON 横幅)。

    设备范围：
    - 在所有设备范围的REST 调用上发送 `X-Device-Id` 。
    - WebSocket: 连接到"/w?device_id=<id>`.
    - WebSocket 身份验证（启用基本身份验证时）：浏览器无法为
      WebSocket 连接设置 Authorization 请求头，因此还需在
      查询字符串中传入 `&authorization=<base64(user:pass)>`。 在
      生产中使用TLS ，因为凭据在 URL 中可见。
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: 初始连接到 Whatsapp 服务器
  - name: device
    description: 多设备支持的设备管理
  - name: user
    description: 获取信息
  - name: send
    description: 发送消息 (Text/Image/File/Video)。
  - name: message
    description: 消息操作 (撤销/react/update)。
  - name: call
    description: 通话管理 (拒绝来电)
  - name: chat
    description: 聊天对话和消息
  - name: group
    description: 组设置
  - name: newsletter
    description: 通讯设置
  - name: chatwoot
    description: 客户支持的聊天窗口集成
paths:
  /chatwoot/webhook:
    post:
      tags:
        - chatwoot
      summary: Chatwoot webhook 端点
      description: >
        从 Chatwoot 接收网络钩子事件，并向WhatsApp 发送消息。

        在您的Chatwoot inbox webhook 设置中配置此 URL。


        当CHATWOOT_WEBHOOK_SECRET 被设置时，请求必须证明对

        的了解。 推荐：使用 Chatwoot 自身的签名。当 API 渠道设置了 webhook 密钥时，

        Chatwoot 会发送 `X-Chatwoot-Timestamp`（Unix 时间戳，单位为秒）和

        `X-Chatwoot-Signature: sha256=<hex HMAC-SHA256 of "<timestamp>.<raw
        body>">`。

        时间戳必须在服务器时钟的 CHATWOOT_WEBHOOK_SIGNATURE_TOLERANCE (5m, 含

        默认值)。 还接受：`X-Hub-Signature-256`

        （原始请求体的 HMAC-SHA256）、通过 `X-Chatwoot-Webhook-Secret`

        或 `X-Gowa-Chatwoot-Secret` 传入的密钥，或 `secret` 查询参数（不推荐：

        这会导致密钥出现在 URL 和日志中）。


        所应用的秘密是有效负载的设备的

        的秘密：当它有一个设备时，该设备配置的 `webhook_secret` (然后不接受它的

        全局秘密)， 否则，在没有设备解析的情况下，CHATWOOT_WEBHOOK_SECRET
         一个由 Chatwoot-签名的请求，即
        已经在容忍窗口内被接受 (答案 2xxx) 是一个

        承认，并且没有再次行动。 一个回答了任何其他状态的

        的人未被记住，所以再次发送相同的

        请求将被处理。
      operationId: chatwootWebhook
      parameters:
        - name: X-Chatwoot-Signature
          in: header
          description: >-
            Chatwoot 签名：shap256=<hex HMAC-SHA256 of "<timestamp>。<raw
            body>用webhook 密钥>
          schema:
            type: string
        - name: X-Chatwoot-Timestamp
          in: header
          description: Web 钩子签名时间(秒)
          schema:
            type: string
        - name: secret
          in: query
          description: Web 钩子密钥。 不勇气；更喜欢签名标题。
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Chatwoot webhook payload (见Chatwoot 文档)
      responses:
        '200':
          description: Webhook 已处理
        '401':
          description: 请求被路由到的设备或签名丢失或无效，或者签名时间戳超出容忍窗口
        '503':
          description: 设备不可用，路由设备的配置无法读取，或者相同的签名请求仍在处理
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
components:
  schemas:
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: HTTP 状态代码
        message:
          type: string
          example: field cannot be blank
          description: 详细错误消息
        results:
          type: object
          example: null
          description: 附加数据
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [每台设备聊天woot webhook 端点](https://gowa-docs.mintlify.site/zh/api-reference/chatwoot/每台设备聊天woot-webhook-端点.md)
- [Webhooks](https://gowa-docs.mintlify.site/zh/concepts/webhooks.md)
- [API 认证](https://gowa-docs.mintlify.site/zh/api-reference/authentication.md)
- [聊天woot 集成](https://gowa-docs.mintlify.site/zh/integrations/chatwoot.md)
- [API 参考](https://gowa-docs.mintlify.site/zh/api-reference/introduction.md)


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