Perfex Connect documentation

Perfex Connect is the integration and automation hub for Perfex CRM. It adds a REST API for every core resource with keys you control, events for every change that you can send to webhooks, catch-hooks that take data in, automation rules, ready integrations for Zapier, Make, n8n, Facebook and Instagram Lead Ads and WooCommerce, and an MCP server for AI assistants.

By the numbers (Connect on a plain Perfex 3.4, counted from the code): 39 API resources · 486 API operations in an OpenAPI 3.1 file generated from the code · 119 event types · 197 MCP tools (9 in the compact tool style) · 31 workflow recipes · 9 languages · 2,600+ automated checks in the release test suites. Other modules add their own resources and events (Product Hub adds four resources).

Everything lives under Connect in the Perfex sidebar. The pages share one header with a Safe mode switch: while it is on, nothing is sent out (see Safe mode).

Installation

Requirements

Install

  1. Back up the CRM database and files.
  2. Extract the download perfex-connect-1.1.1.zip on your computer. Inside are the installable perfex_connect-1.1.1.zip, this documentation, the developer kits, the changelog and the licenses.
  3. In Perfex, open Setup › Modules, upload the inner perfex_connect-1.1.1.zip, then install and activate Perfex Connect.
  4. Open Connect in the sidebar. The overview shows the health checks and the cards of every part.
What activation does: creates the module's tables and settings and the staff permissions. It does not modify Perfex core files. No address is reachable without a key you create, and nothing is sent anywhere until you add a webhook, a rule or an integration.

Files and tables

WhereWhat
modules/perfex_connect/The module, with its interface font and icons. Nothing is loaded from a CDN. kits/ holds the templates of the developer kits and recipes.
Tables pcx_*API keys (hashed), request log, idempotency, events, jobs, audit trail, webhooks and deliveries, inbound hooks and their log, rules and runs, integrations, sync map and log, MCP tokens and calls.
Options pcx_*Settings. Secrets (webhook signing secrets, Meta app secret, WooCommerce keys, tokens) are encrypted with your installation's key.

Server notes

First steps

  1. Check that Perfex's cron runs: the overview's Scheduled work check says when it last ran.
  2. Open Connect › API Keys, click New key, choose a name, the staff member the key acts as, the scopes and, if you like, limits, allowed addresses and an expiry. Copy the key — it is shown once.
  3. Open Connect › API Docs, pick List customers, choose the key in Try it and press Send request.
  4. Add a webhook (Connect › Webhooks › New webhook) or connect an automation platform (Connect › Integrations).
  5. In Setup › Staff › Roles, give the right Connect permissions to the people who manage integrations (see Permissions).
The Connect overview with health checks and cards
Overview: health checks, the cards of every part, the latest API calls and activity.

API keys and scopes

A key belongs to one staff member: every API call runs with that member's Perfex permissions. A key of an administrator sees everything; a member with View (Own) on invoices only gets their own invoices. On top of that, the key's scopes decide which resources it may use.

SettingMeaning
Scopes<resource>:read or <resource>:write (write includes read), *:read for everything read-only, * for everything. Area scopes: webhooks:read|write (subscriptions), events:read (event log), automations:read|write (rules).
LimitsRequests per minute and per day; empty = the defaults in Settings › Default limits for API keys (120 a minute, 20,000 a day).
Allowed addressesOne IPv4 / IPv6 address or CIDR range per line; empty = any address.
ExpiryThe key stops working after this date.
NoteFor you: what uses this key.

Keys look like pcx_live_ followed by 48 characters. Connect stores only a SHA-256 hash and the first characters for display, so a lost key cannot be shown again: rotate it (new secret, same settings) or create a new one. Revoke stops a key at once. Administrators can create keys for any staff member; other staff with the Manage API keys right only for themselves.

The new key dialog with staff member, scopes, limits, allowed addresses and expiry
A new key: staff member, scopes, limits, allowed addresses and expiry.
The API keys list with scopes, limits, last use and status
API Keys: scopes, limits, last use and status of every key.

REST API

The base address is https://<your-crm>/perfex_connect/api/v1. Everything answers JSON. Resources: customers, contacts, leads, lead statuses and sources, projects, milestones, tasks, timesheets, tickets, ticket statuses, priorities and services, departments, invoices, estimates, proposals, contracts and contract types, expenses and expense categories, payments and payment modes, credit notes, items and item groups, staff, custom fields, files, calendar, notes, reminders, knowledge base articles and groups, currencies, taxes, countries, customer groups and statuses. GET /resources lists them with their fields; GET /me tells who a key is.

Authentication

curl https://crm.example.com/perfex_connect/api/v1/me \
  -H "Authorization: Bearer pcx_live_…"

Only the Authorization: Bearer header is accepted — never a key in the address, never a Perfex session cookie. Wrong keys answer 401; after 30 failures a minute from one address, that address waits a minute.

