<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Themesic Interactive</title>
    <description>The latest articles on DEV Community by Themesic Interactive (@themesic).</description>
    <link>https://dev.to/themesic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4060614%2Fc5f0ce50-c1d5-49b9-8ad9-4235607ba644.png</url>
      <title>DEV Community: Themesic Interactive</title>
      <link>https://dev.to/themesic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/themesic"/>
    <language>en</language>
    <item>
      <title>Why your CRM needs an inbox: inside a Perfex CRM email client</title>
      <dc:creator>Themesic Interactive</dc:creator>
      <pubDate>Mon, 03 Aug 2026 16:29:01 +0000</pubDate>
      <link>https://dev.to/themesic/why-your-crm-needs-an-inbox-inside-a-perfex-crm-email-client-4lna</link>
      <guid>https://dev.to/themesic/why-your-crm-needs-an-inbox-inside-a-perfex-crm-email-client-4lna</guid>
      <description>&lt;p&gt;Watch a support agent answer one customer email and count the tabs: webmail in one, Perfex CRM in another, and the invoice or ticket they need in a third. Every reply means re-finding the customer record, re-checking the balance, and copy-pasting context between windows. That is the context-switching tax, and busy teams pay it dozens of times a day. A Perfex CRM email client attacks the problem at its root: it puts the inbox inside the CRM, right next to the records the email is actually about.&lt;/p&gt;

&lt;p&gt;Full disclosure up front: we are Themesic Interactive, and we build and sell Mailbox, the module this article walks through. It is the number 2 best-seller in our catalog with 1835 sales on CodeCanyon and 4.78/5 from 41 verified CodeCanyon reviews, so read this as a guided tour with the vendor bias declared, not a neutral review.&lt;/p&gt;

&lt;h2&gt;
  
  
  The context-switching tax, in practice
&lt;/h2&gt;

&lt;p&gt;The tax is not the two seconds a tab switch takes. It is what gets dropped in transit. An email arrives from a client; the agent answers it in webmail and never files it in the CRM, so the next colleague who opens that client's profile sees nothing. A billing question gets a cheerful reply from someone who never noticed the client has an overdue invoice, because the balance was two tabs away.&lt;/p&gt;

&lt;p&gt;The common workarounds - BCC-to-CRM addresses, browser extensions - fail the same way: they depend on a human remembering an extra step on every single message. The structural fix is to reverse the direction: instead of pushing individual emails into the CRM, pull the whole inbox in and make the filing automatic.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a Perfex CRM email client actually changes
&lt;/h2&gt;

&lt;p&gt;Mailbox connects each staff member's own IMAP account to Perfex's admin area. Everyone gets a Gmail-style inbox inside the CRM: threaded conversations with collapsible replies, a split preview pane, archive and snooze, stars and important flags, multi-filter search, bulk actions, and three density settings (Cozy, Comfortable, Compact). Company email is centralized while inboxes stay separate and private - each user signs in with their own profile email address and maps their own Sent, Drafts, Trash, Spam and Archive folders.&lt;/p&gt;

&lt;p&gt;The CRM side is where it earns its keep. Open any message and a sender context sidebar shows the whole relationship at a glance: company, open invoices, overdue balance, open tickets and recent conversation history, with a direct link to the customer or lead profile. From the same message you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;assign it to a customer, so the thread lives on that profile next to invoices, projects and tickets&lt;/li&gt;
&lt;li&gt;convert it to a task, with an assignee and a deadline, linked back to the conversation&lt;/li&gt;
&lt;li&gt;convert it to a support ticket, tagged, prioritized and routed to the right department&lt;/li&gt;
&lt;li&gt;link it to a lead, where a dedicated Conversation tab collects every assigned email into one history&lt;/li&gt;
&lt;li&gt;raise an estimate, invoice or proposal in one click, pre-filled for the linked customer or lead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most of the filing you never do at all. Smart CRM auto-link matches the sender of every incoming message against your records and attaches it to the right customer or lead as it arrives. It is deliberately conservative: only an exact, single, active match is linked; an ambiguous address is left for a human to decide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automation: rules, lead capture and follow-ups
&lt;/h2&gt;

