Skip to content

Reports & Integrations

Analyze sales performance, export data, and connect CRM to external systems via API and webhooks.


Table of Contents

  1. CRM Dashboard
  2. Reports
  3. Import & Export
  4. REST API
  5. Public Lead Capture
  6. Webhooks
  7. Environment Variables

CRM Dashboard

Route: /admin/crm

The CRM dashboard is the default landing page for admin users with CRM access.

KPI Widgets

WidgetDescription
Pipeline ValueTotal value of open deals
Deals Won (MTD)Won deals count and value this month
New Leads (7d)Leads created in the last 7 days
Conversion RatePercentage of leads converted
Activities DueOverdue and due-today task count
Top DealsHighest-value open opportunities

Charts

  • Pipeline Funnel — Deal count by stage
  • Lead Sources — Pie chart of lead origin
  • Trends — Lead and deal activity over time

Reports

Route: /admin/crm/reports

Requires view crm reports permission.

Available Reports

ReportDescription
Deals Won/LostClosed deals by period
Sales by RepRevenue grouped by deal owner
Pipeline SummaryOpen deals by stage and value
Lead SourcesLead volume by source
Conversion MetricsLead-to-deal conversion rates

CSV Export

Click Export CSV on the reports page, or use:

GET /admin/crm/reports/export

Query parameters: type, from, to, owner_id


Import & Export

Route: /admin/crm/import-export

Export

DataRoute
ContactsGET /admin/crm/export/contacts
LeadsGET /admin/crm/export/leads
DealsGET /admin/crm/export/deals

Downloads CSV files with all standard fields.

Import

DataRouteFormat
ContactsPOST /admin/crm/import/contactsCSV with headers
LeadsPOST /admin/crm/import/leadsCSV with headers

Required CSV columns for contacts: first_name, last_name, email

Required CSV columns for leads: first_name, last_name, email

Optional columns: phone, company, source, description, etc.


REST API

All authenticated CRM endpoints require a Sanctum bearer token.

Base path: /api/crm

ResourceEndpoints
ContactsGET/POST /contacts, GET/PUT/DELETE /contacts/{id}
AccountsGET/POST /accounts, GET/PUT/DELETE /accounts/{id}
LeadsGET/POST /leads, GET/PUT/DELETE /leads/{id}, POST /leads/{id}/convert
DealsGET/POST /deals, GET/PUT/DELETE /deals/{id}, POST /deals/{id}/move-stage
ActivitiesGET/POST /activities, PUT/DELETE /activities/{id}
PipelinesGET /pipelines

See the full API Documentation for request/response examples.

Getting a Token

bash
curl -X POST https://yourdomain.com/api/tokens \
  -H "Content-Type: application/json" \
  -d '{"email":"admin@example.com","password":"password","device_name":"My App"}'

Use the returned token in subsequent requests:

Authorization: Bearer {token}

Public Lead Capture

No authentication required. Rate limited to 10 requests per minute.

Endpoint: POST /api/public/leads

json
{
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane@example.com",
  "phone": "+1234567890",
  "company_name": "Acme Inc",
  "description": "Interested in your services",
  "source": "website-form"
}

Response (201):

json
{
  "success": true,
  "message": "Lead captured successfully.",
  "data": {
    "id": 42,
    "email": "jane@example.com",
    "status": "new"
  }
}

Webhooks

Inbound (Receive Leads)

Endpoint: POST /api/public/webhooks/leads
Rate limit: 30 requests/minute
Auth: Optional X-Webhook-Secret header

Use with Zapier, Make, or custom integrations to push leads into CRM.

Outbound (Send Events)

Configure in .env:

CRM_WEBHOOK_URL=https://hooks.zapier.com/hooks/catch/...
CRM_WEBHOOK_SECRET=your-secret-key

Events sent automatically:

EventTrigger
lead.createdNew lead via public API or webhook
deal.wonDeal moved to a won stage

Payload includes record ID, key fields, and event timestamp.


Environment Variables

VariableDescription
CRM_WEBHOOK_URLOutbound webhook destination URL
CRM_WEBHOOK_SECRETSecret for inbound webhook validation

Defined in config/services.php under the crm key.



Last updated: June 2026

Released under the MIT License.