Skip to content

Search leads for an organization

GET
/organizations/{oid}/leads/find
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.

oid
required
string

Organization ID

q
string

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.

first_name
string

Exact-match filter on first name

last_name
string

Exact-match filter on last name

email_address
string

Exact-match filter on email address

phone_number
string

Exact-match filter on phone number (E.164; a leading + is added if missing)

Matching leads, wrapped in a data envelope (no pagination)

Media typeapplication/json
object
data
required
Array<object>
object
id
string
oid
string
eid
string
first_name
required
string
last_name
required
string
phone_number
string
email_address
string
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.

Media typeapplication/json

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
error

Machine-readable error code.

string
message

Human-readable detail.

string
Example
{
"error": "At least one search parameter is required (q, first_name, last_name, email_address, phone_number)"
}

Unauthorized