&lt;p&gt;The rules engine matches on sender, subject, body or recipient, then acts inside the CRM: link the message to a client or lead, capture a brand-new lead, create a task or a support ticket, assign it to a staff member, snooze it, star it or tag it. Build the workflow once and incoming mail routes itself. Auto lead capture goes a step further: a message from an unknown sender to your sales address becomes a Perfex lead on its own, filed against the original conversation. It is careful about noise - newsletters, no-reply addresses and system notifications are skipped, existing contacts and leads are never duplicated, and a rejected lead is not recreated by the next email.&lt;/p&gt;

&lt;p&gt;Two features target dropped conversations. Follow-up reminders let you flag a sent email with a remind-me-if-no-reply timer; if the client answers, the reminder cancels itself, and if they stay silent you get a Perfex notification at the right moment. First-response tracking gives incoming messages Due soon, Overdue or Answered in time badges against a target you set, with automated senders ignored because a newsletter is not a case to answer.&lt;/p&gt;

&lt;p&gt;On the compose side there are reusable templates and signature management, saved replies (personal or shared, with merge tags such as {contact_firstname} and {client_company} filled from the email you are answering), a WYSIWYG editor with attachments and inline images, keyboard shortcuts, and Send Later scheduling. Color-coded tags and labels, nested folders and quick-move actions handle triage at volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the sync actually does (developer notes)
&lt;/h2&gt;

&lt;p&gt;Under the hood Mailbox runs on Webklex/php-imap v4.x. By default it performs a one-way sync: unread inbox mail is fetched into Perfex in the background via Perfex's cron, and actions like Star, Trash and Important are stored locally in the database along with attachments. A manual sync endpoint pulls mail on demand. Optionally, per-staff read status sync writes the read state back to your mail server, so opening a message in Perfex marks it read in Gmail or Outlook too.&lt;/p&gt;

&lt;p&gt;Each sync mode (unread only versus fetch all) keeps its own checkpoint, so toggling the setting does not skip older messages or re-import already-synced mail. UIDVALIDITY tracking stops mailbox rebuilds and migrations from silently skipping new mail. Message bodies are fetched once per cycle, batch processing covers the initial sync of large inboxes, and database indexes plus full-text search across subject and body (with an automatic fallback on older MySQL versions) keep the list view responsive.&lt;/p&gt;

&lt;p&gt;Authentication is OAuth2 for Gmail and Outlook - tokens encrypted and refreshed automatically, Outlook handled through a single Exchange Online resource with SMTP XOAUTH2 sending - and AES-256-CBC encryption where passwords are still used. The module has been through a security audit and hardened on the back of it: staff mail is strictly scoped to its owner across every view and action, email content is sanitized against a strict allowlist, attachments are served through an authenticated download-only endpoint that cannot execute, state-changing actions require POST, and the OAuth flow validates an anti-CSRF state token.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who benefits, and who does not
&lt;/h2&gt;

&lt;p&gt;The teams that gain the most already live in Perfex all day. Support agents get ticket conversion and first-response badges in the same pane where they read mail. Salespeople get lead linking, auto-captured leads, the Conversation tab, follow-up reminders that cancel themselves, and every linked email written to the lead's native activity feed. Anyone who invoices gets the overdue balance staring at them before they hit reply.&lt;/p&gt;

&lt;p&gt;Honest limits: if your team spends its day in Gmail or Outlook and only opens the CRM weekly, moving the inbox into Perfex solves a problem you do not have. The default sync is one-way - beyond the optional read-status write-back, stars and deletions live in Perfex's database, not on your mail server. POP-only accounts are not supported; you need IMAP with SSL/TLS. Only Gmail and Outlook get OAuth2; with any other provider, an account using two-factor authentication needs it disabled before the mail server will accept the connection. A correctly configured Perfex cron is a hard requirement, since fetching happens in the background, and outbound mail goes through Perfex's own outgoing email settings, with sent messages stored in the module's Sent folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key facts
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fact&lt;/th&gt;
&lt;th&gt;Detail&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Current version&lt;/td&gt;
&lt;td&gt;2.3.1 (updated 2026-08-03)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requires&lt;/td&gt;
&lt;td&gt;Perfex CRM, PHP 7.4 or newer, working cron&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mail protocol&lt;/td&gt;
&lt;td&gt;IMAP over SSL/TLS (POP not supported)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;OAuth2 for Gmail and Outlook; AES-256-CBC for stored passwords&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Track record&lt;/td&gt;
&lt;td&gt;1835 sales on CodeCanyon, 4.78/5 from 41 verified CodeCanyon reviews&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Mailbox is a one-time purchase, with a yearly Pro license for teams that want lifetime support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://themesic.com/product/mailbox-webmail-based-e-mail-client-module-for-perfex-crm/" rel="noopener noreferrer"&gt;Mailbox - webmail email client module for Perfex CRM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://themesic.com/product-category/perfex-crm-modules/" rel="noopener noreferrer"&gt;All Perfex CRM modules by Themesic Interactive&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have questions about the sync model, the rules engine, or whether this fits your setup, ask in the comments - we read all of them.&lt;/p&gt;

