List who joined or left a segment on a day
GET/v1/segments/{id}/membership-changes
Requires an API key with the contacts:read scope. About keys and scopes
Works with integration, agent and partner keys.
The contacts who joined (change=joined) or left (change=left) the segment on day, in the workspace timezone, newest first, from the changes recorded then (kept as long as the workspace's events). meta.count is that day's joinedCount or leftCount from getSegmentSizeHistory, on the first page only (null with a cursor), so the list and the chart agree.
Path parameters
idstringrequiredThe segment's id.
uuid
Query parameters
limitintegeroptionalHow many items a page holds: 1 to 100, 20 by default.
min > 0 · max 100 · default
20cursorstringoptionalWhere the page starts: the previous page's
meta.pagination.nextCursor. Omit it for the first page, and send the same filters with it.1–2,048 characters
changestringrequiredWho joined (
joined) or left (left) the segment.one of
joined,leftdaystringrequiredThe day,
YYYY-MM-DDin the workspace timezone.date
Header parameters
Kirora-WorkspacestringoptionalPartner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.
pattern
^[A-Za-z0-9._:-]{1,128}$
Returns
Returns 200 OK with a list of ContactDetail objects in data, and the next page's cursor in meta (see pagination). Otherwise returns an error; Errors lists every code and which to retry.
idstringrequireduuid
externalIdstring | nullrequiredYour own id for the contact, if set.
emailstring | nullrequiredemail
firstNamestring | nullrequiredlastNamestring | nullrequiredphonestring | nullrequiredPhone number in E.164 format.
timezonestring | nullrequiredIANA timezone, e.g.
Europe/London.countrystring | nullrequiredISO 3166-1 alpha-2 code: as written, or inferred from the phone, else the timezone.
localestring | nullrequiredBCP 47 tag (
fr,fr-CA): the language the contact reads (its first subtag), and how merge tags format numbers, dates and money for them.rfmobject | nullrequiredThe contact's RFM (recency, frequency and monetary value) group among the workspace's customers, from its purchase events (the workspace's
purchaseEvent: an order, a paid invoice, a booking, a donation), each score from 1 to 5 (a fifth of the customers each; 5 is the most recent, most frequent or highest spend), and their purchase totals. Spend counts only purchases in the workspace's main currency; when the purchase carries no amount,monetaryfollows frequency. Recomputed daily, so a purchase today shows tomorrow;nullfor someone who has never purchased.7 child attributes
groupstringrequiredone of
champions,loyal,cant_lose_them,potential_loyalists,new_customers,need_attention,about_to_sleep,at_risk,hibernating,lostrecencyintegerrequiredmin 1 · max 5
frequencyintegerrequiredmin 1 · max 5
monetaryintegerrequiredmin 1 · max 5
purchaseCountintegerrequiredTheir purchase events (the workspace's
purchaseEvent), in any currency.min > 0
totalSpentobject | nullrequiredWhat their purchases' amounts (
purchaseValueProperty) add up to, in the workspace's main currency (currencyonGET /v1/reports/rfm); purchases in other currencies and refunds are left out.nullwhen the purchase carries no amount.2 child attributes
currencystring | nullrequiredThe currency, an ISO 4217 code; null when none was named.
valuenumberrequiredThe amount in that currency.
lastPurchasedAtstringrequiredWhen their latest purchase happened.
date-time
datesmap<string, string>requiredNamed calendar dates, e.g.
birthday, asYYYY-MM-DDor--MM-DD.attributesmap<string, object>requiredCustom attributes, keyed by attribute name.
consentContactConsentrequiredConsent on each channel.
2 child attributes
emailbooleanrequiredWhether the contact has consented to email.
pushbooleanrequiredWhether the contact has consented to push.
createdAtstringrequireddate-time
updatedAtstringrequireddate-time
emailSuppressionobjectrequired2 child attributes
suppressedbooleanrequiredWhether email to this contact is blocked.
reasonstring | nullrequiredWhy email to this contact is suppressed:
bounced,complained,complained_transactional,unsubscribed,manual,imported, orother_workspace(a bounce or complaint in another workspace with the same owner or partner).
listIdsstring[]requiredIds of the lists the contact is in.