Search Leads (v2)
Search leads using structured filters and an optional text query. Each result uses the same response shape as Get Lead by ID, except duplicatedConnections is omitted from search results.
Authentication
Pass your customer-managed API key in the Authorization header.
Authorization: <your-api-key>
If you are using an OAuth2 token instead:
Authorization: Bearer <oauth2-token>
Endpoint
POST https://api.popl.co/api/pub/v2/leads/search
Request Body
{
"filters": {
"assignedMemberIds": [111, 222],
"startTime": "2024-01-01T00:00:00+00:00",
"endTime": "2024-12-31T23:59:59+00:00",
"tagIds": [12, 15],
"campaignIds": [101],
"leadSource": ["QR_CODE_SCAN", "APP_TO_APP"],
"exported": false,
"leadEntries": "single",
"hasEmail": true
},
"query": [
{
"fields": ["firstName", "lastName"],
"value": "john",
"match": "FUZZY"
}
],
"sort": {
"field": "timestamp",
"direction": "DESC"
},
"cursor": null,
"includeDefaultLeads": true
}Request Parameters
filtersis required. Exactly one of these scope filters must be provided:assignedMemberIds,subteamIds, orteamIdOptional filters:
startTime,endTime,tagIds,campaignIds,leadSource,exported,leadEntries,hasEmailqueryis an optional array of text search clausesquery.fieldsmust usecamelCase, such asfirstName,lastName,companyNamequery.matchcan beEXACTorFUZZYsort.fieldis currently onlytimestampsort.directioncan beASCorDESCcursoris an opaque pagination cursorincludeDefaultLeadsdefaults totrue
Response
Notes
Search results omit
duplicatedConnectionsassignedMemberId,memberData, andsystemFields.assignedMemberIdare not returned in the pub/v2 responseUse
assignedMembersandmemberDetailsinsteadPagination uses a cursor. Pass the returned
cursorto retrieve the next page
Errors
400 INVALID_REQUEST— Request body failed validation401 TOKEN_UNAUTHORIZED— API key is missing, invalid, or the requester lacks access
Last updated