</description>
      <category>php</category>
      <category>productivity</category>
      <category>automation</category>
      <category>business</category>
    </item>
    <item>
      <title>MCP Server for CRM AI Agents: Design Notes From Shipping One in PHP</title>
      <dc:creator>Themesic Interactive</dc:creator>
      <pubDate>Mon, 03 Aug 2026 16:22:21 +0000</pubDate>
      <link>https://dev.to/themesic/mcp-server-for-crm-ai-agents-design-notes-from-shipping-one-in-php-1c7k</link>
      <guid>https://dev.to/themesic/mcp-server-for-crm-ai-agents-design-notes-from-shipping-one-in-php-1c7k</guid>
      <description>&lt;p&gt;MCP support went from a niche spec to a standard buyer question faster than most of us expected. If you ship developer-facing software, someone has probably already asked whether Claude, ChatGPT, Cursor or an n8n agent can talk to it, and for most self-hosted products the honest answer is "not safely." We recently shipped a native MCP server for CRM AI agents inside Perfex CRM, a self-hosted PHP application, and this post walks through the design decisions: where the JSON-RPC 2.0 endpoint lives, why we permission-filter 148 tools per API token instead of exposing everything, and why read-only is our default posture. Full disclosure: we build and sell the module discussed here, but the trade-offs apply to anyone embedding MCP in an existing product.&lt;/p&gt;

&lt;p&gt;Some context so the constraints make sense. Our REST API module for Perfex CRM (currently v3.0.3) exposed CRM resources - customers, leads, invoices, projects, tasks, tickets - over plain REST for many releases before v3, with per-token permissions deciding what each integration may touch. Version 3 added the MCP layer on top of that existing surface, and that turned out to be the most important architectural fact of the whole project: we did not design an agent interface from scratch, we projected an already permissioned API into the MCP tool model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the MCP server lives inside the PHP app
&lt;/h2&gt;

&lt;p&gt;The path of least resistance would have been a bridge: a small Node or Python process that speaks MCP on one side and calls the REST API on the other. Many MCP servers for existing products are built this way, and for a hosted SaaS with a single deployment it can be a fine answer.&lt;/p&gt;

&lt;p&gt;For self-hosted software it falls apart at distribution. Perfex installs run in environments their owners control and we do not - often shared hosting or a small VPS - and asking an administrator to operate a second long-lived process next to a PHP app is a support burden at best and impossible at worst. A bridge also duplicates state: the API token lives in the CRM, a copy lives in the bridge config, and the permission model has to be re-implemented there or, more commonly, skipped.&lt;/p&gt;

&lt;p&gt;So the MCP server is native. The endpoint is POST /api/mcp, speaking JSON-RPC 2.0 over Streamable HTTP, and it ships inside the same module as the REST API, enabled by a toggle in the module's platform settings. This matches PHP's execution model surprisingly well: with Streamable HTTP each JSON-RPC message arrives as an ordinary HTTP POST, so there is no resident process to babysit - just the request-per-execution model PHP has always had. Authentication reuses the existing API tokens (sent in the authtoken header, created in the API Management screen under Setup in the admin area), so an agent presents exactly the credential any integration would, and the same middleware evaluates it.&lt;/p&gt;

&lt;h2&gt;
  
  
  An MCP server for CRM AI agents should not expose everything
&lt;/h2&gt;

