Search leads for an organization
const url = 'https://apisandbox.puurk.com/organizations/example/leads/find';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apisandbox.puurk.com/organizations/example/leads/find \ --header 'Authorization: Bearer <token>'Search leads within an organization, in one of two mutually exclusive modes: a free-text query (q), or exact-match field filters (first_name, last_name, email_address, phone_number, combined with AND). At least one search parameter is required; combining q with a field filter returns 400.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization ID
Query Parameters
Section titled “Query Parameters”Free-text search query (fuzzy name search; also exact email/phone match when the value looks like one). Cannot be combined with the field parameters.
Exact-match filter on first name
Exact-match filter on last name
Exact-match filter on email address
Exact-match filter on phone number (E.164; a leading + is added if missing)
Responses
Section titled “Responses”Matching leads, wrapped in a data envelope (no pagination)
object
object
Example
{ "data": [ { "id": "HaFjsdk2141811fasF", "oid": "1249fDSZ6714ekjfFK", "first_name": "Jane", "last_name": "Doe", "phone_number": "+1544123456", "email_address": "janedoe@email.com" } ]}Invalid search parameters. Returned when no search parameter is supplied, or when q is combined with any of first_name, last_name, email_address or phone_number. For this endpoint error carries the human-readable reason and there is no message.
The standard error body. error is a stable, machine-readable code — branch on it rather than on message, which is for humans and may change.
object
Machine-readable error code.
Human-readable detail.
Example
{ "error": "At least one search parameter is required (q, first_name, last_name, email_address, phone_number)"}Unauthorized