Database Schema
WaDesk runs on a standard Laravel relational schema (MySQL / MariaDB). Almost everything is scoped to a workspace — the tenant boundary — so a query, an API key, and a UI session all see only their workspace's rows. This page maps the tables you will meet most often, grouped by area.
Do not write to these tables directly. Sensitive columns (provider credentials, secrets) are encrypted at rest, and plan limits/usage are enforced in application code. Go through the API or the platform's own services so encryption, plan enforcement, and event dispatch all run.
Tenancy & Identity
| Table | Holds |
workspaces | The tenant. Owns a plan, limits, branding, and settings; almost every other row carries a workspace_id. |
users | People who log in. A user's current_workspace_id selects the active tenant. |
workspace_user | Membership + role (owner / admin / manager / agent) linking users to workspaces. |
teams, team_user | Sub-groups inside a workspace for inbox routing and permissions. |
Senders (Multi-Engine)
| Table | Holds |
devices | Unofficial-API (web) numbers — one row per paired phone, with connection status. |
wa_provider_configs | WhatsApp Cloud (WABA) and Twilio numbers — one row per connected number, with encrypted credentials. |
Polymorphic sender. A conversation's device_id points at devices for Unofficial, or wa_provider_configs for WABA/Twilio — disambiguated by the row's provider column. The two tables share id sequences, so always pair the id with the provider.
CRM & Conversations
| Table | Holds |
contacts, contact_groups | Customer records (name, phone, email, custom attributes) and their segments. |
conversations | One thread per number, with inbox_status, assignment, unread counts, and the provider/engine it belongs to. |
inbox_messages / messages | Individual inbound/outbound messages, media paths, and provider message IDs used to reconcile delivery/read receipts. |
deals, deal_stages, deal_activities | The sales pipeline (Kanban) and its per-deal timeline. |
attributes | Workspace-level merge attributes used to resolve {{token}} placeholders. |
Sending & Automation
| Table | Holds |
wa_templates | Message templates, their variable_map, parameter_format (POSITIONAL / NAMED), and Meta approval status. |
keyword_replies | Auto Reply rules — keyword / welcome / away / out-of-hours triggers, match method, and the reply. |
flows | Visual chatbot flows (nodes + edges) run by the flow engine. |
wp_campaigns + recipient rows | Campaigns and their per-recipient send state (queued / sent / delivered / read / failed). |
broadcasts | One-off bulk sends and recipient status. |
Billing
| Table | Holds |
packages | Plans and add-ons (type = plan | addon), their feature flags and numeric limits (blank = unlimited), and add-on grants. |
orders | Checkout orders — also the source of admin invoices. |