REST API · Laravel 12 · Sanctum Auth

Customer Relationship
Management API

Move your cursor through the particles

A full-featured CRM backend — leads, meetings, demos, quotations, GST tax invoices, purchase orders, payroll, attendance, multi-channel campaigns, a client portal and more. All secured with Sanctum authentication and role-based access control.

582
API Endpoints
27
Permission Modules
314
RBAC Permissions
141
Eloquent Models
162
Migrations
94
Controllers
45
Service Classes
14
Queue Jobs
v12
Laravel
8.5+
PHP

Everything built into this CRM

27 permission-scoped modules spanning 582 API endpoints, backed by 141 Eloquent models and 45 service classes.

New What's new in v2
🧾

GST Sale Orders

Standalone Tax Invoices with per-line CGST/SGST and a computed HSN tax summary.

🛒

Purchase Orders

Full PO workflow with configurable terms and server-side total verification.

🔊

Meta & Website Lead Ads

Ingest Facebook/Instagram and website leads through signed webhooks.

📱

Multi-channel Campaigns

Run SMS, WhatsApp (WABA), and RCS campaigns with audience targeting.

🤝

Client Portal

A separate auth flow for end-clients to view projects and chat.

📊

Analytics & Reporting

Per-user sales, pipeline, and product-sales charts plus lead trends.

Sales Pipeline Lead capture, meetings, demos and visits
⚡

Lead Management

Full Raw → Verified → Client lifecycle — create, update, transfer, share, bulk delete, export/import. Follow-ups, callbacks, lead groups, phone/email normalization, and priority management.

Follow-ups Bulk transfer Lead groups Export / Import Callbacks
🔊

Meta & Website Lead Ads

Ingest leads from Meta (Facebook/Instagram) Lead Ads via signed webhooks and from your website via a shared-secret webhook. Captured leads land in a review pool for transfer.

Facebook / Instagram Website webhook HMAC verified Review pool
📅

Meetings

Schedule and manage client meetings with full lifecycle support — transfer, reschedule, cancel, OTP-based verification, arrived/started/completed status tracking.

OTP verify Reschedule Status tracking Team members
🎤

Demo Management

Schedule product demos with assignees, products, and Google Calendar integration. Full demo lifecycle — start, complete, cancel, reschedule, and share with attendees.

Google Calendar Assignees Products Share
📍

Field Visits

Log and track field sales visits. Create, fetch, search, and delete visit records. Linked to leads for a complete activity trail.

Visit logs Lead-linked Search
📦

Products

Central product catalogue used across sales, demos, meetings, tasks, and quotations. CRUD with search and CSV export.

CSV export Search Shared across modules
Revenue & Documents Sales, invoicing, quotations and finance
💰

Lead Sales & Finance

Record sales against leads, track payment history, and run aggregated or individual sales reports. Per-sale slab incentives gated by sale targets, a read-only incentive report, finance approval and billing workflows.

Payment history Slab incentives Sale targets Sale approval Bill management
📄

Quotations

Build and send professional quotations with line items, terms, and custom email bodies. Draft workflow, PDF export, email history, and resend functionality.

PDF export Email delivery Drafts Terms Templates
🧾

GST Sale Orders

Standalone GST Tax Invoices with per-line CGST/SGST, a computed HSN tax summary, and a draft → final flow. Generate branded PDFs and email them to customers.

CGST / SGST HSN summary Draft / Final PDF & email
🛒

Purchase Orders

Create and manage purchase orders with line items, configurable terms, and server-side total verification. Draft workflow with PDF generation and emailing.

Line items Terms Total verification PDF & email
💵

Expense Management

Allocate budgets, process reimbursements, and track every movement through a ledger. Company expenses, direct and request-based reimbursements with approval workflows.

Allocations Reimbursements Ledger Approvals
💳

Credit Management

Configure credit settings and run an approval workflow for credit requests. Pending, approved, and rejected views keep spend governed per account.

Credit requests Approvals Settings
Delivery & Support Projects, tasks and post-sale service
📁

Projects

Manage client projects end-to-end with team assignments, tickets, media file uploads, project chat, and task linking. Active and completed project views.

Tickets Media files Team chat Tasks
✅

Tasks

Multi-assignee tasks with tags, queries, logs, and recurrence management. Task completion tracking, product attachments, and per-user activity logs.

Recurrence Tags Queries Multi-assignee
🎫

Helpdesk

Ticketing system for internal and onboarding support requests. Create, assign, update, and close tickets with a full status lifecycle and audit trail.

Tickets Assignment Status lifecycle
📝

Product Onboarding

Per-product typed onboarding forms with fields defined per product. Fields can map to lead attributes for pre-fill. Submissions email configurable recipients and open a helpdesk ticket.

Typed fields Lead mapping Email + ticket
🤝

Client Portal

A separate authentication flow for end-clients to view their projects, chat with the team, and manage their profile. Isolated from internal staff access.

Client auth Projects Chat Profile
🏷

Tags

Flexible tagging system shared across tasks and projects. Create, update, delete, and search tags for better content organisation.

Tasks Projects Search
People & HR Workforce, attendance and payroll
📅

Attendance & Location

GPS-enabled check-in/check-out with real-time location tracking. Aggregated and detailed attendance reports, backfill support, and subordinate views.

GPS tracking Check-in / out Reports Backfill
🗺

Location Tracking & Geofencing

Real-time GPS location tracking for field staff with configurable geofences. Powers attendance validation and field-visit verification.

