Leads API
Retrieve and manage leads captured by your chatbots.
List Leads
GET
/v1/leadscurl -X GET "https://api.chatmefy.com/v1/leads?limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": [
{
"id": "lead_abc123",
"email": "john@company.com",
"name": "John Smith",
"phone": "+1234567890",
"company": "Acme Corp",
"score": 85,
"source": {
"url": "/pricing",
"campaign": "google_ads"
},
"custom_fields": {
"company_size": "51-200",
"budget": "$10k-50k"
},
"conversation_id": "conv_xyz",
"created_at": "2024-01-15T10:30:00Z"
}
],
"meta": {
"total": 1523,
"page": 1,
"per_page": 20
}
}Query Parameters
limitResults per page (1-100, default 20)pagePage numberscore_minMinimum lead scorescore_maxMaximum lead scorebot_idFilter by botsinceCreated after date (ISO8601)untilCreated before date (ISO8601)Get Single Lead
GET
/v1/leads/:idcurl -X GET "https://api.chatmefy.com/v1/leads/lead_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"Update Lead
PATCH
/v1/leads/:idcurl -X PATCH "https://api.chatmefy.com/v1/leads/lead_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "John D. Smith",
"custom_fields": {
"status": "contacted"
}
}'Delete Lead
DELETE
/v1/leads/:idcurl -X DELETE "https://api.chatmefy.com/v1/leads/lead_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"id": "lead_abc123",
"deleted": true
}
}Lead Object
| Field | Type | Description |
|---|---|---|
| id | string | Unique lead identifier |
| string | Contact email | |
| name | string | Full name |
| phone | string | Phone number |
| company | string | Company name |
| score | integer | Lead score (0-100) |
| source | object | URL, referrer, campaign |
| custom_fields | object | Your custom field data |
| conversation_id | string | Related conversation |
| created_at | ISO8601 | When lead was captured |