Lists and filters

ParameterExample
page, per_pagepage=2&per_page=100 (1–200, default 25)
sortsort=-datecreated,company (“-” = descending)
qq=northwind — searches the resource's searchable fields
filter[field]filter[status]=2
filter[field][op]filter[total][gte]=500; ops eq ne gt gte lt lte in like null (in takes a comma list, null 1 or 0)
created_since, updated_sinceupdated_since=2026-10-01T00:00:00Z
fieldsfields=id,company,city
includeinclude=customer,custom_fields
{
  "data": [ { "id": 63, "company": "Northwind Agency", "city": "Portland" } ],
  "meta": { "page": 1, "per_page": 25, "total": 1, "total_pages": 1 },
  "links": { "next": null, "prev": null }
}

Related records sit under their parent, for example /customers/63/contacts, /customers/63/invoices, /projects/12/tasks, /tasks/40/comments, /tickets/9/replies. Actions: POST /invoices/{id}/send, /invoices/{id}/mark, /estimates/{id}/convert and the same for proposals, contracts and credit notes. Each resource's fields, filters and sorts are listed in the in-app reference.

Writes

curl -X POST https://crm.example.com/perfex_connect/api/v1/leads \
  -H "Authorization: Bearer pcx_live_…" -H "Content-Type: application/json" \
  -H "Idempotency-Key: form-2026-10-16-0042" \
  -d '{"name":"Hannah Price","email":"hannah.price@example.com","company":"Price & Partners","source":1}'

Errors and limits

{ "error": { "code": "validation_failed", "message": "Validation failed for 1 field.",
             "details": { "name": "This field is required." }, "request_id": "a1b2…" } }
StatusCodeWhen
400bad_requestThe body or a parameter cannot be read.
401unauthorizedNo key, a wrong, revoked or expired key, or an address outside the allow-list.
403insufficient_scope, forbiddenThe key lacks the scope, or its staff member lacks the Perfex permission.
404 / 405not_foundUnknown record or address; method not allowed.
409conflictIdempotency key reused with another body, or a duplicate.
412precondition_failedIf-Match no longer matches.
422validation_faileddetails holds a message per field.
429rate_limited, rate_limited_dayLimit reached; wait the seconds in Retry-After.

Every answer carries X-Request-Id (find the call in the request log with it) and X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Reference, OpenAPI and Postman

Connect › API Docs is the complete, interactive reference of your installation, generated from the live API (your custom fields included): every endpoint by resource, its parameters, fields and answers, snippets in curl, PHP, JavaScript and Python, and Try it with one of your keys — the request runs on the server, the key never reaches the browser. Staff may only use their own keys there; administrators any key. The machine-readable OpenAPI 3.1 document is at /perfex_connect/api/v1/openapi.json (public unless you switch that off in Settings › General; it describes fields, never data); Postman collection downloads a ready collection.

The API reference with resources, guides and an operation
API Docs: resources and guides on the left, the selected operation with Try it on the right.
Try it with an answer and the code snippets
Try it: the answer of a real call and the same call as code.

Request log

Connect › Request Log lists every API call: time, method, path, status and error code, duration, key and address. Filter by method, status, key, error code, path, period or request id. View shows the request and the answer with passwords, keys, tokens and similar fields masked. Replay sends the same request again as the same key (not for requests whose body was masked) — handy to reproduce a problem after a fix. Staff who are not administrators see only calls made with their own keys. The log is kept 30 days by default (Settings › Queue and retention).

A logged request with its headers, body and answer
One logged call: the masked request, the answer and Replay.

Events

Connect records an event (119 event types) whenever something changes in Perfex — through the Perfex screens, the client portal, other modules, the API, a rule or a sync. Names are <resource>.<action>:

The payload is the record exactly as the API shows it; updates also carry changes ({"field": [old, new]}) where Perfex tells the old value. Records without Perfex hooks (milestones, reminders, calendar, knowledge base, files, custom fields, currencies …) are watched on every cron run. Connect › Events lists the events with filters and a payload viewer; Replay sends an event to your webhooks again. Events are kept 90 days by default.

The event log with names, records, sources and times
Events: what happened, to which record, from which source.

Webhooks