&lt;p&gt;The module defines 148 tools. A naive MCP integration would return all of them from tools/list and enforce permissions only when a tool is called. We rejected that, and it is the decision we would defend hardest.&lt;/p&gt;

&lt;p&gt;Instead, tools/list is permission-filtered: a tool appears only if the token behind the request holds the matching permission. Grants are per resource and per verb - Get, Create, Update, Delete - so a token limited to reading invoices produces a short tool list that can read invoices and do nothing else. Granting a capability in the permission editor is the same act that makes its tools visible to an agent.&lt;/p&gt;

&lt;p&gt;Three reasons drove this. First, context economics: every tool definition you return is prompt space the client model has to carry, and tool-selection accuracy degrades as the list grows. An agent doing invoice lookups gains nothing from the schemas of tools it can never call. Second, security shape: a capability that is never listed cannot be called, planned around or hallucinated into a multi-step workflow; failing at list time is a stronger invariant than failing at call time. Third, honesty in errors: the expose-everything approach produces agents that confidently attempt forbidden operations, burn a round trip, then improvise around a 403. Filtering the list keeps the model's picture of the world consistent with its actual authority.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read-only agents as the safety default
&lt;/h2&gt;

&lt;p&gt;LLM agents are probabilistic. A wrong search is a wasted call; a wrong delete is an incident. So our recommended starting posture is a read-only token per agent. The permission editor has a one-click Read-only preset for exactly this reason, alongside per-token request limits, quotas and expiry dates.&lt;/p&gt;

&lt;p&gt;The upgrade path is deliberate: run the agent read-only until the workflow proves out, then grant Create or Update on the specific resources it needs, one at a time. For write paths, the API supports an Idempotency-Key header on POST, so a retried create replays the stored response instead of duplicating a record - a property that matters more with agents than with humans, because agents retry enthusiastically. There is also an optional staff-level visibility mode that ties a token to a staff member, scoping data exactly the way the admin panel would for that user.&lt;/p&gt;

&lt;h2&gt;
  
  
  What agents are actually good at against a CRM
&lt;/h2&gt;

&lt;p&gt;The pattern from our own testing is consistent: agents shine at judgment over small result sets and are a poor fit for repetition.&lt;/p&gt;

&lt;p&gt;Good agent tasks look like "find this customer, summarize their open tickets and unpaid invoices, and draft the follow-up", cross-resource questions that would otherwise mean four admin screens, and first-draft record creation where a human reviews before anything is sent. The query itself is fuzzy and the value is synthesis.&lt;/p&gt;

&lt;p&gt;Repetitive, fully specified work belongs on the deterministic side of the same module. The OpenAPI spec at GET /api/openapi documents 72 paths and 139 operations for coded integrations, with a reference copy in our examples repository; POST /api/batch executes up to 50 operations in one request; 124 webhook events across 22 event groups push changes out, HMAC-signed and delivered asynchronously with retries; and the n8n community node &lt;a class="mentioned-user" href="https://dev.to/themesic"&gt;@themesic&lt;/a&gt;/n8n-nodes-perfex-crm covers 19 resources with 108 operations plus a polling trigger, next to native Zapier and Make polling endpoints. The rule of thumb we give customers: if you can write the steps down exactly, use REST, batch or a workflow tool; if the steps require reading and deciding, use the MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this approach is the wrong tool
&lt;/h2&gt;

