API
API Reference
Customer
Search Customers

Search Customers

Search your customers by core fields and custom 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/customers/search

Request Body

All fields are optional. An empty body matches all (active) customers.

FieldTypeRequiredDescription
filtersarrayNoFilter conditions, combined with AND. Maximum 10. Omit or leave empty to match all customers.
propertiesstring[]NoCustom 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 custom property codename, or one of the core fields: name, is_churned, fitscore, engagementscore, engagementscore_difference, churn_risk, last_seen, owner, tags.
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. By default only active customers are returned. To include or target churned customers, add an is_churned filter (EQ with value true returns churned customers only, EQ with value false returns active customers only).

Filtering by owner and tags

Filter owner by the email of the owning user and tags by tag title. Both support the operators EQ, NEQ, IN, NIN, KNOWN and UNKNOWN only.

FieldValue to passExamples
ownerUser email address(es){ "propertyName": "owner", "operator": "EQ", "value": "jane@acme.com" }
tagsTag title(s){ "propertyName": "tags", "operator": "IN", "values": ["VIP", "Trial"] }

For tags, an IN (or EQ) filter matches customers that have any of the listed tags. Use KNOWN/UNKNOWN to match customers that have any owner/tag or none at all. Emails and tag titles are matched case-insensitively; values that don't match any user or tag simply return no results (IN/EQ) or all results (NIN/NEQ).

Example Request

curl -X POST "https://api.customerscore.io/api/v1/customers/search" \
  -H "Content-Type: application/json" \
  -H "customerscore-key: your-generated-key" \
  -d '{
    "filters": [
      { "propertyName": "fitscore", "operator": "GTE", "value": "75" },
      { "propertyName": "plan", "operator": "IN", "values": ["enterprise", "pro"] }
    ],
    "properties": ["mrr", "plan"],
    "limit": 100
  }'

Response Body

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

Customer Object

FieldTypeNullableDescription
idstringNoCustomer external ID (the identifier from your system).
customerscore_idnumberNoInternal CustomerScore ID of the customer record.
namestringYesCustomer name.
fitscorenumberYesFit score.
engagementscorenumberYesEngagement (health) score.
churn_risknumberYesChurn risk score.
is_churnedbooleanYesWhether the customer is churned.
last_seenstringYesLatest scoring date (YYYY-MM-DD).
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).
ownerstringYesEmail of the user who owns this customer. null when unassigned.
tagsstring[]NoTitles of the tags assigned to this customer. Empty array when none.
propertiesobjectNoCustom property values keyed by codename.
createdAtstringYesWhen the customer record was created (ISO 8601).
updatedAtstringYesWhen the customer record was last updated (ISO 8601).

Example Response

{
  "results": [
    {
      "id": "12345",
      "customerscore_id": 98765,
      "name": "Acme Corporation",
      "fitscore": 82,
      "engagementscore": 67,
      "churn_risk": 18,
      "is_churned": false,
      "last_seen": "2024-06-15",
      "engagementscore_difference": 3,
      "engagementscore_trend": {
        "2024-06-14": 64,
        "2024-06-15": 67
      },
      "owner": "jane@acme.com",
      "tags": ["VIP", "Trial"],
      "properties": {
        "mrr": 1500,
        "plan": "enterprise"
      },
      "createdAt": "2024-01-10T08:30:00.000Z",
      "updatedAt": "2024-06-15T09:00:00.000Z"
    }
  ],
  "paging": {
    "next": {
      "after": 1234
    }
  }
}

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 customers returned
400Bad request (e.g. unknown property codename, invalid operator)
401Unauthorized - Missing customerscore-key in the header
403Forbidden - Invalid key
405Method Not Allowed - Only POST method is allowed