Creates a new lead in the system with comprehensive contact and interaction details. A lead represents a potential customer or contact who has interacted with your agent. The creation process includes initial contact information, communication preferences, and any existing conversation history.
Endpoint: /lead
Method: POST
{
"full_name": "string", // Required
"sender_id": "string", // Required
"recipient_id": "string", // Required
"sender_obj": "string", // Optional
"page_id": "string", // Optional
"email_address": "[email protected]", // Optional
"phone_number": "+115227400431824", // Optional
"other_contact": "string", // Optional
"preferred_way_of_communication": "email", // Optional
"requirements": "string", // Optional
"conversation_summary": "string", // Optional
"chat_history": "string", // Optional
"quality_score": 100, // Optional
"generation_cost": 0, // Optional
"info": "string", // Optional
"agent_id": "integer", // Required
"language": "string", // Optional
"status": "active", // Optional
"stage": "string", // Optional
"service_account_id": 0, // Optional
"project_id": "string", // Optional
"template": "string" // Optional
}
Status 201 (Created):
{
"message": "Lead successfully created",
"id": 123
}
Status 400 (Bad Request):
{
"message": "Invalid input or failed to create lead"
}
Status 403 (Forbidden):
{
"message": "Insufficient credits or access denied"
}
Status 404 (Not Found):
{
"message": "Agent or service account not found"
}
Status 409 (Conflict):
{
"message": "Lead with the same sender_id already exists"
}
Retrieves a paginated list of all leads in the system. The response includes comprehensive information about each lead, including their contact details, communication preferences, and interaction history.
The list can be filtered by various parameters such as agent_id, date range, and status.
Endpoint: /lead
Method: GET
page (integer): Page number for pagination (default: 1)