&lt;p&gt;An honest limits section, because MCP is having a hype moment. Do not point an agent at bulk data migration or high-volume sync - per-step LLM latency and token cost make it strictly worse than a scripted REST client, which is what the batch endpoint is for. Do not give an unattended agent write access to financial records; keep a human in the loop for anything that emails a customer or touches money. And if your needs are purely Zapier-style automation with no natural-language component, the connectors will serve you better than MCP will. The MCP server is a complement to the API, not a replacement for engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key facts
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Detail&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Module version&lt;/td&gt;
&lt;td&gt;3.0.3 (updated 2026-08-03)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP endpoint&lt;/td&gt;
&lt;td&gt;POST /api/mcp, JSON-RPC 2.0, Streamable HTTP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tools&lt;/td&gt;
&lt;td&gt;148, permission-filtered per API token&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;REST surface&lt;/td&gt;
&lt;td&gt;72 paths, 139 operations (OpenAPI at GET /api/openapi)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Webhooks&lt;/td&gt;
&lt;td&gt;124 events in 22 groups, HMAC-signed, async retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batch&lt;/td&gt;
&lt;td&gt;POST /api/batch, up to 50 operations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Track record&lt;/td&gt;
&lt;td&gt;2,941 sales on CodeCanyon, rated 4.91/5 from 44 verified CodeCanyon reviews&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://themesic.com/product/rest-api-module-for-perfex-crm-connect-your-perfex-crm-with-third-party-applications/" rel="noopener noreferrer"&gt;REST API module for Perfex CRM - product page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://themesic.com/product-category/perfex-crm-modules/" rel="noopener noreferrer"&gt;All Perfex CRM modules&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/themesic/perfex-rest-api-examples" rel="noopener noreferrer"&gt;Examples repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/themesic/perfex-rest-api-examples/blob/main/docs/mcp.md" rel="noopener noreferrer"&gt;MCP setup guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are embedding MCP in your own product and made different calls on tool filtering or write access, we would genuinely like to hear how it went - questions and pushback welcome in the comments.&lt;/p&gt;

</description>
      <category>php</category>
      <category>api</category>
      <category>ai</category>
      <category>automation</category>
    </item>
    <item>
      <title>Perfex CRM n8n Automation: 5 Practical Workflows You Can Build Today</title>
      <dc:creator>Themesic Interactive</dc:creator>
      <pubDate>Mon, 03 Aug 2026 16:22:18 +0000</pubDate>
      <link>https://dev.to/themesic/perfex-crm-n8n-automation-5-practical-workflows-you-can-build-today-594e</link>
      <guid>https://dev.to/themesic/perfex-crm-n8n-automation-5-practical-workflows-you-can-build-today-594e</guid>
      <description>&lt;p&gt;Perfex CRM is good at being a CRM and quiet about everything else. Leads land on your website and someone retypes them into the admin panel. Invoices go out and follow-up depends on somebody's memory. Finance wants a payments spreadsheet every Monday. This is a hands-on guide to Perfex CRM n8n automation: five workflows built with the free &lt;a class="mentioned-user" href="https://dev.to/themesic"&gt;@themesic&lt;/a&gt;/n8n-nodes-perfex-crm community node, covering lead capture, invoice follow-ups, a scheduled export to Google Sheets, webhook-driven ticket routing, and wiring the node into an n8n AI Agent. Full disclosure: we build and sell the REST API module for Perfex CRM that the node talks to. The node itself is free and open source.&lt;/p&gt;

&lt;p&gt;Why n8n rather than a hosted automation service? Because both halves of the stack can live on your own servers. Perfex is self-hosted and n8n can be self-hosted, so customer data never passes through a third-party automation cloud, and there are no per-task fees when a busy workflow fires ten thousand times a month. Perfex does not ship a full REST API of its own, so the module supplies one: version 3.0.3 documents 72 paths and 139 operations in an OpenAPI 3.0 spec served at GET /api/openapi, with a reference copy in our examples repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: the module, a token, and the community node
&lt;/h2&gt;

&lt;p&gt;Three steps before the fun part.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install and activate the REST API module in Perfex. Activation takes seconds and there is no core patching.&lt;/li&gt;
&lt;li&gt;Create an API token under Setup, then API, then API Management. Permissions are granular per resource (Get, Create, Update, Delete), so give each workflow's token only what it needs. A lead-capture token has no business holding Delete on invoices.&lt;/li&gt;
&lt;li&gt;In n8n, open Settings, then Community Nodes, and install &lt;a class="mentioned-user" href="https://dev.to/themesic"&gt;@themesic&lt;/a&gt;/n8n-nodes-perfex-crm. Add a credential with your Perfex URL and the token; the node authenticates every request with the authtoken header.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The node covers 19 resources with 108 operations plus a polling trigger, which is enough for everything below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five Perfex CRM n8n automation workflows
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Website lead capture
&lt;/h3&gt;

