Perfex CRM is one of the most powerful self-hosted customer relationship management systems built on the CodeIgniter framework. Designed for flexibility, Perfex is popular among small and medium businesses that want to manage clients, leads, projects, and invoices under one platform.
Short answer: Perfex CRM API integration allows developers to securely connect Perfex CRM with external applications for real-time data sync, automation, and custom workflows. This guide explains API setup, authentication, CRUD operations, common errors, and best practices for production-ready integrations.
Need help with Perfex CRM API integration?
Get a free consultation and integration roadmap tailored to your system.
However, developers often need to connect Perfex CRM with other tools like websites, mobile apps, or third-party software. The best way to achieve this is through Perfex CRM API integration, which allows programmatic access to CRM data.
In this guide, we’ll explore how developers can integrate Perfex CRM using REST API, handle CRUD operations, and use real working code examples (PHP & cURL). We’ll also share FAQs, semantic SEO insights, and troubleshooting tips based on authentic resources from the official Perfex documentation and developer community.

What Is Perfex CRM API Integration?
The Perfex CRM API allows developers to securely access and manipulate CRM data through HTTP endpoints. Using the API, you can:
- – Create, Read, Update, and Delete (CRUD) records such as Leads, Customers, Projects, and Invoices.
- – Automate workflows (e.g., adding leads from your website contact form directly into Perfex).
- – Connect external dashboards or mobile apps.
- – Integrate Perfex with marketing automation tools like Zapier, Make (Integromat), or n8n.
While Perfex CRM doesn’t include a public REST API by default, you can enable it by installing the REST API or GraphQL module, available from the Perfex marketplace or third-party developers.
Prerequisites for Perfex CRM API Integration
Before starting development, ensure you have the following:
- – A running instance of Perfex CRM (self-hosted or on VPS).
- – REST API or GraphQL module installed and activated from
Setup → Modules. - – A generated API token (Authentication key).
- – Basic understanding of JSON, PHP (or Node/Python), and HTTP requests.
- – HTTPS-enabled domain for secure API communication.
Enabling the API
- Go to your Perfex Admin Panel →
Setup → Modules. - Install and activate the REST API module.
- Navigate to the API Manager section and generate an API token.
- Assign scopes (permissions) — e.g., leads, clients, invoices.
- Test the endpoint in Postman:
GET https://yourdomain.com/api/leads
Headers:
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
If you receive a response, your API is working successfully.
Developers typically use Perfex CRM APIs to eliminate manual data entry, sync leads automatically, and integrate CRM data with external platforms. Without proper API structure, integrations often break, cause duplicate records, or expose security risks.
4. Understanding Authentication
Perfex API typically uses Bearer Token Authentication. Each request must include the following header:
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
Some older modules may require:
Authtoken: YOUR_API_TOKEN
Pro Tip: Always use HTTPS and keep your token secure. Create separate tokens for different integrations.

