Search leads
Filters leads by field values and optionally by their action history.
- Searches are case-insensitive and exact-match — no substring or fuzzy matching.
- Each filter accepts a single value or an array. Arrays match any of the values (
ORlogic within a field). - Multiple field filters combine with
ANDlogic. - The optional
actionsblock restricts results to leads that have at least one action satisfying all of its sub-criteria. - Results sort newest-first by lead creation timestamp.
Request
| Field | Value |
|---|---|
| Method | POST |
| URL | https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/search |
| Auth | Bearer token (Sync-typed). See Authentication. |
| Headers | Content-Type: application/json |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
enterpriseId | string | yes | The enterprise (workspace) ID. |
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
skip | number | 0 | Pagination offset. |
limit | number | 10 | Page size (1-100). |
Body
An empty body matches all leads.
| Field | Type | Required | Description |
|---|---|---|---|
fields | object | no | Per-field filters. Standard fields (name, phone, email, rating, status, assignee) plus any custom field by API name. Each value can be a single match or an array. |
fields.created_on | object | no | Lead creation date range. Both bounds inclusive: { from, to }. Each accepts a Unix-ms timestamp or a workspace-format date string. |
actions | object | no | Action-history filter. Returns leads with at least one action matching all sub-criteria. |
actions.type | string or array | no | Action type(s). Custom actions by their numeric code ("1001"); built-in types from the Action Types enum. |
actions.performed_by | string or array | no | Email(s) of team members who performed the action. |
actions.performed_at | object | no | Time window: { from, to }. Each bound accepts Unix ms or a date-time string. |
Example request
bash
curl -X POST "https://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/search?limit=20" \
-H "Authorization: Bearer YOUR_SYNC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"status": ["Won"]
},
"actions": {
"type": ["OUTGOING_CALL"],
"performed_by": "agent@company.com",
"performed_at": {
"from": "01/04/2026 00:00:00",
"to": "30/04/2026 23:59:59"
}
}
}'Responses
200 OK
Paginated lead results, sorted newest-first by lead creation timestamp.
json
{
"data": [
{
"fields": {
"name": "Jane Doe",
"phone": "919999999999",
"status": "Won"
}
}
],
"total_count": 1,
"skip": 0,
"limit": 20
}400 Bad Request
Invalid filter values.
json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Rating value must be between 1 and 5"
}
}401 Unauthorized
See the universal 401 in the overview.
Notes
- Each lead in
datais returned without its actions — callGET /lead/{leadId}?includeActions=trueto fetch the timeline of a specific match. - See Action Types for the complete enum accepted by
actions.type. - See Pitfalls for the most common search mistakes.