&lt;p&gt;The classic first workflow. An n8n Webhook node receives the POST from your website form, a Set node maps the form fields to lead fields, and the Perfex node creates the lead. Every create response from the API includes a record_id, so you can chain a step that notifies your team with a link to the new lead, or sets source and assignment in the same run. Once this works, the retyping stops for good.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. New-invoice follow-up
&lt;/h3&gt;

&lt;p&gt;Use the node's polling trigger to watch for new invoices. When one appears, log it, wait the number of days your follow-up policy says, then re-fetch the invoice and check whether it has been paid. If not, send the reminder. The module exposes invoice emailing over the API (POST /api/invoices/{id}/send), so the reminder can come from Perfex itself, or you can send it from n8n's own email nodes. One detail worth knowing: invoice totals are computed server-side from line items, taxes and discounts, so use the amounts the API returns rather than recalculating them in the workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Scheduled payments export to Google Sheets
&lt;/h3&gt;

&lt;p&gt;A Schedule trigger fires Monday at 07:00, the Payments resource lists last week's payments using the API's date-range filters (created_after and created_before), and a Google Sheets node appends the rows. Every list endpoint in the API shares a unified toolkit - pagination, sorting, field selection and date-range filtering - so you can pull only the columns the sheet needs instead of full records. Finance gets the same spreadsheet every week and nobody exports anything by hand.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Support ticket routing via webhooks
&lt;/h3&gt;

&lt;p&gt;Polling is fine for invoices; tickets deserve push. The module's Webhooks 2.0 catalog covers 124 events across 22 event groups. Create a webhook pointing at an n8n Webhook node URL and subscribe to the ticket events. In the workflow, verify the HMAC signature first - deliveries are signed with a timestamp in the X-Perfex-Signature header for verification and replay protection - and only then trust the payload. A Switch node does the routing: billing keywords assign the ticket to the billing department, urgent phrasing bumps the priority, everything else takes the default lane, each branch calling the node's ticket update operation. Delivery is asynchronous with automatic retries, so a short n8n restart does not silently drop events.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The node as a tool for the n8n AI Agent
&lt;/h3&gt;

&lt;p&gt;n8n can hand nodes to its AI Agent as tools, and the Perfex node is no exception. Attach it with a read-mostly token and the agent can answer questions like "which invoices went out last week" or "summarize the open tickets" against live CRM data. Two guardrails we recommend: give the agent its own dedicated token so its permissions are auditable in one place, and start read-only, adding write operations one at a time as trust builds. If you want to go deeper, the module also ships a native MCP server at POST /api/mcp (JSON-RPC 2.0) exposing 148 permission-filtered tools - a second route into the same CRM for AI agents, with the tool list filtered by the same token permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key facts
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fact&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Module version&lt;/td&gt;
&lt;td&gt;3.0.3, updated 2026-08-03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Documented API surface&lt;/td&gt;
&lt;td&gt;72 paths, 139 operations (OpenAPI 3.0 at GET /api/openapi)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;n8n community node&lt;/td&gt;
&lt;td&gt;19 resources, 108 operations, plus a polling trigger&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Webhooks&lt;/td&gt;
&lt;td&gt;124 events in 22 groups, HMAC-signed, async with retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP server&lt;/td&gt;
&lt;td&gt;POST /api/mcp, JSON-RPC 2.0, 148 permission-filtered tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batch endpoint&lt;/td&gt;
&lt;td&gt;POST /api/batch, up to 50 operations per request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Track record&lt;/td&gt;
&lt;td&gt;4.91/5 from 44 verified CodeCanyon reviews, 2,941 sales on CodeCanyon&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  When this is not the right tool
&lt;/h2&gt;

&lt;p&gt;If all you need is a single one-way push - a nightly script that inserts leads from a CSV, say - a short script against the API directly is simpler than operating an n8n instance, and the examples repo, which also carries a reference copy of the OpenAPI spec, is the place to start for direct calls. The module assumes you are comfortable with REST basics; if tokens and JSON payloads are unfamiliar territory, budget for setup help. Operationally: asynchronous webhook delivery works best with a cron job on the Perfex host (there is an admin-load fallback, but a queue that only drains when someone opens the admin panel is not what you want under ticket routing), batch calls cap at 50 operations per request, and self-hosting n8n means updates and backups are your job, not a vendor's. The module is a paid one-time purchase; the n8n node is free but does nothing without it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://themesic.com/product/rest-api-module-for-perfex-crm-connect-your-perfex-crm-with-third-party-applications/" rel="noopener noreferrer"&gt;REST API module for Perfex CRM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://themesic.com/product-category/perfex-crm-modules/" rel="noopener noreferrer"&gt;All Perfex CRM modules&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/themesic/n8n-nodes-perfex-crm" rel="noopener noreferrer"&gt;n8n community node on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/themesic/perfex-rest-api-examples" rel="noopener noreferrer"&gt;Perfex REST API examples repo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build one of these workflows, or get stuck halfway through one, tell us in the comments - we read and answer them.&lt;/p&gt;

