Documentation

ChatPilot

Multitenancy

How ChatPilot isolates tenants by WhatsApp phone number and tenant-scoped data.

phone_number_id is the routing key for inbound WhatsApp traffic. The webhook resolves it to a tenants row before any processing.

Important tenant columns include slug, phone_number_id, wa_access_token, wa_verify_token, waba_id, and config JSONB. Sensitive tokens should be encrypted at rest.

tenant_users stores owners, admins, and agents. Every operational table carries tenant_id so row-level isolation can be enforced consistently.