Connect › Webhooks › New webhook: a name, an HTTPS address and the events — single names, a pattern such as invoice.*, or * for everything. Optional: extra headers (for the receiver's own authentication) and conditions on the payload. The signing secret is shown once after saving; Rotate secret makes a new one.

Each delivery is a POST with the event as JSON:

POST /hooks/perfex HTTP/1.1
Content-Type: application/json
X-Pcx-Event: invoice.paid
X-Pcx-Delivery: 5f0c…        (unique per delivery; use it to ignore repeats)
X-Pcx-Webhook: 9b27…
X-Pcx-Attempt: 1
X-Pcx-Signature: t=1760600000,v1=6a1f…

{ "id": "…", "event": "invoice.paid", "resource": "invoices", "occurred_at": "2026-10-16T09:12:44-04:00",
  "source": "ui", "data": { "id": 812, "number": "INV-000812", "total": "2640.00", … } }
Webhooks with their events, health and last answer
Webhooks: events, delivery health over 7 days, the last answer and status.
Failed deliveries with their attempts and the receiver's answer
Deliveries of an endpoint that answers 500: attempts, next retry and Redeliver.

Checking the signature

X-Pcx-Signature is t=<unix time>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" with the webhook's secret>. Recompute it over the raw body, compare in constant time and refuse old timestamps:

// PHP
$body = file_get_contents('php://input');
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_PCX_SIGNATURE'] ?? ''), $sig);
$ok = isset($sig['t'], $sig['v1']) && abs(time() - (int) $sig['t']) < 300
   && hash_equals(hash_hmac('sha256', $sig['t'] . '.' . $body, $secret), $sig['v1']);
// Node.js (Express with express.raw())
const [t, v1] = req.get('X-Pcx-Signature').split(',').map(p => p.split('=')[1]);
const mac = crypto.createHmac('sha256', secret).update(t + '.' + req.body).digest('hex');
const ok = Math.abs(Date.now() / 1000 - t) < 300 &&
           crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));

Subscription API (REST hooks)

Apps can manage their own webhooks with a key that has webhooks:write. A subscription made this way belongs to its key: it only receives events the key may read, and stops when the key is revoked or expires.

CallWhat
POST /webhooks/subscriptions{"target_url": "https://…", "event": "lead.created"} or "events": [...], optional name; answers data.id and the signing data.secret (once).
DELETE /webhooks/subscriptions/{id}Unsubscribe.
GET /webhooks/subscriptionsThe key's subscriptions; …/{id}/deliveries their deliveries.
GET /webhooks/eventsEvery event name with label and resource.
GET /webhooks/sample/{event}The last 3 payloads of that event, or one built from the resource's fields on a fresh install (for “test trigger” buttons).

The same calls are also available under /integrations/rest_hooks for platforms that expect that shape.

Catch-hooks (inbound webhooks)

Connect › Inbound Hooks › New hook gives you a private address https://<your-crm>/perfex_connect/hooks_in/<id> that turns a JSON or form post into a Perfex record.

curl -X POST https://crm.example.com/perfex_connect/hooks_in/3f9a… \
  -H "Content-Type: application/json" -H "X-Pcx-Token: inh_…" \
  -d '{"name":"Marcus Bell","email":"marcus.bell@example.com","company":"Bell Outdoor","message":"New website before spring"}'
Editing a catch-hook: target, mode, authentication and mapping
A catch-hook for the website contact form: target leads, token authentication and the mapping.
The log of a catch-hook with accepted and refused posts
The hook's log: created records, duplicates and refused posts.
A hook with authentication none in update or upsert mode lets anyone who knows the address change matched records. Keep token or HMAC for those.

Automation rules

A rule says: when <event> if <conditions> then <actions>. Open Connect › Automations, start from Templates (eleven ready-made rules: new lead → notify sales, new customer → onboarding task, urgent ticket → notify support, invoice paid → thank-you e-mail …) or New rule.

ActionWhat it does
Create a record / Update a recordAny resource, with templated fields ({{data.company}}).
Assign a staff member / Change the statusOn the event's record or another one.
Add a note / Create a taskRelated to the record, with assignees, priority and a due date in N days.
Notify staffA Perfex bell for chosen staff, the assigned member or the administrators, with a link.
Send an e-mail / Send an SMSThrough Perfex's mail settings, or its active SMS gateway.
Call a URLAn HTTPS request with a templated body, through the same guarded client as webhooks.
Raise a custom eventcustom.<name> for webhooks and other rules.
Wait / StopContinue the next actions after minutes, hours or days; end the run.