</description>
      <category>api</category>
      <category>automation</category>
      <category>tutorial</category>
      <category>php</category>
    </item>
    <item>
      <title>Automating Perfex CRM with a REST API: webhooks, OpenAPI and MCP for AI agents</title>
      <dc:creator>Themesic Interactive</dc:creator>
      <pubDate>Mon, 03 Aug 2026 12:51:25 +0000</pubDate>
      <link>https://dev.to/themesic/automating-perfex-crm-with-a-rest-api-webhooks-openapi-and-mcp-for-ai-agents-4ghe</link>
      <guid>https://dev.to/themesic/automating-perfex-crm-with-a-rest-api-webhooks-openapi-and-mcp-for-ai-agents-4ghe</guid>
      <description>&lt;p&gt;&lt;strong&gt;Full disclosure up front: we build the module discussed here.&lt;/strong&gt; This is Themesic Interactive's own writeup of the REST API module for Perfex CRM. Every number below is verifiable - the OpenAPI spec, the Postman collection and copy-paste examples all live in a public GitHub repo linked at the end, and you can regenerate the spec from any installation yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gap
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.perfexcrm.com/" rel="noopener noreferrer"&gt;Perfex CRM&lt;/a&gt; is a popular self-hosted PHP CRM. Out of the box it has &lt;strong&gt;no REST API&lt;/strong&gt;: no endpoint to create a lead from your website form, no way for n8n or Zapier to react to a new invoice, nothing an AI agent can call.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://themesic.com/product/rest-api-module-for-perfex-crm-connect-your-perfex-crm-with-third-party-applications/" rel="noopener noreferrer"&gt;REST API for Perfex CRM&lt;/a&gt; module adds that layer: &lt;strong&gt;72 paths and 139 operations&lt;/strong&gt; over the CRM's entities (customers, contacts, leads, invoices, estimates, proposals, credit notes, payments, projects, tasks, milestones, tickets, contracts, expenses, items, staff, subscriptions, timesheets, calendar, knowledge base, notes), plus webhooks, a batch endpoint and an MCP server. On CodeCanyon it is rated 4.91/5 from 44 verified reviews across 2,941 sales, and v3.0.3 is the release this article uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  60 seconds to your first request
&lt;/h2&gt;

&lt;p&gt;Install the module, then create a token under &lt;strong&gt;Setup &amp;gt; API &amp;gt; API Management&lt;/strong&gt; in the Perfex admin. Every request authenticates with the &lt;code&gt;authtoken&lt;/code&gt; header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"authtoken: YOUR_API_TOKEN"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"https://your-perfex-url/api/customers?page=1&amp;amp;per_page=25"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a lead from anywhere (a landing page handler, a cron job, a chatbot):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://your-perfex-url/api/leads"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"authtoken: YOUR_API_TOKEN"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"name": "Jane Doe", "source": "2", "status": "1", "email": "jane@example.com"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List endpoints take opt-in modifiers, so you only pull what you need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /api/invoices?fields=id,total,status&amp;amp;sort=-date
GET /api/customers?created_after=2026-01-01&amp;amp;created_before=2026-06-30
GET /api/leads/search/acme
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Writes support an &lt;code&gt;Idempotency-Key&lt;/code&gt; header for safe retries, and responses carry &lt;code&gt;X-RateLimit-*&lt;/code&gt; headers so your integration can back off politely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webhooks instead of polling
&lt;/h2&gt;

