Saasco logoSaasco logo
Saasco logoSaasco logo

Introduction

Quick StartWhat is Saasco?

Analytics

CRM

getList MembersgetGet List MemberpostQuery List MemberspostAdd to ListdelRemove from ListgetGet Contact Lists

Email Marketing

Knowledge

Support

Projects

List Members

Query List Members

The same result as List Members, but as a POST so it can carry a filter group in the body, for narrowing a list to a sub-segment, or naming exactly which contact properties to return. Use this when the query is too rich for a query string.

POST
/projects/{projectId}/crm/contact-lists/{contactListId}/members/query

Authorization

Authorization
AuthorizationBearer <token>

In: header

Path Parameters

projectIdrequiredstring

ID of the project that owns the list.

contactListIdrequiredstring

ID of the contact list to read.

Request Body

application/json

contactDistinctIdstring

Only return the membership for this contact.

orderBystring

Field to sort by.

Value in: "name" | "createdAt" | "updatedAt"
orderDirectionstring

Sort direction. Ignored unless orderBy is set.

Value in: "asc" | "desc"
skipnumber

Number of members to skip before collecting results.

Default: 0
takenumber

Maximum number of members to return.

Default: 24
attributesarray<string>

Property names to include on each member. Omit for the default set.

contactsFilterGroupobject

Extra attribute and event conditions applied on top of list membership.

filtersrequiredarray<object>

Attribute filters combined with groupType.

attributeDistinctIdrequiredstring

Contact attribute distinct id to filter on.

attributeTypestring

Attribute type. Defaults to string when omitted.

Default: "string"Value in: "string" | "number" | "boolean" | "date" | "url" | "email"
operatorrequiredstring

Comparison operator for the attribute value.

Value in: "equals" | "contains" | "notEquals" | "notContains" | "gt" | "gte" | "lt" | "lte" | "on" | "since" | "before" | "between" | "last"
valuerequiredstring

Value to compare the attribute against.

oneDayEventFiltersarray<object>

Event filters evaluated over the last 24 hours only.

eventNamerequiredstring

Analytics event name.

operatorrequiredstring

Whether the contact performed the event in the last 24 hours.

Value in: "performed" | "notPerformed"
groupTyperequiredstring

How filters in this group are combined.

Value in: "AND" | "OR" | "NOT"
requireSubscribedboolean

When true, the group is ANDed with $subscribed == true. Set by email sending, not the filter UI.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://www.saasco.com/api/v2/projects/string/crm/contact-lists/string/members/query" \  -H "Content-Type: application/json" \  -d '{}'
{
  "count": 0,
  "data": [
    {
      "id": "string",
      "createdAt": "string",
      "updatedAt": "string",
      "projectId": "string",
      "distinctId": "string",
      "email": "string",
      "toDelete": true,
      "properties": {
        "age": 0,
        "avatar": "http://example.com",
        "birthday": "string",
        "createdAt": "string",
        "description": "string",
        "displayName": "string",
        "email": "user@example.com",
        "firstName": "string",
        "gender": "string",
        "id": "string",
        "lastName": "string",
        "name": "string",
        "phone": "string",
        "title": "string",
        "username": "string",
        "website": "string",
        "$id": "string",
        "$lastSeen": "string",
        "$lastIdentifiedAt": "string",
        "$processedAt": "string",
        "$unsubscribed": true,
        "$subscribed": true,
        "$unsubscribeReason": "manual",
        "$unsubscribeSource": "string",
        "$emailValidated": true,
        "$lastEmailValidatedAt": "string",
        "$emailValidationResult": "string",
        "$emailScore": 0,
        "$stripeCustomerId": "string",
        "$os": "string",
        "$browser": "string",
        "$browserVersion": "string",
        "$screenHeight": 0,
        "$screenWidth": 0,
        "$screenDpi": 0,
        "$device": "string",
        "$userAgent": "string",
        "$ip": "string",
        "$timezone": "string",
        "$city": "string",
        "$country": "string",
        "$countryCode": "string",
        "$continent": "string",
        "$region": "string",
        "$locale": "string",
        "$latitude": 0,
        "$longitude": 0,
        "$referrer": "string",
        "$referringDomain": "string",
        "$initialReferrer": "string",
        "$initialReferringDomain": "string",
        "$utmSource": "string",
        "$utmMedium": "string",
        "$utmCampaign": "string",
        "$utmTerm": "string",
        "$utmContent": "string",
        "$initialUtmSource": "string",
        "$initialUtmMedium": "string",
        "$initialUtmCampaign": "string",
        "$initialUtmTerm": "string",
        "$initialUtmContent": "string",
        "$_toDelete": true,
        "$_emailScoreActions": "string",
        "property1": "string",
        "property2": "string"
      }
    }
  ]
}
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}

Get List Member

Fetches a single list-membership record by its own ID. Note this is the membership ID, not the contact's distinct ID. To check whether a given contact is in a list, use List Members with `contactDistinctId`.

Add to List

Adds a contact to a static list. Dynamic lists derive their members from a filter, so adding to one has no lasting effect. Change the list's filter instead.