Texts take {{fields}} with filters: {{data.name|upper}}, {{data.duedate|date:d/m/Y}}, {{data.company|default:-}}, {{today}}, {{site.url}} … Dry run runs the rule on a sample event without acting; Runs lists every run with a step-by-step trace. A rule acts with the Perfex rights of the staff member who saved it (administrators' rules act as the system). Rules do not trigger each other unless you allow it on the rule; chains stop after three levels.

The rule builder with trigger, conditions and three actions
A rule: when a lead is created, if it names a company, assign it, create a call task and post to the team chat.
The runs of a rule with the trace of one run
Runs with the result of every action.

Zapier, Make and n8n

Connect › Integrations › Zapier · Make · n8n shows the REST hooks address and a guide per platform; Connect › Recipes & Kits has the downloads and 31 step-by-step recipes (see the gallery). Create one key per platform with only the scopes it needs plus webhooks:write for instant triggers.

Recipes and the developer kits
Recipes & Kits: the n8n and Zapier kits and the recipes.

n8n

  1. Download kit (n8n). The zip is an n8n community node package built for your CRM: Perfex Connect (an action node with every resource and operation) and Perfex Connect Trigger (every event).
  2. On a self-hosted n8n, install it as a community node: copy the unpacked folder to ~/.n8n/nodes/ and run npm install ./n8n-nodes-perfex-connect there (or publish it under your own npm scope and install it in Settings › Community nodes), then restart n8n. The README inside has the details.
  3. Add the credential Perfex Connect API: your CRM address and an API key.
  4. Use the trigger in a workflow; activating the workflow subscribes a webhook, deactivating it removes the subscription.

Without the kit, n8n's HTTP Request node works with the REST API and the Webhook node with a Connect webhook.

Zapier

  1. Download kit (Zapier): a Zapier CLI project with API-key authentication (tested on /me), an instant trigger per event (REST hooks with sample data), and a create and a find action per resource.
  2. Install Node.js 18+ and the Zapier CLI, then run npm install, zapier login, zapier register "Perfex CRM (your company)" and zapier push in the unpacked folder.
  3. The app is private to your Zapier account; invite your team from the Zapier developer platform. In a Zap, connect it with your CRM address and a key.

Without the kit, Zapier's Webhooks by Zapier (catch hook) works with a Connect webhook, and its custom requests with the REST API.

Make

  1. In a scenario, add Webhooks › Custom webhook and copy its address.
  2. Subscribe it once, from a terminal or Make's HTTP module: POST /perfex_connect/api/v1/integrations/rest_hooks with {"target_url": "<Make address>", "event": "lead.created"} and your key (the Integrations page has the exact call to copy).
  3. Create a lead in Perfex while Make listens, so it learns the fields; map them in the next modules.
  4. To write to Perfex, use Make's HTTP › Make a request with the REST API and the Authorization: Bearer header.

Recipe gallery

Every recipe on Connect › Recipes & Kits, with the trigger and what it does. Open one there for the steps with your own addresses filled in; n8n recipes have a Download JSON button and a workflow to paste. Each uses only real endpoints, events, fields and scopes (an automated test checks them against the code before each release).

Chat channels

A Telegram bot that creates tasks is a recipe above (n8n). Customer conversations on WhatsApp, Messenger and Instagram live in Perfex Inbox, with reply drafts from Perfex AI Staff; Claude, ChatGPT and Cursor work in the CRM through Connect's MCP server. What works with which module: perfexcrm.app/connect/chat/.

The generic copies of both kits are in the developer-kits folder of the download (address placeholder https://your-crm.example.com); kits downloaded from your CRM have your address and resources built in.

Facebook and Instagram Lead Ads

Leads come from Meta to your CRM through your own Meta app; Connect never routes them through anyone else. You need admin access to the Facebook Page that runs the ads, and your CRM on HTTPS.

1. Create the Meta app

  1. At developers.facebook.com create an app of the type Business and add the products Facebook Login for Business and Webhooks.
  2. In Facebook Login › Settings › Valid OAuth Redirect URIs add https://<your-crm>/perfex_connect/oauth/meta/callback (shown in Connect › Settings › Meta app).
  3. Request the permissions pages_show_list, pages_manage_metadata, pages_manage_ads, pages_read_engagement, leads_retrieval and business_management. While the app is in development mode they work for the app's admins and testers; for everyone else Meta's App Review is needed.
  4. Copy the App ID and App secret into Connect › Settings › Meta app (Lead Ads) and save. The verify token is shown there.

2. Connect the Page

  1. Connect › Integrations › Meta Lead Ads › Add account, then Connect with Facebook: sign in, allow the Page.
  2. In the app's Webhooks product, choose Page, subscribe to leadgen with the account's callback address (…/perfex_connect/hooks_meta/<id>, shown on the account) and the verify token.
  3. Configure the account: the Page, the lead forms, and per form the mapping of each question to a lead field, a custom field (cf:…) or the description. Set the defaults: status, source, assigned staff, tags, public.
  4. Choose how duplicates are found (e-mail and / or phone) and what happens: skip, update the existing lead, or add a new one.
  5. Save and Subscribe. Optional: Backfill imports the leads of the last 1–90 days.
Lead Ads configuration with the form mapping and defaults
Lead Ads: Page, forms, mapping of the questions and the defaults for new leads.

Every lead raises lead.created (and custom.meta_lead_imported), so webhooks and rules react to it. Connect refreshes the token before it expires and checks for missed leads every few hours (Settings › Integrations). Meta allows one webhook address per app: with several accounts on one app, only the account set as callback gets live leads; the others get theirs through the regular check.

The Meta Lead Ads account with its forms and status
A connected Lead Ads account.

WooCommerce

  1. In WordPress, open WooCommerce › Settings › Advanced › REST API, Add key with permission Read/Write, and copy the consumer key and secret.
  2. In Perfex, Connect › Integrations › WooCommerce › Add store: the shop's address (https), the key and the secret. Connect tests the connection (store name, WooCommerce version, currency).
  3. Choose the directions: customers both ways, products both ways, orders and refunds from WooCommerce to Perfex (defaults), each can be switched off.
  4. Set the order status map — for each WooCommerce status: skip, draft invoice, unpaid, paid (with a payment), cancelled or refunded — guest orders on or off, the payment mode, how taxes are matched and the conflict rule (newest change wins, WooCommerce wins or CRM wins).
  5. Register webhooks: Connect creates the store's webhooks for customers, products and orders pointing at …/perfex_connect/hooks_woo/<id>, signed with their own secret.
  6. Sync once to bring in existing records (incremental or full). From then on webhooks keep both sides in step, and a reconciliation every few hours catches anything missed.
WooCommerce store settings with directions, status map and conflict rule
A store: directions, the order status map and the conflict rule.
The sync log of a WooCommerce store
The sync log: customers, products and orders imported and linked.

WordPress plugin

The package holds perfex-connect-for-wordpress-1.0.0.zip; Connect › WordPress › Download Plugin gives the same zip. It needs WordPress 6.0+ and PHP 7.4+.

  1. Upload the zip in WordPress › Plugins › Add New › Upload Plugin and activate it.
  2. In Perfex, Connect › WordPress › Pair a Site: choose the staff member the site acts as (administrators may choose anyone, others only themselves) and whether linked users may open the client portal. Copy the code (it works once, for 10 minutes).
  3. In WordPress, Perfex Connect › Connection: the CRM address and the code. WordPress exchanges the code for its own key (scopes wordpress:read, wordpress:write, webhooks:* and, if chosen, wordpress:sso) and stores it encrypted with the site's salts. The Health tab shows versions, clock, permissions and the retry queue.

Instead of a code you can paste an API key made on the API Keys page with the WordPress scopes.

Forms

Users and the client portal

Webhooks to WordPress

On the plugin's Webhooks tab choose events; the plugin subscribes itself through the subscriptions API and checks every delivery's X-Pcx-Signature (5-minute window, replay guard). A site key receives contact.* events of its own linked contacts; other events need the matching read scope on the key. Developers react with do_action('pcfw_webhook', $event, $payload).

There is no booking button: Connect has no booking API yet. Disconnect on Connect › WordPress revokes the site's key at once (forms, sync, documents and sign-in links stop). Uninstalling the plugin removes everything it stored in WordPress.

MCP server and AI assistants

Connect speaks the Model Context Protocol, so AI apps and agent frameworks with MCP support can search and work in Perfex. The endpoint is https://<your-crm>/perfex_connect/mcp/rpc (Streamable HTTP, one JSON-RPC request per POST).

  1. Connect › MCP Server › New token: a name, the staff member it acts as, read only or read and write, the resources it may use (see Token access), optionally allowed addresses, limits and an expiry. Copy the token (shown once).
  2. Connect a client on the same page has ready setup for Claude Desktop, Claude.ai & ChatGPT connectors, Cursor, VS Code, Claude Code and plain HTTP, with your address filled in: paste your token where it says so. Header: Authorization: Bearer <token>. For clients that cannot send headers, …/mcp/rpc/<token> works too (it may then appear in web-server logs) — or use OAuth.
  3. Self test checks the endpoint from the page.

Tools depend on the token's tool style. Compact (the default for new tokens and apps): connect_search, connect_get, connect_create, connect_update (and connect_delete only where deletes are allowed) with a resource argument, and connect_describe. Detailed: <resource>_search, _get, _create, _update (and _delete) for every resource, plus connect_resources and connect_describe. Both styles also get connect_overview, connect_recent_events, connect_whoami and connect_request_status. Resources (the latest records and one record per resource, read-only) and prompts (customer overview, overdue invoices, ticket triage, lead pipeline, my tasks) are offered too.

Results come in a structured envelope, in structuredContent and in the text block:

{
  "perfex_connect": { "tool": "customers_get", "status": "ok",
                      "trust": "untrusted_crm_data", "notice": "…" },
  "data": { … the record or list … }
}

The envelope tells the assistant that CRM text is data, never instructions; hidden direction and zero-width characters are removed from record values. Every call is in the Audit.

Tool style (1.1.1)

Each token and each connected app has a Tool Style, chosen in the token dialog and on the OAuth consent page. Both show the estimated size of the tool list for the access you picked.

StyleWhat the client sees
Compact (recommended)A few generic tools that take a resource: connect_search, connect_get, connect_create, connect_update, connect_delete, and connect_describe (no resource: the resources this connection may use; with a resource: its fields). Each tool's resource list holds only what the token's scopes, its tool allow-list, the delete settings, AI Access and the staff member's Perfex permissions allow. An administrator with every resource gets 9 tools, about 9K characters (roughly 2.3K model tokens).
DetailedOne tool per resource and action, as in 1.1.0: about 160 tools and 200K characters for an administrator with every resource. Some clients cap how many tools they load, and the list takes room in every conversation.

Both styles reach the same records in the same way. A compact call runs the per-resource tool it stands for, so validation, permissions (view own included), approvals, deletes, rate limits and the untrusted-data envelope are identical, and the Audit shows the concrete tool (for example customers_update). Per-resource names keep working on a compact token, so the prompts and older scripts still run.

{"name": "connect_search",
 "arguments": {"resource": "invoices", "filter": {"status": 4}, "sort": "-duedate", "per_page": 10}}

With Perfex AI Staff: in mode Automatic (Settings › MCP server), Connect joins AI Staff as a few generic tools (search, get, create, update, describe — delete only while delete tools are allowed) with the record type as a choice, instead of four tools per resource. Each call still runs as the per-resource action it stands for, so AI Access, Perfex permissions, view own, AI Staff's approval cards and the Audit apply. Connect's endpoint then answers with AI Staff's address instead of running a second server. Mode Standalone keeps Connect's own endpoint (needed for OAuth).

The MCP server page with endpoint, tokens, client configuration and recent calls
MCP Server: endpoint, tokens, a client configuration and the latest tool calls.

MCP scopes, approvals and OAuth

Every way into the MCP server carries exactly the access you give it, and never more than its staff member has in Perfex.

Token access

SettingMeaning
Read only / Read and writeThe master switch: read only makes every resource read-only, whatever is ticked below.
All Resources, or Read / Write per resourceCustomers, contacts, leads, tickets, invoices … and the resources of other SellMyCode modules. The staff member's Perfex permissions, view own included, still apply on every call.
Ask Before Every ChangeOn by default. Creates, updates and deletes become requests on Connect › Approvals (see below). Switch it off only for an automation you trust.
Allow DeletesOff by default. Delete tools are offered only when Settings › MCP Server › Allow Delete Tools is on and the token allows deletes. They still follow the approval setting.
Allowed AddressesIPv4 or IPv6 addresses or CIDR ranges, one per line. Empty: any address.
Calls per minute / per dayEmpty: the site defaults. Above the limit the endpoint answers 429.
Tool StyleCompact (generic tools, default for new tokens) or Detailed (one tool per resource and action). See Tool style.
Tools, Expires OnAn optional allow-list of tools, and an expiry date.

Tokens are stored hashed and shown once. Edit changes access at any time; New Secret replaces the secret (the old one stops at once); Revoke ends it.

Edit Token dialog with read and write per resource, Ask Before Every Change on and Allow Deletes off
Edit Token: access per resource, approval, deletes, then addresses, limits and tools.

Approvals

  1. An assistant calls a create, update or delete tool with a token (or app) that asks before every change.
  2. Connect validates the values, stores a request and notifies the people who may approve. The assistant is told the request is pending, with a request id it can check with connect_request_status.
  3. On Connect › Approvals the request shows each field with its value now and after, the connection that asked and when it expires. Approve and Run or Reject, with an optional note shown to the requester and in the audit.
  4. Approving runs the change at that moment, after checking again that the token is still valid, that its scopes and the requester's permissions still cover the change and that the record still has the values the request saw. Otherwise the request ends as Record Changed and nothing is written.
An approval request with the fields now and after and the Approve and Run and Reject buttons
A request waiting for approval.

OAuth sign-in for MCP clients

The Claude.ai and ChatGPT connectors (and other MCP clients with OAuth) can sign in with a staff account instead of a pasted token. It is off by default.

  1. Set Settings › MCP Server › Mode to Standalone when Perfex AI Staff is installed (OAuth answers 409 while AI Staff serves MCP).
  2. Switch on Settings › OAuth for MCP Clients. Keep Self-Registration of Apps on for Claude and ChatGPT (they register themselves), and check Allowed Return Hosts (claude.ai, chatgpt.com, localhost … by default; *.example.com for subdomains).
  3. In the AI app, add a custom connector with your MCP address https://<your-crm>/perfex_connect/mcp/rpc. The app opens a consent page in Perfex: sign in, choose Read Only or Read and Write, all or some resources, approval and deletes, then Allow Access.
Settings card OAuth for MCP Clients with self-registration, allowed return hosts and token lifetimes
Settings › OAuth for MCP Clients.

Forwarding the /.well-known addresses

A module cannot answer at the root of your site. Most clients find the server through the 401 answer above and need nothing else. Some clients only look at https://<your-crm>/.well-known/oauth-authorization-server (or the same address with the issuer path appended, as RFC 8414 describes) and /.well-known/oauth-protected-resource. Forward these to Connect in your web server. Replace crm.example.com with your address; if Perfex lives in a sub-folder, add it to the targets.

nginx — serve them from Connect (inside the server { … } block of the CRM, before location /), then nginx -t and reload:

location ~ ^/\.well-known/(oauth-authorization-server|openid-configuration)(/.*)?$ {
    proxy_pass https://crm.example.com/perfex_connect/oauth2/.well-known/$1;
    proxy_set_header Host crm.example.com;
    proxy_ssl_server_name on;
}
location ~ ^/\.well-known/oauth-protected-resource(/.*)?$ {
    proxy_pass https://crm.example.com/perfex_connect/oauth2/.well-known/oauth-protected-resource;
    proxy_set_header Host crm.example.com;
    proxy_ssl_server_name on;
}

Or, simpler, redirect them (clients that follow redirects):

location ~ ^/\.well-known/(oauth-authorization-server|openid-configuration)(/.*)?$ {
    return 302 /perfex_connect/oauth2/.well-known/$1;
}
location ~ ^/\.well-known/oauth-protected-resource(/.*)?$ {
    return 302 /perfex_connect/oauth2/.well-known/oauth-protected-resource;
}

Apache (also shared hosting) — at the top of the .htaccess in Perfex's folder, before Perfex's own rewrite rules:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well-known/(oauth-authorization-server|openid-configuration)(/.*)?$ /perfex_connect/oauth2/.well-known/$1 [R=302,L]
RewriteRule ^\.well-known/oauth-protected-resource(/.*)?$ /perfex_connect/oauth2/.well-known/oauth-protected-resource [R=302,L]
</IfModule>

On your own server with mod_proxy you can serve them instead of redirecting: use [P,L] with the full https://crm.example.com/… target. Leave other /.well-known/ paths (such as acme-challenge for certificates) alone. Check with curl -i https://crm.example.com/.well-known/oauth-authorization-server: it must answer (or redirect to) the JSON metadata while OAuth is on.

Audit

Connect › Audit lists every REST call and every MCP, AI Staff and Anna tool call in one place: time, source, staff member, key or app, the call, a short summary of the parameters (secrets masked), the result and the address. Filter by source, outcome, staff member and dates, search, and export CSV. Retention is set on the page (REST calls and MCP/AI calls separately). Staff without the view permission for everyone see only their own calls.

The Audit page with filters and MCP calls with their parameters and results
Audit: who, with which key or app, what was sent and what came back.

AI Access and browser access

Upgrading from 1.0

Brain Pro, Sentinel and AI Staff

ModuleWhat Connect adds
Perfex Brain ProNine widgets (category System): API calls, API errors, requests by key, webhook health, events per day, queue depth, rule runs, sync status, MCP calls — with drill-downs. After activating Connect, press Sync Widgets once on Brain Pro's providers page.
Perfex SentinelAudit entries for key use (first call of a key per day, every call, or off), failed sign-ins and bursts of them, keys and tokens created or revoked, settings, safe mode, paused webhooks and imports.
Perfex AI StaffConnect's records as a few generic tools for AI Staff's assistant, agents and MCP endpoint, with approval cards for writes (see MCP). Agents and AI Staff MCP tokens saved with the older per-resource names keep working, limited to that resource.

Each integration is switched in Settings › Ecosystem and appears only while the other module is active.

Anna bridge

When the Anna AI module is active on the same Perfex, Connect can give Anna tools for your CRM records, including the data of other SellMyCode modules. Choose them in Settings › Anna Bridge (switch Bridge Connect Tools into Anna, then tick the resources per action).

Coming from the third-party “API” module

Connect and the third-party “API” module can be active at the same time: Connect's addresses start with /perfex_connect/ and its tables with pcx_, so nothing collides, and a Connect key does not open the other module (nor the other way round). While the other module is installed, Connect › Legacy API lists its API users and webhooks, shows which Connect endpoint and event replace each of its endpoints and events, and Create Connect key makes a matching key for a user (you choose the staff member it acts as). Move your clients over at your pace, then deactivate the old module.

The Legacy API page with users, endpoint mapping and events
Legacy API: its users, the endpoint and event mapping and Create Connect key.

Safe mode and health

Safe mode is the switch in every Connect page's header (and in Settings › Safe mode). While it is on, no webhook is delivered, no rule calls a URL or waits to run, no WooCommerce or Meta sync runs: the work is held and continues when you switch it off. The API itself keeps answering. Use it while you set things up, during an incident, or on a copy of your installation. Creating a file named DISABLE in modules/perfex_connect/ forces safe mode without signing in.

Connect › Health checks the cron (and warns when it has not run for a while), the queue (waiting, given-up jobs), keys about to expire, failing webhooks, integrations with errors or tokens about to expire, storage used by the logs and the server (PHP, curl, openssl). Actions: retry given-up jobs, release held work, clean up old logs now.

The health page with checks and actions
Health: every check with its detail, and the repair actions.

Outgoing calls (webhooks, rule calls, Meta, WooCommerce) only go to public HTTPS addresses: the host is resolved once and the connection pinned to that checked address, private, loopback, link-local and cloud metadata ranges are refused (IPv6 forms too), redirects are not followed, answers are capped and time-limited. For an installation on a private network, Settings › Outgoing connections can allow plain http and private addresses.

Export and import

Connect › Export / Import saves the API keys (their settings), rules, webhooks, inbound hooks, integrations and settings in one JSON file and brings them into another installation. Secrets are never exported: imported keys get new secrets (listed once in the report), imported webhooks start paused until you give them a secret, imported rules start disabled, integrations need their keys or a new sign-in. Dry run shows what would happen; Overwrite updates items with the same name.

Permissions

Staff rights are set in Setup › Staff › Roles (or per member), feature Perfex Connect. Administrators can do everything.

RightAllows
ViewThe overview, docs, events and the request log (own calls only for non-administrators).
Manage API keysCreate, edit, rotate and revoke their own keys (administrators: anyone's).
Manage webhooks and inbound hooksWebhooks, deliveries and catch-hooks.
Manage automationsRules and their runs.
Manage integrationsLead Ads accounts and WooCommerce stores.
Manage the MCP serverTheir own MCP tokens and connected apps (administrators: anyone's, and OAuth clients).
Approve MCP RequestsDecide requests on the Approvals page (together with the Perfex permission for the record).
Settings, safe mode, export and importSettings, the safe-mode switch, health actions, export and import.
Webhooks made on the admin page receive every event, and rules made by an administrator act as the system — give the webhook, automation and integration rights only to people you trust with all CRM data. API keys and rules of other staff act with those members' own Perfex permissions.

Settings

SectionSettings
GeneralConnect on / off, REST API on / off, public OpenAPI document, light or dark (shared with Brain Pro when installed).
Safe modeThe switch, with what it holds.
Queue and retentionDeliver outgoing work right away or only on cron; jobs per run; days to keep the request log (30), events (90).
Outgoing connectionsAllow plain http; allow private networks.
REST API docsTry it on the docs page; lifetime of signed download links.
Default limits for API keysRequests per minute (120) and per day (20,000).
Events and automationWatch records without hooks, rules on / off, webhook attempts (8), pause after (50), timeout (15 s), rule chain depth (3), watch limit per table.
MCP serverStandalone endpoint on / off, mode, confirm writes, tools in AI Staff, calls per minute and day per token, days to keep the call log; Allow Delete Tools, requester may approve own requests, request expiry.
OAuth for MCP ClientsOn / off, self-registration of apps, allowed return hosts, access and refresh token lifetimes, the metadata addresses.
AI AccessResources every AI channel may reach.
Browser Access (CORS)Allowed origins.
Anna BridgeThe tools Connect adds to Anna (only while Anna is active).
Meta app (Lead Ads)App ID, app secret (encrypted), Graph API version, verify token, the OAuth redirect address.
EcosystemBrain Pro widgets, Sentinel audit, key-use logging.
IntegrationsReconciliation interval (6 h), records per sync page, days to keep the sync log, default conflict rule.
MaintenanceCron warning threshold, keep data on uninstall, the emergency-brake file.
Connect settings with the safe mode section
Settings, one card per section.

Deactivate and uninstall

Deactivate in Setup › Modules: the API, catch-hooks, webhooks, rules, syncs and the MCP server stop at once; your data stays. Events that happen while Connect is off are not recorded.

Uninstall (after deactivating) deletes every Connect table, setting and staff right — unless Settings › Maintenance › Keep data on uninstall is on, then the tables and settings stay for a later reinstall. Export your setup first (Export / Import) if you may want it back. Remove the webhooks Connect registered in WooCommerce and the Lead Ads subscription in Meta (the integration's menu has Remove webhooks / Unsubscribe) before uninstalling.

Troubleshooting

FAQ

Can customers use the API?

No. Keys belong to staff members. Customers reach Perfex through the client portal as usual; their actions there raise events like any other.

Is there an API sandbox?

Use Try it on the docs page with a read-only key, or turn on safe mode on a copy of your CRM to try webhooks and syncs without sending anything.

Can I add my own endpoints?

Developers can register routes, resources, events and MCP tools from their own module through Connect's hooks (Pcx_registry); they appear in the docs and the OpenAPI document automatically.

Is it translated?

Yes: English, Spanish, Portuguese (Brazil), French, German, Italian, Dutch, Turkish and Russian. API and MCP messages stay in English.

How do I get support?

Send the module, Perfex and PHP versions and the request id or delivery id through SellMyCode support — never keys, tokens or secrets.

Changelog

Current version 1.2.1 (25 Oct 2026). Release notes of every version, newest first: perfexcrm.app/connect/changelog/.

1.1.1 — 2026-10-24

1.1.0 — 2026-10-23

1.0.0 — 2026-10-16

The full list is in changelog.txt in the download.