CRUD Operations Table (Create, Read, Update, Delete)
Here’s a quick reference table for API endpoints used in CRUD operations for Leads (you can replace “leads” with “customers” or other modules):
| Operation | Method | Endpoint | Description | Example Payload or Params |
|---|---|---|---|---|
| Create | POST |
/api/leads |
Create a new lead | { "name": "John", "email": "john@site.com" } |
| Read (List) | GET |
/api/leads |
Fetch list of leads | Optional: ?status=1 |
| Read (One) | GET |
/api/leads/{id} |
Get specific lead by ID | Replace {id} with numeric ID |
| Update | PUT |
/api/leads/{id} |
Update existing lead data | { "status": 2 } |
| Delete | DELETE |
/api/leads/{id} |
Delete a lead | Requires lead ID |
CRUD Implementation (With Code Examples)
Below are working examples using PHP (cURL) — the most common environment for Perfex CRM developers.
1. Create a Lead
<?php
$token = 'YOUR_API_TOKEN';
$url = 'https://yourdomain.com/api/leads';
$data = [
"name" => "Jane Doe",
"email" => "jane@example.com",
"phonenumber" => "03001234567",
"source" => 1,
"status" => 1,
"assigned" => 2
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
2. Read (List All Leads)
<?php
$token = 'YOUR_API_TOKEN';
$url = 'https://yourdomain.com/api/leads';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
3. Read (Single Lead)
<?php
$leadId = 123;
$token = 'YOUR_API_TOKEN';
$url = "https://yourdomain.com/api/leads/{$leadId}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
4. Update a Lead
<?php
$leadId = 123;
$token = 'YOUR_API_TOKEN';
$url = "https://yourdomain.com/api/leads/{$leadId}";
$data = ["status" => 2, "phonenumber" => "03007654321"];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
5. Delete a Lead
<?php
$leadId = 123;
$token = 'YOUR_API_TOKEN';
$url = "https://yourdomain.com/api/leads/{$leadId}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Want production-ready Perfex CRM API integrations?
Get expert help with authentication, security, and scalable architecture.
Error Handling & Debugging
Common API issues developers face:
| Error Message | Cause | Solution |
|---|---|---|
406 Not Acceptable |
Wrong headers | Always use Content-Type: application/json |
Invalid Token |
Expired or incorrect token | Regenerate from API Manager |
Data Not Provided |
Missing required fields | Check API documentation for field requirements |
Lead Created but Not Visible |
Role or permission issue | Ensure assigned user or admin view |
Use tools like Postman or Insomnia to debug API requests before implementing in your codebase.
Common Perfex CRM API Integration Mistakes to Avoid
Many developers struggle with Perfex CRM API integrations because they skip critical planning and best practices. Common mistakes include enabling automation without clear workflows, ignoring role-based access control, misconfiguring authentication tokens, and neglecting testing in a sandbox environment. These errors can lead to duplicate data, security vulnerabilities, and unreliable reporting. Avoiding these pitfalls not only ensures smoother integration but also saves time and resources while maximizing ROI from your CRM setup.
Best practices & architecture patterns
- Retry & idempotency: Use idempotency keys if your module supports them or implement dedupe at your side to avoid duplicate leads on retries.
- Rate limiting: Modules may not enforce limits—implement exponential backoff on client side.
- Sync vs. push: For bi-directional sync, prefer pushing changes from the source system into Perfex and use scheduled pulls for reconciliation.
- Webhook alternative: If available, prefer webhooks for near-real-time updates; otherwise poll with reasonable intervals.
Developer Best Practices
- Security: Always use HTTPS and store tokens in environment variables.
- Idempotency: Prevent duplicate entries by validating data before sending POST requests.
- Pagination: Use query params (
?page=2) for large data requests. - Automation: Combine API calls with cron jobs or webhooks for real-time updates.
- Testing: Validate all CRUD actions on a staging environment first.
Integrations & tools
Many automation platforms (n8n, Zapier/Make) can call Perfex REST endpoints—treat them as generic HTTP actions and replicate the headers/body described above. Community threads show users integrating via HTTP modules.
Not sure if API integration is right for your setup?
Get a free expert review of your Perfex CRM environment.
Real Use Case / Result: Perfex CRM API Integration in Action
API integrations are most valuable when they deliver tangible business outcomes. Users often look for practical results, such as reducing manual data entry, syncing CRM with website forms, or connecting CRM to billing and automation tools.
Scenario 1: Automating Lead Capture
A sales team needed to capture leads from their website directly into Perfex CRM. Using the API, form submissions were automatically synced to the CRM in real time. This eliminated manual data entry, reduced errors, and allowed the sales team to follow up faster — increasing lead conversion rates by 30%.
Scenario 2: Streamlined Billing Integration
An accounting team integrated Perfex CRM with their invoicing system through the API. Customer data and billing information synced automatically, reducing reconciliation time and preventing duplicate entries. Finance now generates accurate invoices within minutes instead of hours.
Scenario 3: Workflow Automation Across Teams
A business implemented API-based workflows connecting support tickets, sales tasks, and marketing campaigns. Tasks assigned in one system automatically updated across all modules in Perfex CRM, keeping teams aligned and reducing manual coordination.
Outcome:
These real-world integrations not only saved time but also improved accuracy, team efficiency, and decision-making. They demonstrate how a properly implemented Perfex CRM API integration transforms data handling into a reliable, automated workflow.
Ready to Achieve the Same Results?
Don’t spend weeks figuring out API integration alone. Our experts can create a custom Perfex CRM API plan tailored to your business, including automated workflows, lead capture, and billing integration.
FAQs About Perfex CRM API Integration:
What is Perfex CRM on CodeCanyon?
Perfex CRM on CodeCanyon is a powerful open-source customer relationship management system designed for businesses to manage clients, projects, invoices, and leads. It’s available on CodeCanyon.net and supports hundreds of paid add-ons like REST API, WooCommerce, WhatsApp, and HRM modules for extended functionality.
Does Perfex have a built-in REST API?
Not by default — you must install a REST API or GraphQL module to enable endpoints
How do I get an API token?
Install/activate the API module, then create a token in the module’s API manager. Tokens are usually generated in the admin UI.
I get 406 Not Accepted—why?
Usually due to missing Content-Type: application/json, non-HTTPS requests, or wrong header placement. Verify JSON payload and headers.
Can I create leads and see them in UI?
Yes, but visibility can depend on the user role and filters. If the API responds “Lead add successful” but you don’t see it in the UI, confirm the user’s permissions and list filters (status, assigned staff).
Is there a GraphQL option?
Yes—third-party GraphQL modules exist that expose more flexible queries, including custom/module data. Evaluate those if you need complex queries.
What is the Perfex CRM REST API Module?
It’s a module that provides secure RESTful API endpoints to programmatically access and manage Perfex CRM data such as customers, leads, invoices, projects, and more.
Do I need coding skills to use the Perfex CRM API?
Basic understanding of REST APIs, JSON, and HTTP requests is recommended for effective integration and development.
How do I authenticate API requests in Perfex CRM?
Authentication is done via an API token generated within the Perfex CRM settings, which must be included in HTTP request headers.
Can I integrate Perfex CRM with other apps like Zapier or Slack?
Yes, the API enables integration with third-party apps such as Zapier, Slack, accounting software, marketing tools, and more for automation and data synchronization.
What modules are covered by the Perfex CRM API?
Core modules like Customers, Leads, Invoices, Projects, Tasks, Tickets, Payments, Expenses, Contracts, and Proposals are supported with full CRUD operations.
What is the difference between REST API and Webhooks in Perfex CRM?
REST API allows you to pull/push data on demand, while Webhooks push real-time event notifications. Often, both are used together for a complete integration.
Is the Perfex CRM API secure?
Yes, it uses secure token-based authentication and supports HTTPS to ensure data privacy and integrity.
Where can I find official Perfex CRM API documentation?
The official documentation is available on Perfex CRM’s website and includes detailed endpoint references, usage examples, and guides.
Can I create custom endpoints or extend the Perfex CRM API?
Yes, developers can extend the API or create custom endpoints for additional customization based on business needs.


