Skip to main content

API Overview

The Perfex CRM SaaS Module includes a REST API that allows you to manage your SaaS platform programmatically. This is useful for:

  • Custom signup pages - Build your own registration flow
  • Third-party integrations - Connect with external tools (Zapier, Integromat, custom apps)
  • Billing automation - Sync with external billing systems
  • Monitoring - Build custom dashboards and monitoring tools
  • Mobile apps - Create mobile management interfaces

Getting Started with the APIโ€‹

Step 1: Enable the APIโ€‹

  1. Go to SaaS Management โ†’ SuperAdmin Settings
  2. Click the API Settings tab
  3. Toggle the API ON
  4. Generate an API token

Step 2: Authenticationโ€‹

All API requests require authentication via a Bearer token in the request header:

Authorization: Bearer YOUR_API_TOKEN_HERE

Step 3: Base URLโ€‹

Your API base URL is:

https://yoursite.com/api/saas/

Replace yoursite.com with your actual domain.


Quick Exampleโ€‹

Here's a quick example of creating a tenant via the API:

curl -X POST https://yoursite.com/api/saas/tenants \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"company_name": "Acme Corp",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"plan_id": 1,
"subdomain": "acme"
}'

Response:

{
"success": true,
"tenant_id": 42,
"domain": "acme.yoursite.com",
"message": "Tenant created successfully"
}

API Capabilitiesโ€‹

Endpoint GroupWhat You Can Do
TenantsCreate, read, update, delete tenants
PlansList, create, update plans
SubscriptionsManage tenant subscriptions
UsageQuery tenant usage and quotas

For the complete list of endpoints, see the API Reference.


Rate Limitingโ€‹

The API implements rate limiting to protect your server:

  • 100 requests per minute per API token
  • Rate limit headers are included in every response

If you exceed the rate limit, you'll receive a 429 Too Many Requests response.


Best Practicesโ€‹

  1. Keep your API token secret - Never expose it in client-side code or public repositories
  2. Use HTTPS - Always make API requests over HTTPS
  3. Handle errors gracefully - Check response status codes and handle errors appropriately
  4. Cache when possible - Don't query the same data repeatedly; cache responses when they don't change often
info

Need a custom integration? If the API doesn't cover your use case, contact us through support. We're constantly expanding the API based on customer feedback.

API Reference