Live tracking Geofencing Field staff
🏕

Leave Management

Define leave types and entitlements per user. Application workflow with approval and rejection by managers. Pending, approved, and rejected leave views.

Leave types Entitlements Approve / Reject
💸

Payroll

Generate and manage payroll payments with additions and deductions. Export individual or all payroll records. Payment type configuration included.

Additions / Deductions Export Payment types
⏱

Timesheets

Per-user timesheets aggregating worked hours and client time across tasks and projects, feeding payroll and productivity reporting.

Worked hours Client time Per-user
🕐

Shifts & Holidays

Configure work shifts and manage the company holiday calendar. Year-based holiday views and dashboard holiday widget for employees.

Work shifts Holiday calendar Year views
Platform & Integrations Access, comms, analytics and the core engine
👥

Users & Roles

Full user lifecycle with profiles, documents, bank details, addresses, and assets. Role-based permission system with granular access control and user impersonation.

RBAC Permissions KYC Impersonation Assets
🏢

Companies

Multi-company support with active/inactive status management. Each company operates as an independent tenant with its own users, leads, and settings.

Multi-tenant Status management Search
🔒

Authentication

Email + OTP registration with Sanctum token-based auth. Google OAuth login, email verification, and secure logout. Account-level validation middleware.

Sanctum tokens Google OAuth OTP verification
📱

Device Security & MPIN

Linked-device management with QR login, per-device sign-out, and MPIN set/update/reset flows. Super admins can remotely sign out any or all of a user's devices.

QR login MPIN Remote sign-out
📣

Campaigns & Marketing

Multi-channel campaign execution across SMS, WhatsApp (WABA), and RCS with audience targeting, variable mapping, and reusable message templates per channel.

SMS WhatsApp RCS Audience targeting Templates
📱

Communication Integrations

Configure multiple messaging channels — WhatsApp Business (WABA), SMS, RCS, IVR, and SMTP email — per account. Per-user integration settings supported.

WhatsApp (WABA) SMS RCS IVR SMTP
📞

Phone Call Logs

IVR and manual call log tracking with incoming/outgoing call reports. Aggregated analytics, per-user call records, and bulk data uploads from IVR systems.

IVR integration Incoming / Outgoing Aggregated reports
🔔

Notifications & Realtime

Push notification delivery (FCM) to user devices with per-user feeds and scheduled notifications. Real-time chat and events broadcast over Pusher, plus payment reminders.

FCM push Pusher realtime Scheduled Payment reminders
📈

Dashboard

Role-aware dashboard aggregating today's attendance, latest leads, meetings, tasks, projects, demos, visits, upcoming holidays, and team birthdays.

Attendance summary Latest activity Holidays Birthdays
📊

Analytics & Reporting

Dashboard KPIs plus deep per-user analytics — sales, pipeline and product-sales charts, lead capture trends, call/meeting/demo/visit breakdowns, and conversion funnels.

Sales charts Pipeline Lead trends Activity KPIs
📊

Activity Logs

Immutable per-user activity audit trail tracking every meaningful action across the system for compliance and debugging.

Audit trail Per-user Immutable

Authenticate & make your first call

Every request follows the same conventions. Grab a token, then send it as a bearer header on each call.

🔗 Endpoint pattern

Authenticated endpoints use a module/action pattern over POST: POST /api/{module}/{action} — e.g. /api/lead/create.

🔒 Bearer auth

Send your Sanctum token on every call: Authorization: Bearer <token>. Tokens are issued after OTP verification.

🏢 Account scoping

Requests pass through account-validation middleware, so every response is automatically scoped to your account_id.

🔑 Permissions

Fine-grained RBAC via dot-notation permissions: module.sub_module.action, checked per route group.

🚀 Authentication flow

1

Request an OTP

POST /api/login with your phone. An OTP is sent via SMS (or you'll be prompted for your MPIN).

2

Verify & get a token

POST /api/verify with phone + otp. The data field returns your bearer token.

3

Call any endpoint

Attach Authorization: Bearer <token> and start hitting module endpoints like /api/lead/create.

📱 Verify & receive a token

cURL
curl -X POST https://your-domain.com/api/verify \
  -H "Content-Type: application/json" \
  -d '{"phone":"9876543210","otp":"1234"}'

⚡ Authenticated request

cURL
curl -X POST https://your-domain.com/api/lead/create \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Corporation","phone":"9876543210"}'

Consistent JSON responses

Every endpoint returns a predictable envelope so clients never need to guess the structure.

✅ Success Response

JSON
{
  "success": true,
  "message": "Lead created successfully",
  "data": {
    "id": 42,
    "name": "Acme Corporation",
    "status": "new",
    "priority": "high",
    "created_at": "2026-06-20T10:00:00Z"
  }
}

❌ Error Response

JSON
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "name": [
      "The name field is required."
    ],
    "email": [
      "The email must be a valid address."
    ]
  }
}

Built on proven foundations

Modern, stable technologies chosen for performance and long-term maintainability.

🌲
Laravel
v12.x
📡
PHP
8.2+
🐘
MySQL
8.0+
🔒
Sanctum
Token Auth
📦
Queue Jobs
Database driver
🛡️
Spatie Permission
RBAC v7
📜
Spatie Activitylog
Audit trail
🔍
Eloquent ORM
Eager loading
📄
DomPDF
PDF generation
📊
Laravel Excel
Import / Export
⚡
Pusher
Broadcasting
📅
Google Calendar
OAuth 2.0
📱
Firebase FCM
Push Notifications