Overview
The Leads Management API helps you track and manage potential sales opportunities for each vehicle in your inventory. Create actionable tasks, set priorities, and monitor lead status throughout the sales funnel.
Endpoints
List All Leads
Retrieve all leads with optional filtering and sorting.
Query Parameters:
Global search across action, targetName, tag
Filter by status: NEW, COMPLETED, NOT_NEEDED
Filter by associated vehicle ID
Sort field: order, status, action, targetName, createdAt
Sort direction: asc, desc
Response:
[
{
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"carId" : "car_uuid" ,
"status" : "NEW" ,
"action" : "Follow up call" ,
"targetName" : "John Smith" ,
"targetInfo" : "+212-600-123456" ,
"tag" : "Hot Lead" ,
"note" : "Customer interested in financing options" ,
"order" : 1 ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"updatedAt" : "2024-01-15T10:30:00Z" ,
"car" : {
"id" : "car_uuid" ,
"make" : "Honda" ,
"model" : "Civic" ,
"overviewYear" : 2021 ,
"location" : "Casablanca"
}
}
]
Get Lead by ID
Retrieve detailed information about a specific lead.
Path Parameters:
Response:
{
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"carId" : "car_uuid" ,
"status" : "NEW" ,
"action" : "Follow up call" ,
"targetName" : "John Smith" ,
"targetInfo" : "+212-600-123456" ,
"tag" : "Hot Lead" ,
"note" : "Customer interested in financing options" ,
"order" : 1 ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"updatedAt" : "2024-01-15T10:30:00Z"
}
Create Lead for Vehicle
Create a new lead associated with a specific vehicle.
Path Parameters:
Request Body:
{
"action" : "Schedule test drive" ,
"targetName" : "Jane Doe" ,
"targetInfo" : "jane.doe@email.com" ,
"tag" : "Test Drive" ,
"note" : "Prefers weekend appointments" ,
"status" : "NEW" ,
"order" : 1
}
Action description (max 200 characters)
Lead contact name (max 200 characters)
Contact information - phone or email (max 500 characters)
Lead category tag (max 100 characters)
Additional notes (max 1000 characters)
Lead status: NEW (default), COMPLETED, NOT_NEEDED
Display order for sorting (default: 0)
Response:
{
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"carId" : "car_uuid" ,
"status" : "NEW" ,
"action" : "Schedule test drive" ,
"targetName" : "Jane Doe" ,
"targetInfo" : "jane.doe@email.com" ,
"tag" : "Test Drive" ,
"note" : "Prefers weekend appointments" ,
"order" : 1 ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"updatedAt" : "2024-01-15T10:30:00Z"
}
Update Lead
Update an existing lead’s information.
Path Parameters:
Request Body:
{
"status" : "COMPLETED" ,
"note" : "Test drive completed. Customer very interested."
}
All fields are optional. Only provided fields will be updated.
Response:
{
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"status" : "COMPLETED" ,
"note" : "Test drive completed. Customer very interested." ,
"updatedAt" : "2024-01-16T14:20:00Z"
}
Get Leads for Vehicle
Retrieve all leads associated with a specific vehicle.
Path Parameters:
Query Parameters:
Same filtering and sorting options as /leads endpoint.
Response:
Array of lead objects sorted by order (ascending by default).
Get Leads by Status
Filter leads by their current status.
Path Parameters:
Status: NEW, COMPLETED, NOT_NEEDED
Response:
Array of lead objects matching the status.
Reorder Leads
Bulk update lead order positions for a vehicle.
Path Parameters:
Request Body:
{
"leadOrders" : [
{ "id" : "lead_id_1" , "order" : 1 },
{ "id" : "lead_id_2" , "order" : 2 },
{ "id" : "lead_id_3" , "order" : 3 }
]
}
Response:
{
"success" : true ,
"message" : "Leads reordered successfully"
}
Update Lead Order
Update the order position of a single lead.
Path Parameters:
Request Body:
Delete Lead
Permanently delete a lead.
Path Parameters:
Response:
{
"success" : true ,
"message" : "Lead deleted successfully"
}
Lead Status Workflow
NEW
Lead is created and requires action. This is the default status.
COMPLETED
Action has been completed successfully. Lead achieved its goal.
NOT_NEEDED
Lead is no longer relevant or was cancelled.
Use Cases
Example 1: Track Test Drive Requests
# Create test drive lead
curl -X POST "https://api.steerai.autos/v1/leads/car/{carId}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "Schedule test drive",
"targetName": "Ahmed Benali",
"targetInfo": "+212-600-123456",
"tag": "Test Drive",
"note": "Prefers Saturday morning"
}'
Example 2: Follow-up Call Tracking
# Create follow-up lead
curl -X POST "https://api.steerai.autos/v1/leads/car/{carId}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "Follow-up call",
"targetName": "Sara Alami",
"targetInfo": "sara.alami@email.com",
"tag": "Hot Lead",
"note": "Interested in financing. Call back Tuesday"
}'
Example 3: Document Review
# Create document review lead
curl -X POST "https://api.steerai.autos/v1/leads/car/{carId}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "Prepare sales documents",
"targetName": "Legal Department",
"targetInfo": "legal@dealership.com",
"tag": "Documentation"
}'
Error Codes
Code Status Description LEAD_NOT_FOUND404 Lead ID does not exist CAR_NOT_FOUND404 Associated vehicle not found UNAUTHORIZED_LEAD_ACCESS403 User doesn’t have access to this lead INVALID_LEAD_STATUS400 Invalid status value provided VALIDATION_ERROR400 Request body validation failed
Best Practices
Make action descriptions clear and actionable. Good: “Follow up call about financing”. Bad: “Call”.
Leverage tags for organization
Use consistent tags across your organization: “Hot Lead”, “Test Drive”, “Documentation”, “Follow-up”.
Add notes after each interaction to maintain context and history.
Reorder leads by priority
Use the order field to prioritize leads. Lower numbers appear first.
Regularly archive or delete completed leads to keep your pipeline clean.
Integration Tips
The Leads API integrates seamlessly with:
Vehicles API - Automatically link leads to inventory
CRM Systems - Export leads to external CRM platforms
Email/SMS Services - Trigger notifications on lead status changes
Analytics - Track conversion rates and lead performance
CRM Integration Guide Learn more about CRM integration and best practices