&lt;p&gt;Since v3.0 the module ships &lt;strong&gt;124 webhook events across 22 event groups&lt;/strong&gt;, managed entirely over REST:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /api/webhooks              # subscribe a URL to events
GET  /api/webhooks/events       # list all 124 available events
POST /api/webhooks/{id}/toggle  # pause and resume
GET  /api/webhooks/{id}/logs    # delivery history for debugging
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deliveries are asynchronous with retries, requests are &lt;strong&gt;HMAC-signed&lt;/strong&gt; so your receiver can authenticate the payload, and outbound URLs go through SSRF protection. For polling-based tools (Zapier, Make, n8n's trigger nodes) there are ready-made polling endpoints as well, and a &lt;code&gt;POST /api/batch&lt;/code&gt; endpoint runs up to 50 operations in one request.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole API as one file: OpenAPI
&lt;/h2&gt;

&lt;p&gt;The module describes its entire surface as an OpenAPI 3.0 document, generated live by the installation itself so it always matches the installed version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"authtoken: YOUR_API_TOKEN"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  https://your-perfex-url/api/openapi &lt;span class="nt"&gt;-o&lt;/span&gt; perfex-rest-api.openapi.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Import that file into Postman, Insomnia or Stoplight and every endpoint, parameter and response shape appears ready to call. Feed it to &lt;code&gt;openapi-generator&lt;/code&gt; for typed clients in PHP, Python or TypeScript. A &lt;a href="https://github.com/themesic/perfex-rest-api-examples/tree/main/openapi" rel="noopener noreferrer"&gt;reference copy exported from v3.0.3&lt;/a&gt; is committed in the examples repo if you want to inspect it before installing anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP: letting AI agents work the CRM
&lt;/h2&gt;

&lt;p&gt;The part we get the most questions about. v3.0 added a native &lt;strong&gt;Model Context Protocol (MCP) server&lt;/strong&gt; at &lt;code&gt;POST /api/mcp&lt;/code&gt; (JSON-RPC 2.0). It exposes &lt;strong&gt;148 CRM tools&lt;/strong&gt; - create invoice, update lead, search customers, log a payment - to Claude Desktop, Cursor, n8n AI Agent nodes and any other MCP client.&lt;/p&gt;

&lt;p&gt;The important design decision: tools are &lt;strong&gt;permission-filtered&lt;/strong&gt;. The MCP server only exposes the operations the API token is allowed to perform, so an agent connected with a read-only token physically cannot write to the CRM. Setup for specific clients is documented in the repo's &lt;a href="https://github.com/themesic/perfex-rest-api-examples/blob/main/docs/mcp.md" rel="noopener noreferrer"&gt;MCP guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you use n8n, there is also a dedicated community node package: &lt;a href="https://github.com/themesic/n8n-nodes-perfex-crm" rel="noopener noreferrer"&gt;n8n-nodes-perfex-crm&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers, in one place
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Figure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;REST surface&lt;/td&gt;
&lt;td&gt;72 paths, 139 operations (OpenAPI 3.0)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Webhooks&lt;/td&gt;
&lt;td&gt;124 events, HMAC-signed, async with retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP tools for AI agents&lt;/td&gt;
&lt;td&gt;148, permission-filtered&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batch&lt;/td&gt;
&lt;td&gt;up to 50 operations per request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automation&lt;/td&gt;
&lt;td&gt;native n8n, Zapier, Make polling endpoints&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Track record&lt;/td&gt;
&lt;td&gt;4.91/5 from 44 verified CodeCanyon reviews, 2,941 sales&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Examples, Postman collection, OpenAPI spec: &lt;a href="https://github.com/themesic/perfex-rest-api-examples" rel="noopener noreferrer"&gt;github.com/themesic/perfex-rest-api-examples&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live API guide: &lt;a href="https://perfexcrm.themesic.com/apiguide/" rel="noopener noreferrer"&gt;perfexcrm.themesic.com/apiguide&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The module itself: &lt;a href="https://themesic.com/product/rest-api-module-for-perfex-crm-connect-your-perfex-crm-with-third-party-applications/" rel="noopener noreferrer"&gt;themesic.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Questions about integrating Perfex with something specific? Ask in the comments - we read them.&lt;/p&gt;

</description>
      <category>api</category>
      <category>php</category>
      <category>automation</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
