Skip to content

docs(chatwoot-adapter): correct the instance-mint setup path and add 401 troubleshooting (0.5.3) - #41

Merged
rmyndharis merged 1 commit into
mainfrom
docs/chatwoot-adapter-ingress-secret-setup
Jul 20, 2026
Merged

docs(chatwoot-adapter): correct the instance-mint setup path and add 401 troubleshooting (0.5.3)#41
rmyndharis merged 1 commit into
mainfrom
docs/chatwoot-adapter-ingress-secret-setup

Conversation

@rmyndharis

@rmyndharis rmyndharis commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Description

Fixes the setup documentation that led every dashboard-minted Chatwoot adapter instance into a state where outbound delivery (Chatwoot → WhatsApp) can never work, reported in rmyndharis/OpenWA#821.

Root cause (verified against both codebases): OpenWA verifies each Chatwoot webhook delivery against the integration instance's ingress secret (HMAC-SHA256 over {timestamp}.{rawBody}). Chatwoot signs with its own per-webhook secret, which is auto-generated and read-only — it cannot be replaced with a custom value. But the OpenWA dashboard's instance-create form has no secret field, so it auto-generates a random secret that can never match Chatwoot's. Result: every webhook delivery fails signature verification with a 401, agent replies never reach WhatsApp, while inbound (WhatsApp → Chatwoot) keeps working because it authenticates to Chatwoot's REST API with the API token, not through the webhook.

The previous setup guide made it worse: it told operators to "paste the Chatwoot webhook secret" in the dashboard — a step that is currently impossible to follow.

Changes

  • Setup now mints via the REST API (POST /api/integration/plugins/chatwoot-adapter/instances), the only path that accepts a caller-supplied secret, with a complete curl example and an explicit warning against dashboard minting (including how to recover: delete + re-mint).
  • States the concrete minimum Chatwoot version: v4.12.0 — the first release whose account-level webhooks carry per-webhook secrets and timestamped HMAC signatures (chatwoot/chatwoot#13573, verified by tag bisection). Older releases send unsigned webhooks, which OpenWA rejects with a 401.
  • New Troubleshooting section mapping the 401 symptom to its four causes (secret mismatch, rotated secret, >300 s clock skew, Chatwoot too old) and distinguishing 404 (wrong URL) from 401 (bad signature).

Documentation only — no runtime code changed. Released as 0.5.3 (manifest + changelog + regenerated catalog included).

Verification

  • npm test — 401/401 pass
  • npm run typecheck — clean
  • npm run catalog:check — no drift
  • node package.mjs chatwoot-adapter — v0.5.3 zip (11.1 KB) builds cleanly

Related

…401 troubleshooting (0.5.3)

The setup guide told operators to mint the integration instance from the
OpenWA dashboard and paste the Chatwoot webhook secret there, but the
dashboard's instance form has no secret field — it auto-generates one
that can never match Chatwoot's, so every Chatwoot → OpenWA webhook
delivery failed HMAC verification with a 401 (rmyndharis/OpenWA#821).
Inbound kept working because it authenticates to Chatwoot's REST API
with the apiToken, not through the webhook.

- Setup now mints via the REST API, the only path that accepts a secret,
  with a full curl example and a warning against dashboard minting
- State the concrete minimum Chatwoot version: v4.12.0, the first
  release with per-webhook secrets and timestamped webhook signatures
  (chatwoot/chatwoot#13573)
- New Troubleshooting section maps the 401 symptom to its causes:
  secret mismatch, rotated secret, >300s clock skew, Chatwoot too old —
  and distinguishes 404 (wrong URL) from 401 (bad signature)

Documentation only; no runtime code changed. Released as 0.5.3.

Refs rmyndharis/OpenWA#821
@rmyndharis
rmyndharis merged commit 8ba7216 into main Jul 20, 2026
1 check passed
@rmyndharis
rmyndharis deleted the docs/chatwoot-adapter-ingress-secret-setup branch July 22, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant