API Reference - Leads
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108049
← Back to API Reference | Getting Started
Leads
Leads are inquiries submitted by visitors seeking to connect with members. Leads can be automatically matched to relevant members based on category, location, and service area criteria.
leads — DB table: leadsThe Lead Object
| Field | Type | Description |
|---|---|---|
lead_id | integer | Unique lead ID (primary key, read-only) |
lead_name | string | Contact name of the lead submitter |
lead_email | string | Email address of the lead submitter |
lead_phone | string | Phone number of the lead submitter |
lead_message | text | Full message/description of the lead request |
lead_notes | text | Internal notes about this lead |
lead_location | string | Formatted location address for this lead |
top_id | integer | Top-level category ID for matching |
sub_id | integer | Sub-category ID for matching |
lat | string | Latitude coordinate |
lng | string | Longitude coordinate |
status | string | Lead status |
lead_price | number | Price associated with this lead |
date_added | string | Date lead was created (format: YYYYMMDDHHmmss) |
formname | string | Name of the form used to submit this lead |
url_from | string | URL of the page where lead was submitted |
token | string | Unique lead token (auto-generated) |
CONTACT_TYPE | string | Type of contact/inquiry |
origin_ip | string | IP address of the submitter |
flow_source | string | Source of the lead flow |
additional_replies | string | 1 to allow additional replies, 0 otherwise |
lead_more | integer | Flag indicating additional lead information is available |
utoken | string | User token identifying the visitor who submitted the lead |
swlat | string | Southwest boundary latitude (geocoded bounding box) |
swlng | string | Southwest boundary longitude (geocoded bounding box) |
nelat | string | Northeast boundary latitude (geocoded bounding box) |
nelng | string | Northeast boundary longitude (geocoded bounding box) |
location_type | string | Geocode precision level (e.g. ROOFTOP, APPROXIMATE, postal_code) |
country_sn | string | Country short name/code from geocoding (e.g. US) |
adm_lvl_1_sn | string | Administrative level 1 short name from geocoding (e.g. state code CA) |
DATE | string | Lead submission date |
user_consent | text | Record of user consent (GDPR/privacy compliance) |
revision_timestamp | timestamp | Last revision timestamp |
lead_preferred_day | string | Preferred day for lead contact |
lead_preferred_time | string | Preferred time for lead contact |
sub_sub_id | integer | Sub-sub category ID |
lead_submission_location | string | Location from which lead was submitted |
auto_geocode_result | string | Automatic geocode result |
lead_matches | object | Nested lead matches data (included on single-record GET responses) |
list_profession | integer | Category lookup: has profession listing (0 or 1) |
list_services_sub | integer | Category lookup: has sub-service listing (0 or 1) |
list_services_sub_sub | integer | Category lookup: has sub-sub-service listing (0 or 1) |
List Leads
curl -X GET "https://www.yourdomain.com/api/v2/leads/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Retrieve a Lead
curl -X GET "https://www.yourdomain.com/api/v2/leads/get/55" \ -H "X-Api-Key: your-api-key-here"
Create a Lead
Creates a new lead. After creation, the lead can be matched to members using the Match endpoint.
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/leads/create" \ -H "X-Api-Key: your-api-key-here" \ -d "lead_name=Bob+Johnson" \ -d "lead_email=bob@example.com" \ -d "lead_phone=555-123-4567" \ -d "lead_message=I+need+a+plumber+for+a+leak" \ -d "lead_location=Chicago%2C+IL" \ -d "top_id=12"
Example Response
{
"status": "success",
"message": {
"lead_id": "201",
"lead_name": "Bob Johnson",
"lead_email": "bob@example.com",
"lead_phone": "555-123-4567",
"token": "a1b2c3d4e5f6",
"date_added": "2026-03-01T12:00:00+00:00",
"status": "2",
"lead_price": "0.00",
"lead_more": "0",
"lead_notes": "",
"revision_timestamp": "2026-03-01T12:00:00+00:00",
"lead_message": "I need a plumber for a leak",
"top_id": "12",
"sub_id": "0",
"lead_location": "Chicago, IL",
"flow_source": "default_flow",
"lead_status": "1"
}
}Match a Lead
Triggers the automatic lead-matching algorithm for an existing lead. The system finds members whose category, location, and service area match the lead's criteria and sends them lead notification emails.
Parameters
| Parameter | Type | Description |
|---|---|---|
lead_id | integer | Required — ID of the lead to match |
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/leads/match" \ -H "X-Api-Key: your-api-key-here" \ -d "lead_id=201"
Example Response
{
"status": "success",
"message": "Lead matched to 5 members"
}Update a Lead
Example Request
curl -X PUT "https://www.yourdomain.com/api/v2/leads/update" \ -H "X-Api-Key: your-api-key-here" \ -d "lead_id=201" \ -d "lead_name=Bob+Johnson+Updated" \ -d "lead_notes=Resolved+by+member+#42"
Example Response
{
"status": "success",
"message": {
"lead_id": "201",
"lead_name": "Bob Johnson Updated",
"lead_email": "bob@example.com",
"lead_phone": "555-123-4567",
"token": "a1b2c3d4e5f6",
"date_added": "2026-03-01T12:00:00+00:00",
"status": "2",
"lead_price": "0.00",
"lead_more": "0",
"lead_notes": "Resolved by member #42",
"revision_timestamp": "2026-03-01T12:00:00+00:00",
"lead_message": "I need a plumber for a leak",
"top_id": "12",
"sub_id": "0",
"lead_location": "Chicago, IL",
"flow_source": "default_flow",
"lead_status": "1"
}
}Delete a Lead
Example Request
curl -X DELETE "https://www.yourdomain.com/api/v2/leads/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "lead_id=201"
Example Response
{
"status": "success",
"message": "leads record was deleted"
}