The /search/leads
resource is used to find leads using full text
search. For example, you can search for fred
in texas
using:
/search/leads?query=fred+tx
/search/leads?query=fred
FRED
and fred
will both match Fred
/search/leads?query=sam
will match sam
and
samantha
fred tx
will match leads that have
both fred
AND tx
"fred tx"
will only match that exact textThe search results can be sorted and paginated. There are two query
parameter to control sorting: sort_by
and sort_dir
. The sort_by
parameter takes a field name (see list below) and sort_dir
is ascending
(asc
) or descending (desc
). By default, the results are sorted by
relevance.
There are two query parameters to control paging: from
and limit
. The
from
parameter specifies the starting offset of that page in the search
results and the limit
parameter specifies how many search results to
return. From is zero-based so to get the first 10 results, use
from=0&limit=10
, the second 10 using from=10&limit=10
, etc... The
maximum limit
is 100 at a time, with an overall maximum of 1,000 search
results.
The search results has the total number of matching leads and an array of hits, where each hit is a matching Lead Search Result. Each lead search result contains basic information about the lead, the latest event for that lead, and highlighting of the matched text.
OK
curl -i -X GET \ 'https://app.leadconduit.com/search/leads?query=string&sort_by=lead_id&sort_dir=asc&from=0&limit=0'
[- {
- "address_1": "string",
- "city": "string",
- "email": "string",
- "first_name": "string",
- "flow_id": "string",
- "flow_name": "string",
- "last_name": "string",
- "lead_id": "string",
- "phone_1": "string",
- "phone_2": "string",
- "postal_code": "string",
- "reference": "string",
- "source_id": "string",
- "source_name": "string",
- "state": "string",
- "submission_timestamp": "2019-08-24T14:15:22Z",
- "highlight": { },
- "latest_event": {
- "id": "string",
- "type": "source",
- "outcome": "failure",
- "reason": "NREL failure",
- "vars": {
- "vars": { }
}, - "module_id": "string",
- "acceptance_criteria": {
- "rule_set": {
- "id": "string",
- "op": "and",
- "rules": [
- {
- "id": "string",
- "lhv": "lead.state",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}, - "outcome": "string",
- "reason": "string"
}, - "flow_acceptance_criteria": {
- "rule_set": {
- "id": "string",
- "op": "and",
- "rules": [
- {
- "id": "string",
- "lhv": "lead.state",
- "op": "is equal to",
- "rhv": "TX",
- "rule_set": { }
}
]
}, - "outcome": "string",
- "reason": "string"
}, - "pricing": {
- "override": true,
- "prices": [
- {
- "id": { },
- "amount": 0,
- "rule_set": {
- "id": "string",
- "op": "and",
- "rules": [
- null
]
}
}
]
}, - "flow_pricing": {
- "override": true,
- "prices": [
- {
- "id": { },
- "amount": 0,
- "rule_set": {
- "id": "string",
- "op": "and",
- "rules": [
- null
]
}
}
]
}, - "cost": 0,
- "purchase_price": 0,
- "recipient_revenue": 0,
- "step_count": 0,
- "disabled_step_count": 0,
- "package_version": "string",
- "handler_version": "string",
- "request": { },
- "response": { },
- "flow_caps": [
- {
- "id": "string",
- "cap_ids": [
- "string"
], - "caps": [
- { }
], - "count": 0,
- "duration": 1,
- "duration_units": "month",
- "expires_at": "2020-11-23T11:41:52Z",
- "failed_count": 0,
- "flow_id": "string",
- "maximum": 1200,
- "name": "Monthly leads from TX",
- "source_id": "string",
- "started_at": "2020-11-23T11:41:52Z",
- "step_id": "string",
- "time_zone": "America/New_York",
- "type": "volume",
- "updated_at": "2020-11-23T11:41:52Z"
}
], - "source_caps": [
- {
- "id": "string",
- "cap_ids": [
- "string"
], - "caps": [
- { }
], - "count": 0,
- "duration": 1,
- "duration_units": "month",
- "expires_at": "2020-11-23T11:41:52Z",
- "failed_count": 0,
- "flow_id": "string",
- "maximum": 1200,
- "name": "Monthly leads from TX",
- "source_id": "string",
- "started_at": "2020-11-23T11:41:52Z",
- "step_id": "string",
- "time_zone": "America/New_York",
- "type": "volume",
- "updated_at": "2020-11-23T11:41:52Z"
}
], - "start_timestamp": 0,
- "end_timestamp": 0,
- "firehose": {
- "credential_id": "string",
- "bucket": "string",
- "enabled": true,
- "prefix": "string"
}, - "ms": 0,
- "wait_ms": 0,
- "overhead_ms": 0,
- "lag_ms": 0,
- "host": "string",
- "cap_reached": true,
- "flow_ping_limits": {
- "id": "string",
- "name": "string",
- "maximum": 0,
- "duration": 0,
- "duration_units": "string",
- "time_zone": "string",
- "created_at": "2019-08-24T14:15:22Z"
}, - "source_ping_limits": {
- "id": "string",
- "name": "string",
- "maximum": 0,
- "duration": 0,
- "duration_units": "string",
- "time_zone": "string",
- "created_at": "2019-08-24T14:15:22Z"
}, - "ping_limit_reached": true,
- "expires_at": "2019-08-24T14:15:22Z"
}
}
]