Docs·Segments

GET/api/v1/spreelytics/cohorts

List segments

Returns every segment in the audience, newest first, each with its full definition. The app calls a cohort a segment; the API keeps the older name. Member counts are not included, because membership is worked out live: count a segment by sending its definition to POST /people/query.

Every role can call it, Viewer included.

Keys: an account key or an audience key. Getting started explains both kinds.

Parameters

PropInTypeNotes
contactListIdquerystringThe audience id, a UUID. With an audience key it must be that key's own audience.

Response

An array of SpreelyticsCohortDto.

PropTypeNotes
idstringThe segment id. Use it in a chart filter (inCohort), a cohort series or the analytics cohort_id filter.
namestringThe segment name.
descriptionstringThe description, or null when there is none.
definitionPeopleQueryRequestDtoThe people-query exactly as saved. Send it to POST /people/query to count the members, or to POST /people/query/members to list them.
createdAtstringWhen it was created. Only the create call answers in ISO 8601 (2026-09-30T09:00:00.000Z). Every other call returns the database form (2026-09-30 09:00:00+00), so parse both.
updatedAtstringWhen it last changed. Create and update calls answer in ISO 8601, lists and reads in the database form, as with createdAt.

Request

curl 'https://app.spreelytics.com/api/v1/spreelytics/cohorts?contactListId=…' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/spreelytics/cohorts');
url.searchParams.set('contactListId', '…');

const res = await fetch(url, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
const data = await res.json();
import requests

res = requests.get(
    "https://app.spreelytics.com/api/v1/spreelytics/cohorts",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"contactListId": "…"},
)
data = res.json()

Response

[
  {
    "id": "string",
    "name": "string",
    "description": "string",
    "definition": {
      "conditions": [
        {
          "source": null,
          "kind": null,
          "event": null,
          "minAmount": null,
          "minCount": null,
          "countOp": null,
          "propertyFilters": null,
          "property": null,
          "propertyOp": null,
          "values": null,
          "timeframe": null
        }
      ],
      "match": "all",
      "breakdown": "channel",
      "startDate": "string",
      "endDate": "string"
    },
    "createdAt": "string",
    "updatedAt": "string"
  }
]

See your own numbers today.

Free up to 100k events a month · no credit card

Contact

Tell us what you need.

A real person reads these. We usually reply within one working day.

Or email us directly at contact@spreelytics.com.