Search Persons
| ⚠️ This endpoint is currently in BETA |
|---|
Search for Persons matching the given criteria.
Accepts an optional combination of filters, sorts, and a search term. Omitting the body is equivalent to GET /v2/persons with default pagination.
Requires the "Export All People directory" permission.
Field IDs
Field IDs used in filters, sorts, and search.fieldIds follow the formats described in Working with Field Data. Use GET /v2/persons/fields to discover the available fields and their valueType.
attributeId
Some fields require an attributeId to specify which aspect to filter or sort on. The following relationship intelligence fields all use attributeId: "date-of-activity": last-email, first-email, last-contact, last-event, first-event, next-event.
Use GET /v2/persons/fields to confirm which fields require an attributeId.
Search
The search.term is always matched against the person's first name, last name, and primary email address. Providing search.fieldIds extends the search to those additional fields; it does not restrict matching to only those fields. Fields with a valueType of datetime are not searchable and are silently ignored if included in search.fieldIds.
Limits
-
Items per filter group (filters or nested groups): 50
-
Values per filter (e.g. options in is-any-of): 100
-
Sort criteria: 5
-
Search term minimum length: 3 characters
-
Results per page: 100
Pagination
Uses cursor-based pagination.
Query parameters
Specific field IDs for which to return field data on each Person. Cannot be used together with fieldTypes; use one or the other. Use GET /v2/persons/fields to discover available field IDs.
A category of fields for which to return field data on each Person. Cannot be used together with fieldIds; use one or the other.
Cursor for the next or previous page.
Maximum number of Persons to return per page.
When true, includes the total count of matching Persons in the pagination response. Adds additional query cost; use only when needed.
Request body
Example request
{
"filters": {
"filters": [
{
"value": [
{
"id": 1
}
]
}
]
}
}Response
Created
Example response
{
"data": [
{
"id": 1,
"firstName": "Jane",
"lastName": "Smith",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"emailAddresses": [
"jane.smith@northpointvc.com"
],
"type": "internal",
"fields": []
},
{
"id": 2,
"firstName": "Michael",
"lastName": "Torres",
"primaryEmailAddress": "m.torres@northpointvc.com",
"emailAddresses": [
"m.torres@northpointvc.com"
],
"type": "external",
"fields": []
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/persons?cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/persons?cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}