Leads TCP API¶
Lead is a pre-customer CRM entity. It is converted to Customer explicitly and does not have customer auth, KYC/AML lifecycle, or account binding by default.
Access Control¶
All lead methods require one of:
SESSION_MANAGERSESSION_ADMINSESSION_DEALERSESSION_CRM_MANAGERSESSION_CRM_ADMIN
Manager access is resolved from the cached staff record. The token is used only as a source of manager id and session type; permissions, brand, desks, and groups are not trusted from the token.
Lead visibility is scoped by manager CRM permissions and lead brand / desk:
| Permission | Used for |
|---|---|
see_customers |
Read leads and lead lists |
set_customers |
Create, update, archive, or convert leads |
del_customers |
Delete leads |
see_all_customers |
Bypass personal desk scope for lead visibility |
see_customer_contacts |
Return unmasked lead contact fields |
set_customer_contacts |
Set lead contacts or convert a lead with contact fields |
Without see_customer_contacts, lead email and phone are returned masked where the method can return contact fields.
Core Fields¶
| Field | Type | Description |
|---|---|---|
lead_id |
int | Lead id |
brand |
string | Brand namespace |
desk |
string | CRM desk code, for example DESK_RETENTION |
manager_id |
int | Current owner manager |
assigned_manager_id |
int | Pending assignment manager |
type |
int | 0 individual, 1 business |
status |
int | 0 new, 1 in progress, 2 qualified, 3 unqualified, 4 converted, 5 archived |
source_type |
int | 0 manual, 1 web, 2 import, 3 affiliate, 4 system |
email |
string | Lead email |
phone |
string | Lead phone |
sales_status, finance_status, risk_status |
int | CRM status dictionary ids |
converted_customer_id |
int | Created customer id after conversion |
created_time, updated_time, archive_time, conversion_time |
time_t | Lead lifecycle timestamps |
Commands¶
- MngAddLead
- MngUpdateLead
- MngDeleteLead
- MngArchiveLead
- MngGetLead
- MngGetLeadsByFilter
- MngGetLeadsListByDesk
- MngConvertLeadToCustomer
Paginated table methods such as MngGetLeadsByFilter require a deskFilter wildcard mask. Lightweight desk list methods such as MngGetLeadsListByDesk read desk access from the current manager session. See Desks TCP API.