API
API Reference
Contacts
Search Contacts

Search Contacts

Search your contacts by core fields, the company they belong to and custom contact property codenames, with pagination and property selection.

For interactive API documentation, see the Swagger reference (opens in a new tab).

Endpoint

MethodURL
POSThttps://api.customerscore.io/api/v1/contacts/search

Request Body

All fields are optional. An empty body matches all contacts.

FieldTypeRequiredDescription
filtersarrayNoFilter conditions, combined with AND. Maximum 10. Omit or leave empty to match all contacts.
propertiesstring[]NoContact property codenames to include in the properties object. Omit to return all. Core fields are always returned regardless.
limitintegerNoMaximum number of records per page. Default 100, minimum 1, maximum 1000.
afterintegerNoPagination cursor. Pass the paging.next.after value from the previous response to fetch the next page.

Filter Object

Each item in filters describes a single condition.

FieldTypeRequiredDescription
propertyNamestringYesA contact property codename (see Contact attributes (opens in a new tab) and Contact metrics (opens in a new tab)), or one of the core fields: name, engagementscore, engagementscore_difference, last_seen, tags, customer_external_id.
operatorstringYesComparison operator — see the table below.
valuestringNoSingle value for the comparison. Not used for KNOWN/UNKNOWN, or when values is provided.
valuesstring[]NoList of values for the IN / NIN operators.

Operators

OperatorMeaningValue
EQEqual tovalue
NEQNot equal tovalue
LTLess thanvalue
LTELess than or equal tovalue
GTGreater thanvalue
GTEGreater than or equal tovalue
LIKEContainsvalue
NLIKEDoes not containvalue
INIs one ofvalues (array)
NINIs none ofvalues (array)
GTDMore than N days ago (date offset)value (number of days)
LTDLess than N days ago (date offset)value (number of days)
KNOWNHas a value (not empty)none
UNKNOWNHas no value (empty)none

All filters are combined with AND. All contacts are returned, including contacts of churned customers. The customer-only fields fitscore, churn_risk, upsell_score, is_churned and owner cannot be used to filter contacts.

Filtering by customer and tags

Filter customer_external_id by the external ID of the customer the contact belongs to, and tags by tag title.

FieldValue to passOperatorsExample
customer_external_idCustomer external ID(s)EQ, NEQ, IN, NIN{ "propertyName": "customer_external_id", "operator": "EQ", "value": "12345" }
tagsTag title(s)EQ, NEQ, IN, NIN, KNOWN, UNKNOWN{ "propertyName": "tags", "operator": "IN", "values": ["Champion", "Decision maker"] }

Customer external IDs are matched exactly (case-sensitive); tag titles are matched case-insensitively. For tags, an IN (or EQ) filter matches contacts that have any of the listed tags. Values that don't match any customer or tag simply return no results (IN/EQ) or all results (NIN/NEQ).

Example Request

curl -X POST "https://api.customerscore.io/api/v1/contacts/search" \
  -H "Content-Type: application/json" \
  -H "customerscore-key: your-generated-key" \
  -d '{
    "filters": [
      { "propertyName": "customer_external_id", "operator": "EQ", "value": "12345" },
      { "propertyName": "engagementscore", "operator": "GTE", "value": "50" }
    ],
    "properties": ["job_title", "email"],
    "limit": 100
  }'

Response Body

FieldTypeDescription
resultsarrayMatching contacts, ordered by id ascending. See the contact object below.
pagingobjectPresent only when more pages are available. Contains next.after cursor.

Contact Object

FieldTypeNullableDescription
idstringNoContact external ID (the identifier from your system).
customerscore_idnumberNoInternal CustomerScore ID of the contact record.
namestringYesContact name.
engagementscorenumberYesEngagement (health) score.
engagementscore_differencenumberYesEngagement score change since the previous scoring record.
engagementscore_trendobjectYesEngagement score history (last 15 records within 1 year), keyed by scoring date (YYYY-MM-DD).
last_seenstringYesLatest scoring date (YYYY-MM-DD).
tagsstring[]NoTitles of the tags assigned to this contact. Empty array when none.
customer_external_idstringYesExternal ID of the customer the contact belongs to.
customer_customerscore_idnumberYesInternal CustomerScore ID of the customer the contact belongs to.
propertiesobjectNoCustom contact property values keyed by codename.
createdAtstringYesWhen the contact record was created (ISO 8601).
updatedAtstringYesWhen the contact record was last updated (ISO 8601).

Example Response

{
  "results": [
    {
      "id": "contact-001",
      "customerscore_id": 45678,
      "name": "John Doe",
      "engagementscore": 72,
      "engagementscore_difference": 4,
      "engagementscore_trend": {
        "2024-06-14": 68,
        "2024-06-15": 72
      },
      "last_seen": "2024-06-15",
      "tags": ["Champion"],
      "customer_external_id": "12345",
      "customer_customerscore_id": 98765,
      "properties": {
        "job_title": "CTO",
        "email": "[email protected]"
      },
      "createdAt": "2024-01-10T08:30:00.000Z",
      "updatedAt": "2024-06-15T09:00:00.000Z"
    }
  ],
  "paging": {
    "next": {
      "after": 45678
    }
  }
}

Pagination. Results are returned in pages ordered by an internal cursor. When a paging.next.after value is present, more results are available — pass it as after in your next request. Keep requesting until the response no longer contains a paging object.

Response Codes

CodeDescription
200Matching contacts returned
400Bad request (e.g. unknown property codename, invalid operator, customer-only filter field)
401Unauthorized - Missing customerscore-key in the header
403Forbidden - Invalid key
405Method Not Allowed - Only POST method is allowed