API reference / Customers
Save a segment of customers
Saves some rules that pick customers. A customer is in the segment when every rule is true for it. A workspace keeps 50 segments.
/api/v1/customer-segmentsOther ways to call it
troopy customers segment-addIdempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.Body
application/jsonname*stringAt least 1 characters · At most 60 characters
rules*array<object>At most 6 items
3 properties
field*enum<string>statusplanriskpayingactivatedsteadychannelsourcecountrytrait
keystringFor trait: the name of the trait
values*array<string>The customer has one of these values. For paying, activated and steady: yes or no
At most 20 items
sharedbooleanfalse: only the person who made it sees it
Default true
Response
201 · application/jsondata*object7 properties
id*stringA 24-character id
name*stringrules*array<object>A customer is in the segment when every rule is true for it
3 properties
field*enum<string>statusplanriskpayingactivatedsteadychannelsourcecountrytrait
keystringFor trait: the name of the trait
values*array<string>The customer has one of these values. For paying, activated and steady: yes or no
At most 20 items
shared*booleantrue: everyone in the workspace sees it. false: only the person who made it
by*objectWho made it
2 properties
type*stringname*string | nullcustomers*integerThe customers in the segment now
createdAt*stringISO 8601 date and time