📄 SKILL.md

← Vault

name: uazapi-chatwoot-multiple-instances

description: Configure multiple Uazapi WhatsApp instances to sync with separate Chatwoot inboxes

category: devops


Uazapi → Chatwoot Multi-Instance Integration

Configure multiple Uazapi instances to sync with separate Chatwoot inboxes via API.

Key Insights

1. PUT doesn't return webhook URL - The PUT /chatwoot/config only returns {"message":"Chatwoot config updated successfully"}

2. GET returns everything - Use GET /chatwoot/config to get webhook_url, expected_webhook_url, and full integration_status

3. Uazapi auto-configures Chatwoot - When PUT succeeds, Uazapi automatically sets the webhook URL in Chatwoot's inbox channel

4. Chatwoot API may be blocked externally - If API returns 404, access via Rails console: docker exec root-rails-1 bundle exec rails runner "Inbox.all.each { |i| puts \"Inbox #{i.id} (#{i.name}): #{i.channel&.webhook_url}\" }"

API Call Format

`bash

PUT - Configure instance

curl -X PUT "https://{uazapi_subdomain}.uazapi.com/chatwoot/config" \

-H "Content-Type: application/json" \

-H "token: {instance_token}" \

-d '{

"enabled": true,

"url": "https://{chatwoot_url}",

"access_token": "REDACTED",

"account_id": {chatwoot_account_id},

"inbox_id": {chatwoot_inbox_id},

"ignore_groups": false,

"sign_messages": true,

"create_new_conversation": false

}'

GET - Verify configuration and get webhook URL

curl -X GET "https://{uazapi_subdomain}.uazapi.com/chatwoot/config" \

-H "token: {instance_token}"

`

Finding Chatwoot Inbox IDs

`bash

Via Rails console on VPS

docker exec root-rails-1 bundle exec rails runner "puts Inbox.pluck(:id, :name)"

Returns: [[4, "Rainany"], [5, "Pietra"], [8, "Vinicius"], [1, "Rocha-Sales-Seguros-Oficial"], [7, "Julia Lima"], [3, "Rafael William"], [2, "SDR-ROCHA-SALES"]]

`

Integration Status Fields (from GET response)

`json

{

"integration_status": {

"status": "ok|disabled|warning",

"connection_ok": true,

"credentials_ok": true,

"inbox_exists": true,

"inbox_name": "Julia Lima",

"webhook_configured": true,

"webhook_url": "https://{subdomain}.uazapi.com/chatwoot/webhook/{token}",

"expected_webhook_url": "https://{subdomain}.uazapi.com/chatwoot/webhook/{token}"

}

}

`

Important Notes