Leads & Sales API Endpoints
The Leads and Sales APIs provide access to customer lead data (from advertising platforms, CRMs, and web forms) and sales transaction records.
List Leads
bash
GET /api/v1/leadsQuery Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
dealershipId | uuid | — | Filter by dealership |
startDate | ISO date | — | Start of date range |
endDate | ISO date | — | End of date range |
status | string | — | new, contacted, qualified, converted, lost |
type | string | — | internet, phone, walk_in, chat |
source | string | — | Canonical source name (e.g., "Paid Search") |
limit | number | 50 | Records per page (max 200) |
offset | number | 0 | Pagination offset |
Response:
json
{
"leads": [
{
"id": "uuid",
"dealership_id": "uuid",
"customer_name": "John Doe",
"customer_email": "[email protected]",
"customer_phone": "+15551234567",
"type": "internet",
"status": "new",
"source": "Paid Search",
"source_raw": "google_ads_campaign_spring2026",
"vehicle_interest": "2025 Toyota Camry",
"notes": "Interested in financing options",
"created_at": "2026-02-05T10:15:00Z",
"updated_at": "2026-02-05T10:15:00Z"
}
],
"pagination": { "total": 156, "limit": 50, "offset": 0 }
}Lead Statistics
bash
GET /api/v1/leads/statsQuery Parameters: Same filters as list endpoint.
Response:
json
{
"stats": {
"total_leads": 156,
"by_status": {
"new": 42, "contacted": 58, "qualified": 31, "converted": 18, "lost": 7
},
"by_type": {
"internet": 89, "phone": 45, "walk_in": 15, "chat": 7
},
"by_source": [
{ "source": "Paid Search", "count": 67, "cost": "4500.00", "cost_per_lead": "67.16" },
{ "source": "Organic", "count": 45, "cost": "0.00", "cost_per_lead": "0.00" },
{ "source": "Direct", "count": 22, "cost": "0.00", "cost_per_lead": "0.00" }
],
"conversion_rate": "11.5"
}
}List Sales
bash
GET /api/v1/salesQuery Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
dealershipId | uuid | — | Filter by dealership |
startDate | ISO date | — | Start of date range |
endDate | ISO date | — | End of date range |
salesPerson | string | — | Filter by sales person name |
contractType | string | — | finance, lease, cash |
limit | number | 50 | Records per page |
offset | number | 0 | Pagination offset |
Response:
json
{
"sales": [
{
"id": "uuid",
"dealership_id": "uuid",
"vin": "1HGCM82633A004352",
"customer_name": "Jane Smith",
"sales_person": "Mike Johnson",
"contract_type": "finance",
"sale_price": "32500.00",
"gross_profit": "2150.00",
"trade_in_vin": "5YJSA1E21MF123456",
"trade_in_value": "18000.00",
"lead_id": "uuid",
"source": "Paid Search",
"sold_at": "2026-02-04T16:00:00Z"
}
],
"pagination": { "total": 23, "limit": 50, "offset": 0 }
}Sales Statistics
bash
GET /api/v1/sales/statsQuery Parameters: Same filters as list endpoint.
Response:
json
{
"stats": {
"total_sales": 23,
"total_revenue": "748500.00",
"total_gross_profit": "49450.00",
"avg_gross_profit": "2150.00",
"by_contract_type": {
"finance": 14, "lease": 6, "cash": 3
},
"by_sales_person": [
{ "name": "Mike Johnson", "count": 8, "gross": "18200.00" },
{ "name": "Sarah Lee", "count": 7, "gross": "15400.00" }
],
"avg_days_to_sale": "18.5"
}
}