Leads Endpoints
List All Leads
Endpoint
GET /api/leads
Description
Retrieves a list of all leads in the system.
Headers
Authtoken: your_api_key_here
Response
Success Response (200 OK)
"hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631",
"name": "Lead name",
"contact": "",
"title": "",
"company": "Nanza",
"description": "",
"country": "243",
"zip": null,
"city": "London",
"state": "London",
"address": "1a The Alexander Suite Silk Point",
"assigned": "5",
"dateadded": "2019-07-18 08:59:28",
"from_form_id": "0",
"status": "0",
"source": "4",
"email": "",
"website": "",
"phonenumber": "",
"lastcontact": null,
"dateassigned": null,
"last_status_change": null,
"addedfrom": "1",
"default_language": "",
"client_id": "0",
"custom_contact_date": null,
"last_lead_status": "0",
"from_form_id": "0",
"default_currency": "0",
"is_public": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"customfields": []
}
">{ "id": "17", "hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631", "name": "Lead name", "contact": "", "title": "", "company": "Nanza", "description": "", "country": "243", "zip": null, "city": "London", "state": "London", "address": "1a The Alexander Suite Silk Point", "assigned": "5", "dateadded": "2019-07-18 08:59:28", "from_form_id": "0", "status": "0", "source": "4", "email": "", "website": "", "phonenumber": "", "lastcontact": null, "dateassigned": null, "last_status_change": null, "addedfrom": "1", "default_language": "", "client_id": "0", "custom_contact_date": null, "last_lead_status": "0", "from_form_id": "0", "default_currency": "0", "is_public": "0", "show_primary_contact": "0", "stripe_id": null, "registration_confirmed": "1", "customfields": [] }
Error Response (404 Not Found)
"message": "No data were found"
}
">{ "status": false, "message": "No data were found" }
Get Lead by ID
Endpoint
GET /api/leads/{id}
Description
Retrieves detailed information about a specific lead.
Headers
Authtoken: your_api_key_here
Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| id | integer | Yes | The unique ID of the lead |
Response
Same as List All Leads endpoint.
Search Leads
Endpoint
GET /api/leads/search/{key}
Description
Searches for leads based on the provided search key.
Headers
Authtoken: your_api_key_here
Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| key | string | Yes | Search keywords |
Response
Same as List All Leads endpoint.
Search Leads by Date Range
Endpoint
GET /api/leads/dates/{from_date}/{to_date}
Description
Searches for leads within a specific date range based on their creation date.
Headers
Authtoken: your_api_key_here
Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| from_date | string | Yes | Start date in YYYY-MM-DD format (e.g. 2021-01-31) |
| to_date | string | Yes | End date in YYYY-MM-DD format (e.g. 2021-01-31) |
Response
Success Response (200 OK)
"hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631",
"name": "Lead name",
"contact": "",
"title": "",
"company": "Gap Trade",
"description": "",
"country": "243",
"city": "London",
"state": "London",
"address": "1a The Alexander Suite Silk Point",
"assigned": "5",
"dateadded": "2019-07-18 08:59:28",
"status": "0",
"source": "4"
}
">{ "id": "17", "hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631", "name": "Lead name", "contact": "", "title": "", "company": "Gap Trade", "description": "", "country": "243", "city": "London", "state": "London", "address": "1a The Alexander Suite Silk Point", "assigned": "5", "dateadded": "2019-07-18 08:59:28", "status": "0", "source": "4" }
Error Response (404 Not Found)
"message": "No Data Found."
}
">{ "status": false, "message": "No Data Found." }
Create Lead
Endpoint
POST /api/leads
Description
Creates a new lead in the system.
Headers
Authtoken: your_api_key_here
Content-Type: application/json
Request Body Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| source | integer | Yes | Lead source ID |
| status | integer | Yes | Lead status ID |
| name | string | Yes | Lead name |
| assigned | integer | No | Assigned staff member ID |
| client_id | integer | No | Related client ID |
| tags | string | No | Lead tags |
| contact | string | No | Contact name |
| title | string | No | Contact title/position |
| email | string | No | Email address |
| website | string | No | Website URL |
| phonenumber | string | No | Phone number |
| company | string | No | Company name |
| address | string | No | Street address |
| city | string | No | City |
| state | string | No | State/Province |
| country | integer | No | Country ID |
| default_language | string | No | Default language |
| description | string | No | Lead description |
| custom_contact_date | date | No | Custom contact date |
| contacted_today | boolean | No | Whether lead was contacted today |
| is_public | boolean | No | Whether lead is public |
Response
Success Response (200 OK)
"message": "Lead add successful."
}
">{ "status": true, "message": "Lead add successful." }
Error Response (404 Not Found)
"message": "Lead add fail.",
"error": {
"name": "This Lead Name already exists please enter another Lead Name"
}
}
">{ "status": false, "message": "Lead add fail.", "error": { "name": "This Lead Name already exists please enter another Lead Name" } }
Update Lead
Endpoint
PUT /api/leads/{id}
Description
Updates an existing lead's information.
Headers
Authtoken: your_api_key_here
Content-Type: application/json
Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| id | integer | Yes | The unique ID of the lead to update |
Request Body
Same parameters as Create Lead endpoint.
Response
Same as Create Lead endpoint.
Delete Lead
Endpoint
DELETE /api/leads/{id}
Description
Deletes a specific lead from the system.
Headers
Authtoken: your_api_key_here
Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| id | integer | Yes | The unique ID of the lead to delete |
Response
Same as Create Lead endpoint.
Get Lead Statuses
Endpoint
GET /api/leads/statuses
Description
Retrieves all available lead statuses.
Headers
Authtoken: your_api_key_here
Response
"data": [
{
"id": 1,
"name": "New",
"color": "#03a9f4"
},
{
"id": 2,
"name": "Contacted",
"color": "#84c529"
}
]
}
">{ "status": true, "data": [ { "id": 1, "name": "New", "color": "#03a9f4" }, { "id": 2, "name": "Contacted", "color": "#84c529" } ] }
Get Lead Notes
Endpoint
GET /api/leads/notes
Description
Retrieves notes associated with leads.
Headers
Authtoken: your_api_key_here
Response
"data": [
{
"id": 1,
"lead_id": 1,
"content": "Note content",
"dateadded": "2024-03-28 10:00:00",
"addedfrom": 1
}
]
}
">{ "status": true, "data": [ { "id": 1, "lead_id": 1, "content": "Note content", "dateadded": "2024-03-28 10:00:00", "addedfrom": 1 } ] }
Add Lead Note
Endpoint
POST /api/leads/notes
Description
Adds a new note to a lead.
Headers
Authtoken: your_api_key_here
Content-Type: application/json
Request Body
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| lead_id | integer | Yes | The ID of the lead |
| content | string | Yes | The note content |
Response
"message": "Note added successfully"
}
">{ "status": true, "message": "Note added successfully" }
Get Converted (FTD) Leads
Endpoint
GET /api/leads/deposits
Description
Retrieves all leads that have been converted to customers (i.e., leads that have made deposits and have a conversion date).
Headers
Authtoken: your_api_key_here
Response
Success Response (200 OK)
"hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631",
"name": "Lead name",
"contact": "",
"title": "",
"company": "Nanza.io",
"description": "",
"country": "243",
"zip": null,
"city": "London",
"state": "London",
"address": "1a The Alexander Suite Silk Point",
"assigned": "5",
"dateadded": "2019-07-18 08:59:28",
"date_converted": "2019-08-15 14:30:22",
"status": "0",
"source": "4",
"email": "",
"website": "",
"phonenumber": "",
"lastcontact": null,
"dateassigned": null,
"last_status_change": null,
"addedfrom": "1",
"default_language": "",
"client_id": "0",
"custom_contact_date": null,
"last_lead_status": "0",
"from_form_id": "0",
"default_currency": "0",
"is_public": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"customfields": []
}
]
">[ { "id": "17", "hash": "c6e938f8b7a40b1bcfd98dc04f6eeee0-60d9c039da373a685fc0f74d4bfae631", "name": "Lead name", "contact": "", "title": "", "company": "Nanza.io", "description": "", "country": "243", "zip": null, "city": "London", "state": "London", "address": "1a The Alexander Suite Silk Point", "assigned": "5", "dateadded": "2019-07-18 08:59:28", "date_converted": "2019-08-15 14:30:22", "status": "0", "source": "4", "email": "", "website": "", "phonenumber": "", "lastcontact": null, "dateassigned": null, "last_status_change": null, "addedfrom": "1", "default_language": "", "client_id": "0", "custom_contact_date": null, "last_lead_status": "0", "from_form_id": "0", "default_currency": "0", "is_public": "0", "show_primary_contact": "0", "stripe_id": null, "registration_confirmed": "1", "customfields": [] } ]
Error Response (200 OK)
"message": "No data were found"
}
">{ "status": false, "message": "No data were found" }