29. CRM (in beta until December 1, 2026)
For developers. The CRM is in beta until December 1, 2026: screens and settings may be polished until then. It includes the foundations (tables, job queue, data layer, privacy and permissions), management (contacts, companies, segments, pipeline, tasks, import and export, capture from forms and WooCommerce), email (editor, campaigns, unsubscribes and tracking), Inbox, Calendar, Reports and a team with roles. The screens share one grammar (see “CRM screens: common grammar”). It hasn’t yet been tested with real Meta accounts (WhatsApp, Instagram, Messenger), Twilio accounts or AI providers: before relying on them, test each channel with your own account.
Switch. BuilderOS → Settings → “CRM”. Off by default while it’s being built; define( 'BUILDEROS_CRM', true|false ); sets it for the whole server or network. When off, it adds nothing to the public site (no hooks, no queries, no files) and on the desktop it only draws the switch card; the data is kept. When on, the public site only registers rest_api_init (real cron and MCP). WP-CLI: wp bos crm status|enable|disable|search|get|upsert.
Add-on. The CRM is a subscription add-on (US$29/month per license) that is activated inside the plugin. Builder_OS_CRM::access() returns:
full: the whole CRM works. This is the case for a local site (localhost,*.localhost,*.test,*.localor a private IP with no license required) and for a license with thecrmadd-on up to date.readonly: the server declaresaddons,crmis no longer there and the CRM was on. No data is deleted. Contacts can be viewed and exported;bos_crm_manage,bos_crm_sendandbos_crm_settingsare removed; WooCommerce carts and payments aren’t captured, there’s no double opt-in and no new reviews,Builder_OS_CRM_Appointments::book()/reschedule()andBuilder_OS_CRM_Messaging::send()returnbos_crm_readonly, and forms don’t create contacts (they still save their messages as usual). One-click unsubscribe, incoming notices and tracking keep working. In the CRM bar, after “CRM”, there’s a neutral “Read only” pill (no dot and no notice at the top of the screen;Builder_OS_CRM_Addon::chip(), andrender_notice()remains as a compatibility wrapper that draws it) that opens a native balloon (popover) “CRM in read-only mode” with the expiry line and what keeps working, if there are paused jobs “N jobs are waiting: they’ll resume on renewal.”, and the “Renew the add-on” button. In addition, while it lasts, the bell carries a fixedcrm-readonlyentry (warning, can’t be dismissed, capabilitybos_crm_view, with “Renew the add-on”).locked: no add-on and the CRM off: the module isn’t loaded and the “CRM” screen is an intro with the “Turn on the CRM” button, which opensurls.billing(orhttps://account.builderos.site).Builder_OS_CRM::enable()returnsfalsewithout saving anything.
Pending queues in read-only mode. Builder_OS_Jobs::paused_types() (filter builder_os_jobs_paused_types) pauses the send, automation, appointment, cart, import and bulk jobs: no more are queued (push() returns 0), claim() and run_id() don’t take them and the traffic light doesn’t count them as late. The pending ones stay in the table, with no attempts or errors, and resume on renewal (cancelable beforehand from the queue). Maintenance jobs (counts, segments, scoring, reports, export) keep running. Data. Per-site tables {prefix}bos_crm_* (contacts, companies, fields, labels, activity, consents, suppression, segments, pipelines, deals, tasks, campaigns, sends, events and links), versioned with dbDelta (option builder_os_crm_db_version) and deleted on uninstall. Email is stored in lowercase and phone in E.164; contacts are deduplicated by email and, without email, by phone. Each consent change is recorded per channel (email, SMS, WhatsApp) with its legal basis and the truncated IP. The suppression list stores only the sha256 of the email and survives GDPR erasure. The CRM integrates with WordPress’s Tools → Export / Erase Personal Data and adds its text to the privacy policy guide.
Email tracking. Opens and clicks are measured by default and can be turned off per site, per campaign and per contact; opens are always shown as “estimated” and the full IP isn’t stored.
Capabilities.
| Capability | What for | Default roles |
|---|---|---|
bos_crm_view | View the CRM | Administrator, Client manager, Store manager |
bos_crm_manage | Create, edit and delete contacts, labels and fields | Administrator, Client manager, Store manager |
bos_crm_send | Send campaigns | Administrator, Client manager |
bos_crm_marketing | Use campaigns, broadcasts and automations, and the bulk actions “Add to campaign” and “Enroll in automation” (checked on the server with Builder_OS_CRM::can_market(); the Agent doesn’t have it). Together with bos_crm_manage: write, publish, delete and test emails (bos_email: CPT with the derived capability bos_crm_email_edit, REST wp/v2/bos-emails, /crm/email/*; that’s why read-only mode and tampering also close them) and everything that moves audiences (Builder_OS_CRM_REST::can_edit_audience(), never the Agent): add to or remove from a static segment, edit or delete a segment, merge contacts with different static segments, create, rename or delete labels, create or delete custom fields, delete companies, import contacts and bulk tag or change the lifecycle. The Agent keeps working contact by contact (/contacts/<id>/tags, crm_tag_contact). The ID of /crm/* routes comes only from the URL: ?id= or id in the body are ignored. Reading wp/v2/bos-emails requires bos_crm_manage granted and bos_crm_view: no anonymous access. Building an email for an automation, an appointment or a transactional message doesn’t require it | Administrator, Client manager, Supervisor, Store manager |
bos_crm_export | Export data (also required, or bos_crm_settings, to save or publish a “Webhook” step) | Administrator, Client manager |
bos_crm_settings | CRM settings (tracking, real cron) | Administrator, Client manager |
bos_crm_reply_any | Reply to any conversation (with “Exclusive reply” off) | Administrator, Client manager, Supervisor |
bos_crm_reassign | Reassign conversations and act on other people’s | Administrator, Client manager, Supervisor |
bos_crm_takeover | “Take over” someone else’s conversation | Administrator, Client manager, Supervisor |
bos_crm_team_reports | Team reports and figures | Administrator, Client manager, Supervisor, Store manager |
CRM-only roles (Builder_OS_CRM_Team, WordPress roles created when the CRM is activated): Agent (bos_crm_agent: bos_crm_view, bos_crm_manage and bos_crm_send), Supervisor (bos_crm_supervisor: the agent’s plus bos_crm_reply_any, bos_crm_reassign, bos_crm_takeover and bos_crm_team_reports) and Manager (the “Client manager” role, bos_crm_manager, CRM administrator: all capabilities, including settings and export). Editors don’t see the CRM. An agent doesn’t see Campaigns or Automations (filter builder_os_crm_sections). A one-time migration (builder_os_crm_caps_version) gives the new capabilities to anyone who already sent from or viewed the CRM: nobody loses access. Filter: builder_os_crm_role_caps.
CRM-only user (sees the CRM and has no edit_posts, manage_options or manage_woocommerce; filter builder_os_crm_only_user): on login they go straight to the CRM (login_redirect to the Inbox), with no admin bar on the site, with the WordPress menu reduced to the CRM and the profile, and any other screen sends them back to the Inbox (profile.php, admin-ajax.php, async-upload.php and admin-post.php are allowed; filter builder_os_crm_only_screens; REST is untouched). A deactivated member (meta bos_crm_disabled) can’t log in and loses the bos_crm_* capabilities. They’re managed in CRM → Settings → Team and system → “Team” card (“Add member” with name, email and role; only roles of equal or lower rank than your own are granted; the last CRM administrator is never demoted).
Job queue (Builder_OS_Jobs, table {prefix}bos_jobs). A common background engine: a job is a batch that advances in 8 s steps (builder_os_jobs_step_budget) and yields at 70% of memory.
Builder_OS_Jobs::push( $type, $args, array( 'priority' => 1–9, 'delay' => s, 'provider' => 'smtp', 'units' => n, 'group' => '…', 'unique' => '…', 'max_attempts' => 5 ) )andpush_many().- Handlers via the
builder_os_jobs_handlersfilter (type => callable( $args, $job, $deadline )). The handler returnstrue(batch finished),Builder_OS_Jobs::more( $args )(continuation) or throwsBuilder_OS_Jobs_Retry( $msg, $delay, array( 'throttle' => s, 'halve' => true ) )when the provider asks to slow down. - Atomic claiming (two passes at once never run the same job), retries with exponential backoff and a dead letter (
dead). - Per-provider limits with
builder_os_jobs_providers(units per window and batches at a time); 2 steps at a time across the whole site (builder_os_jobs_concurrency). - What drives it: WP-Cron (a single event, only when there’s work), the CRM panel’s heartbeat, the real cron
GET /wp-json/builder-os/v1/jobs/tick?key=<llave>(the exact line is in CRM → Settings → Team and system → “Background jobs”) andwp bos jobs run|list|retry|cancel|stats|cron-url.
MCP. crm_search_contacts and crm_get_contact (read only) and crm_upsert_contact, which only subscribes with consent_evidence. They’re in the “CRM” group of “Allowed tools” (not in “Extension tools”). The CRM has its pill in the header, with its own icon (a contact card, different from “Users”) and the count of unread conversations (“9+” from 10); it’s no longer in the rail.
In this chapter
- Management: contacts, companies, segments, pipeline and tasksCRM navigation. The “CRM” pill (last in the row of pills in admin/partials/builder-os-admin-header.php, with bos_crm_view) leads to the CRM. Its…
- CRM app and teamworkIts own bar. The CRM doesn’t use the generic header of the other screens (breadcrumb, large title, intro line): it’s an app with its own bar.
- CRM screens: common grammarThe seven CRM screens (Inbox, Contacts, Deals, Calendar, Overview, Campaigns with Automations and Emails and templates, and Reports with Settings)…
- Inbox v2: tags, outcome, batch, export and teamMessaging schema 4 (builder_os_crm_msg_db_version): bos_crm_conversations gains priority, snoozed_until, resolved_at, outcome, outcome_amount…
- Task detailCRM database: version 4. Task and deal descriptions are no longer plain text: they use a “/” block editor (the plain-text notes still exists for…
- Email and broadcastsEmail editor. CRM → Campaigns → “Emails and templates”. Each email is a bos_email entry (not public) edited in the BuilderOS editor with a 600 px…
- API providers: Brevo and Amazon SESChoosing a provider. CRM → Settings → Channels → “Sending provider”: the site’s SMTP (default), Brevo or Amazon SES. If the chosen one has no…
- SMS and WhatsAppWith the customer’s own accounts (Twilio and Meta’s WhatsApp Cloud API): no cloud of ours and no cost per message. There’s sending to a contact from…
- Lead scoring and abandoned cartsLead scoring. CRM → Settings → Score → “Lead scoring”. Each contact adds or loses points according to what they do; it’s calculated by events and in…
- Automations and double opt-inCRM → Automations: linear flows with “yes / no” branches (trigger → actions, conditions, waits and “End here”; branches rejoin at the next step). You…
- Appointments and calendarAppointments with types, per-person availability, public booking from the “Book an appointment” widget in the builder (chapter 13), reminders and a…
- Unified inboxCRM → Inbox, right after “Contacts” (filter builder_os_crm_sections). It brings together the SMS and WhatsApp conversations (the tables and sending…
- Inbox as an app and push notificationsThe Inbox can be installed as an app and each person with bos_crm_view turns on, on each device, “Notifications on this device” (“Notices” button in…
- Complete templates, attachments and email repliesThree parts of the Inbox (CRM → Inbox), all using the customer’s own accounts and no cloud of ours.
- Reports and review requestsReports (CRM → Reports, bos_crm_view). Classes: Builder_OS_CRM_Reports (class-builder-os-crm-reports.php: data, cache and CSV) and…
- Polish, first halfConsent at WooCommerce checkout (CRM → Settings → Capture and consent → “Consent at checkout”). An “I want to receive news” checkbox on the classic…
- Extended messaging: broadcasts, multiple numbers, Messenger and Instagram, files and AI assistantEverything runs on the client’s own accounts and keys; nothing on the public pages (only signed REST routes and the queue).
- Sales Autopilot (CRM)A layer on top of the AI assistant (Builder_OS_CRM_AI_Agent and its guard): the AI proposes or executes a reply, appointment, deal, stage and…
- Frozen CRM schema (4.20) and public linksA single list of units. Builder_OS_CRM_Schema::UNITS registers the ten versioned schema units: core (contacts, companies, fields, tags, segments…
- Site chatModule includes/modules/class-builder-os-chat.php (loader, registered in MODULES like Popups) and classes in includes/modules/chat/. Screen BuilderOS…
Dates, numbers and amounts in the plugin’s language
Visible text follows the language the plugin is displayed in (Spanish if it isn’t translated), not WordPress’s or the browser’s. PHP: Builder_OS_Format (includes/class-builder-os-format.php; date(), date_fmt(), time_fmt(), num(), money(), range(), human_diff(); Builder_OS_CRM_Format is an empty subclass). JavaScript: window.BOSFmt (num, money, date, at, time, wall, range), with the data in window.BOSFMT. In visible text, don’t use wp_date(), number_format_i18n, toLocaleString or Intl; machine values (REST, CSV, keys) go unformatted. The default currency for amounts comes from Builder_OS_CRM_Pipeline::default_currency(): a currency key in the CRM settings if it exists, otherwise WooCommerce’s and otherwise the site’s country.
Typed amounts (Builder_OS_CRM_Pipeline::to_cents() and BOSFmt.parse() read them the same way): if there are both “.” and “,”, the last one is the decimal (“1.200,50”, “1,234.56”); a repeated separator is a thousands separator (“1.200.000”); a single one followed by 3 digits is thousands (“3.800” = 3800, “1,200” = 1200, unless what precedes it is 0: “0,500”); a single one with 1, 2 or 4 or more digits after it is decimal (“3800,50”). Amount fields are filled in with BOSFmt.num.
CRM settings by section
Same structure as BuilderOS Settings (bos-set*, see “Settings by section”): a menu on the left, one section at a time and cards in a single column.
- The section is chosen with the URL anchor (
#canales, or a card’s). Each “Save” returns to its section. - The CRM guide (“Help”) goes at the end of the menu.
- A section with no cards isn’t shown.
| Section | Key | Cards (class that draws it) |
|---|---|---|
| Channels | canales | Email provider (Builder_OS_CRM_Providers), SMS and WhatsApp (Builder_OS_CRM_Channel_Admin), WhatsApp numbers (Builder_OS_CRM_WA_Lines), Messenger and Instagram Direct (Builder_OS_CRM_Meta_Social), reply mailbox (Builder_OS_CRM_Imap) and Inbox (Builder_OS_CRM_Inbox_Admin) |
| AI assistant | ia | Builder_OS_CRM_AI_Admin |
| Email and sender | correo | Builder_OS_CRM_Campaigns_Admin (sender, legal footer, deliverability, measurement) |
| Capture and consent | consentimiento | Builder_OS_CRM_Contacts_Admin, Builder_OS_CRM_Woo_Consent |
| Scoring | puntuacion | Builder_OS_CRM_Scoring_Admin |
| Automations and carts | automatizaciones | Builder_OS_CRM_Automations_Admin, Builder_OS_CRM_Carts_Admin |
| Appointments | citas | Builder_OS_CRM_Appointments_Admin |
| Reviews | resenas | Builder_OS_CRM_Reviews_Admin |
| Team and system | equipo | Who uses the CRM, license add-ons and background jobs |
| More | mas | Third-party cards |
For developers. Cards hook into builder_os_crm_settings_cards (one per feature) and are distributed by the feature’s class. To place your own card, use add_filter( 'builder_os_crm_settings_group', fn( $group, $callback ) => …, 10, 2 ) and return one of the keys in the table. Anything unrecognized goes to “Plus”.
Comments and @mentions
Builder_OS_CRM_Comments (class-builder-os-crm-comments.php).
- Storage: comments go to the activities table with
type“comment”. Those on a deal carry itsdeal_id; those on a task,ref_type“task” andref_id. The text and the people mentioned go indata. They don’t show on the contact’s record (contact_id0). - API:
add( $kind, $id, $text, array $mentions ). Only users withbos_crm_viewcan be mentioned, up to 20 per comment. - Notices: each mention fires
do_action( 'builder_os_crm_mention', $user_id, $context )and leaves a notice in the mentioned person’s bell (metabos_crm_mentions, the last 20). - Dates:
items()returns the activity ready to render, with dates in the site’s format. Permissions are checked by the REST route.
AI suggested replies (Inbox) and review drafts
For developers. Code: includes/modules/crm/class-builder-os-crm-ai-suggest.php; “How it works” with id crm-ai-suggest. Tests: tests/php/bos-test-crm-ai-suggest.php and tests/e2e/e2e-crm-ai-suggest.js.
- It only exists with the owner’s optional AI key (Settings › AI integration › AI connection): without a key there’s no button or indicator (
composer.suggest,BOSCRMI_BOOT.suggestandBOSCRMR_BOOT.aiabsent). There’s no setting of its own. - Everything goes through
Builder_OS_AI::complete()with the purposeinbox_suggestorreviews; GrayCoder neither pays for nor sells AI. It reads the last 12 messages (never internal notes), the channel’s limits and, if relevant, the chat’s knowledge base. It reusesBuilder_OS_CRM_AI_Guard(<mensaje_cliente>,<contexto>,strip_marks(),sanitize_public()). - The draft is never sent on its own. The usage log stores only numbers; never the person’s text or the draft.
- Cap: 20 drafts per person per hour and per purpose (filter
builder_os_crm_ai_suggest_limit).
| Method | Route (builder-os/v1, capability bos_crm_send) | Response |
|---|---|---|
| POST | crm/inbox/{id}/suggest {tone: brief|kind|formal} | {draft, sources:[{title,url}], tone, remaining}; 403, 404, 422 (blocked channel or no messages), 429 (cap), 502, 503 (no key or monthly cap) |
| POST | crm/reviews/{id}/draft | {draft, mood: positive|recovery, email, whatsapp, conversation, remaining}; 422 with no rating or comment |
| MCP tool | Group | Parameters |
|---|---|---|
crm_suggest_reply | “CRM: SMS and WhatsApp” | id, tone? |
crm_draft_review_reply | “CRM: reports and reviews” | request_id |
They return drafts (read only), with the same permissions as the interface. Hook: builder_os_crm_ai_suggest_limit.
Icons and help in the panel
Icons. Each CRM section has its own stroke icon in the section bar and in the rail submenu (also in the labeled bar and in the mobile drawer), with the same set as the rest of the panel. Builder_OS_CRM_Admin::section_icon() picks the icon; a section added with builder_os_crm_sections uses its dashicon’s.
Help. The “Help” button in the section bar opens a drawer with the guide (Builder_OS_CRM_Help), for the current section’s chapter, with links only to what the user can open. It only describes what the CRM does in this version: if a screen changes, Builder_OS_CRM_Help::chapters() changes too.
Checklist (CRM help).
- All CRM sections show with their icon, on mobile too.
- The Help button opens its chapter and closes with Escape, returning focus.
Outgoing webhooks
Applies to the webhooks that automations send.
Builder_OS_CRM_Automations_Engine::webhook_ip() resolves the name (A and AAAA), requires all IPs to be public and pinned_post() pins the chosen one with CURLOPT_RESOLVE in http_api_curl, for that request only. It also rejects link-local (cloud metadata), CGNAT, IPv4 inside IPv6, NAT64, 6to4 and Teredo, which wp_http_validate_url partly let through; ports other than 80, 443 and 8080, and URLs with credentials. The filter builder_os_crm_automation_allow_http still relaxes this for intranets and tests (then nothing is checked or pinned).
Limitation: without cURL the IP can’t be pinned: on those servers the window between checking and connecting remains.
Coming soon in the CRM (doesn’t exist yet)
A “Currency” field in the CRM Settings: it will use the WooCommerce currency if active and, if not, the one that matches the site language. Until then, Builder_OS_CRM_Pipeline::default_currency() infers it as described in “Dates, numbers and amounts in the plugin’s language”.