MngGetLeadsListByDesk¶
MngGetLeadsListByDesk returns a compact lead list for CRM selectors, calendar links, note links, assignment screens, and other UI controls that need to reference a lead without loading the full lead table.
The method is desk-scoped by the backend. The frontend does not pass deskFilter; the server resolves current manager access from the cached staff record and applies the manager brand / desks scope.
SEO Summary¶
Use MngGetLeadsListByDesk when a CRM frontend needs a lightweight lead dropdown or autocomplete source filtered by manager desk permissions. The response includes lead id, full name, and masked email only, reducing payload size and avoiding exposure of full contact data in list selectors.
Access Control¶
Requires CRM access and see_customers. Returned rows are limited to the manager desk scope unless the manager has see_all_customers or admin scope. Lead brand must match manager brand when brand scope is set.
🛡️ Access Level Required:
SESSION_MANAGER,SESSION_ADMIN,SESSION_DEALER,SESSION_CRM_MANAGER,SESSION_CRM_ADMIN
Backend Scope Rules¶
The backend uses __access.id only to identify the manager, then loads permissions and scope from staff cache. It returns only leads visible by brand / desks scope.
No request-provided deskFilter is accepted for this method. This prevents the client from widening CRM visibility beyond the current manager session scope.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
__access |
object | Yes | Session access object injected by backend/session layer |
Request Example¶
{
"command": "MngGetLeadsListByDesk",
"extID": "1",
"data": {}
}
Response Schema¶
| Name | Type | Description |
|---|---|---|
structure |
string[] | Column names for row values |
rows |
array[] | Lead rows using structure order |
Row Fields¶
| Field | Type | Description |
|---|---|---|
lead_id |
int | Lead id |
full_name |
string | Lead full name |
email |
string | Masked lead email |
Response Example¶
{
"structure": ["lead_id", "full_name", "email"],
"rows": [
[1001, "Anna Lead", "a***@example.com"],
[1002, "Mark Prospect", "m***@example.com"]
]
}
Notes¶
- Email is masked with the same masking helper used by CRM lead list responses.
- This method is intended for lightweight selectors, not for table views.
- For paginated table views with custom filters, use
MngGetLeadsByFilter. - Desk access comes from cached manager configuration, so changes to
ManagerRecord.desksaffect future calls without requiring a frontend-provided filter.