29. CRM (in beta until December 1, 2026)

For developersVersion 1.0.0Last updated:

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, *.local or a private IP with no license required) and for a license with the crm add-on up to date.
  • readonly: the server declares addons, crm is no longer there and the CRM was on. No data is deleted. Contacts can be viewed and exported; bos_crm_manage, bos_crm_send and bos_crm_settings are removed; WooCommerce carts and payments aren’t captured, there’s no double opt-in and no new reviews, Builder_OS_CRM_Appointments::book()/reschedule() and Builder_OS_CRM_Messaging::send() return bos_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(), and render_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 fixed crm-readonly entry (warning, can’t be dismissed, capability bos_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 opens urls.billing (or https://account.builderos.site). Builder_OS_CRM::enable() returns false without 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.

CapabilityWhat forDefault roles
bos_crm_viewView the CRMAdministrator, Client manager, Store manager
bos_crm_manageCreate, edit and delete contacts, labels and fieldsAdministrator, Client manager, Store manager
bos_crm_sendSend campaignsAdministrator, Client manager
bos_crm_marketingUse 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 itAdministrator, Client manager, Supervisor, Store manager
bos_crm_exportExport data (also required, or bos_crm_settings, to save or publish a “Webhook” step)Administrator, Client manager
bos_crm_settingsCRM settings (tracking, real cron)Administrator, Client manager
bos_crm_reply_anyReply to any conversation (with “Exclusive reply” off)Administrator, Client manager, Supervisor
bos_crm_reassignReassign conversations and act on other people’sAdministrator, Client manager, Supervisor
bos_crm_takeover“Take over” someone else’s conversationAdministrator, Client manager, Supervisor
bos_crm_team_reportsTeam reports and figuresAdministrator, 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 ) ) and push_many().
  • Handlers via the builder_os_jobs_handlers filter (type => callable ( $args, $job, $deadline )). The handler returns true (batch finished), Builder_OS_Jobs::more( $args ) (continuation) or throws Builder_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”) and wp 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

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.
SectionKeyCards (class that draws it)
ChannelscanalesEmail 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 assistantiaBuilder_OS_CRM_AI_Admin
Email and sendercorreoBuilder_OS_CRM_Campaigns_Admin (sender, legal footer, deliverability, measurement)
Capture and consentconsentimientoBuilder_OS_CRM_Contacts_Admin, Builder_OS_CRM_Woo_Consent
ScoringpuntuacionBuilder_OS_CRM_Scoring_Admin
Automations and cartsautomatizacionesBuilder_OS_CRM_Automations_Admin, Builder_OS_CRM_Carts_Admin
AppointmentscitasBuilder_OS_CRM_Appointments_Admin
ReviewsresenasBuilder_OS_CRM_Reviews_Admin
Team and systemequipoWho uses the CRM, license add-ons and background jobs
MoremasThird-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 its deal_id; those on a task, ref_type “task” and ref_id. The text and the people mentioned go in data. They don’t show on the contact’s record (contact_id 0).
  • API: add( $kind, $id, $text, array $mentions ). Only users with bos_crm_view can 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 (meta bos_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.suggest and BOSCRMR_BOOT.ai absent). There’s no setting of its own.
  • Everything goes through Builder_OS_AI::complete() with the purpose inbox_suggest or reviews; 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 reuses Builder_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).
MethodRoute (builder-os/v1, capability bos_crm_send)Response
POSTcrm/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)
POSTcrm/reviews/{id}/draft{draft, mood: positive|recovery, email, whatsapp, conversation, remaining}; 422 with no rating or comment
MCP toolGroupParameters
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”.