> ## 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.

# デバイスの webhook 設定を設定します

> 特定のデバイスのカスタムWebフック設定を設定します。 設定すると、このデバイス
のWebhookイベントはグローバルWebhookURLの代わりにこのURLに送信されます。 デバイスレベルの`webhook_secret`、
`webhook_events`、および `webhook_insecure_skip_verify`はこのデバイスのグローバルWebhook設定を上書きします。

空文字列に設定すると、グローバルWebhookをクリアして使用できます。




## OpenAPI

````yaml /ja/openapi.yml patch /devices/{device_id}/webhook
openapi: 3.0.0
info:
  title: WhatsApp API マルチデバイス
  version: 9.7.0
  description: |
    この API は API 経由で whatsapp を送信するために使用されます。

    Web ダッシュボードは別のプロジェクトです (gowa-ui); サーバーは
    最新のリリースアセットをダウンロードし、`/`で動作します（または、
    APP_UI_ENABLED=falseの場合はJSONバナーを返します）。

    デバイススコープ:
    - すべてのデバイススコープの REST コールで `X-Device-Id` を送信します。
    - WebSocket: `/wsに接続しますか？device_id=<id> ` 。
    - WebSocket 認証（Basic Auth が有効な場合）: ブラウザーは WebSocket 接続で
      Authorization ヘッダーを設定できないため、クエリ文字列にも
      `&authorization=<base64(user:pass)>` を渡してください。 認証情報が URL に表示されるため、本番環境では
      TLS を使用してください。
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Whatsappサーバーへの初期接続
  - name: device
    description: マルチデバイスサポートのためのデバイス管理
  - name: user
    description: 情報の取得
  - name: send
    description: メッセージ (テキスト/イメージ/ファイル/ビデオ) を送信します。
  - name: message
    description: メッセージ操作 (revoke/react/update)
  - name: call
    description: 通話管理 (着信拒否)
  - name: chat
    description: チャットとメッセージ
  - name: group
    description: グループ設定
  - name: newsletter
    description: ニュースレターの設定
  - name: chatwoot
    description: カスタマーサポートのためのChatwoot統合
paths:
  /devices/{device_id}/webhook:
    patch:
      tags:
        - device
      summary: デバイスの webhook 設定を設定します
      description: >
        特定のデバイスのカスタムWebフック設定を設定します。 設定すると、このデバイス

        のWebhookイベントはグローバルWebhookURLの代わりにこのURLに送信されます。 デバイスレベルの`webhook_secret`、

        `webhook_events`、および
        `webhook_insecure_skip_verify`はこのデバイスのグローバルWebhook設定を上書きします。


        空文字列に設定すると、グローバルWebhookをクリアして使用できます。
      operationId: updateDeviceWebhook
      parameters:
        - name: device_id
          in: path
          required: true
          schema:
            type: string
          description: デバイス ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook_url:
                  type: string
                  description: この端末に使用するカスタム webhook URL 空の文字列をクリアするように設定します。
                  example: https://example.com/webhook
                webhook_secret:
                  type: string
                  description: このデバイスのWebhookのペイロードに署名するために使用されるオプションの秘密。
                  example: super-secret-key
                webhook_events:
                  type: string
                  description: このデバイスのWebhookのオプションのカンマ区切りイベントホワイトリストです。 空白はすべてのイベントを意味します。
                  example: message,message.ack
                webhook_insecure_skip_verify:
                  type: boolean
                  description: 任意。 このデバイス Webhook の TLS 証明書検証をスキップします。
                  example: false
              required:
                - webhook_url
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  code:
                    type: string
                    example: SUCCESS
                  message:
                    type: string
                    example: Device webhook updated
                  results:
                    type: object
                    properties:
                      device_id:
                        type: string
                        description: デバイスID
                        example: my-device
                      webhook_url:
                        type: string
                        description: 設定された webhook URL
                        example: https://example.com/webhook
                      webhook_secret:
                        type: string
                        description: この端末のWebhookのペイロードへの署名に使用されるシークレット
                        example: super-secret-key
                      webhook_events:
                        type: string
                        description: カンマ区切りのイベントホワイトリストでこのデバイスの Webhook
                        example: message,message.ack
                      webhook_insecure_skip_verify:
                        type: boolean
                        description: この端末の Webhook で TLS 検証がスキップされるかどうか
                        example: false
        '400':
          description: 不正なリクエスト
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '404':
          description: デバイスが見つかりません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '500':
          description: 内部サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
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: 追加データ
    ErrorNotFound:
      type: object
      properties:
        code:
          type: string
          example: 404
          description: HTTP ステータスコードです
        message:
          type: string
          example: Chat not found
          description: 詳細エラーメッセージ
        results:
          type: object
          example: null
          description: 追加データ
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: システムのコードにエラー
        message:
          type: string
          example: you are not loggin
          description: 詳細エラーメッセージ
        results:
          type: object
          example: null
          description: 追加データ
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [デバイスの webhook 設定を取得します](https://gowa-docs.mintlify.site/ja/api-reference/device/デバイスの-webhook-設定を取得します.md)
- [デバイスのChatwoot設定を取得する](https://gowa-docs.mintlify.site/ja/api-reference/chatwoot/デバイスのchatwoot設定を取得する.md)
- [デバイスのChatwoot設定を作成または更新](https://gowa-docs.mintlify.site/ja/api-reference/chatwoot/デバイスのchatwoot設定を作成または更新.md)
- [デバイスのChatwoot設定を削除する](https://gowa-docs.mintlify.site/ja/api-reference/chatwoot/デバイスのchatwoot設定を削除する.md)
- [デバイス毎のChatwoot Webhookエンドポイント](https://gowa-docs.mintlify.site/ja/api-reference/chatwoot/デバイス毎のchatwoot-webhookエンドポイント.md)


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