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

TableHolds
workspacesThe tenant. Owns a plan, limits, branding, and settings; almost every other row carries a workspace_id.
usersPeople who log in. A user's current_workspace_id selects the active tenant.
workspace_userMembership + role (owner / admin / manager / agent) linking users to workspaces.
teams, team_userSub-groups inside a workspace for inbox routing and permissions.

Senders (Multi-Engine)

TableHolds
devicesUnofficial-API (web) numbers — one row per paired phone, with connection status.
wa_provider_configsWhatsApp 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

TableHolds
contacts, contact_groupsCustomer records (name, phone, email, custom attributes) and their segments.
conversationsOne thread per number, with inbox_status, assignment, unread counts, and the provider/engine it belongs to.
inbox_messages / messagesIndividual inbound/outbound messages, media paths, and provider message IDs used to reconcile delivery/read receipts.
deals, deal_stages, deal_activitiesThe sales pipeline (Kanban) and its per-deal timeline.
attributesWorkspace-level merge attributes used to resolve {{token}} placeholders.

Sending & Automation

TableHolds
wa_templatesMessage templates, their variable_map, parameter_format (POSITIONAL / NAMED), and Meta approval status.
keyword_repliesAuto Reply rules — keyword / welcome / away / out-of-hours triggers, match method, and the reply.
flowsVisual chatbot flows (nodes + edges) run by the flow engine.
wp_campaigns + recipient rowsCampaigns and their per-recipient send state (queued / sent / delivered / read / failed).
broadcastsOne-off bulk sends and recipient status.

Billing

TableHolds
packagesPlans and add-ons (type = plan | addon), their feature flags and numeric limits (blank = unlimited), and add-on grants.
ordersCheckout orders — also the source of admin invoices.
WaDesk Documentation