Fetching segments

Customer segmentation organizes customers into specific groups based on shared characteristics or similar behavior that matter for your use cases. These groups represent different target audiences for your business, making it easier to deliver more relevant content and experiences to your web app visitors.

The Segment object

{
    "id": "df7c1544-bad0-4c9d-928f-0c9f684c9ceb",
    "created_on": "2023-01-23T14:34:59+00:00",
    "changed_on": "2023-01-23T14:34:59+00:00",
    "synced_on": "2023-06-13T00:49:05+00:00",
    "label": "Segment",
    "body": "Marketing campaign YYY",
    "reference_id": "utm-source-google-ads",
    "query": "{\"viewed\":[{\"param\":\"Body\",\"publication_tags_in\":[\"google-ads\"]}]}",
    "count": 54609
}
FIELDDESCRIPTION
idUnique identifier for each item.
created_onUTC time at which the segment was created.
changed_onUTC time at which the segment was last updated.
synced_onUTC time at which the segment was last fully sycned.
labelIdentifier for the object.
bodyName of the segment.
reference_idCustom segment API ID.
queryJSON of the segment conditions.
countTotal number of customers in this segment on the last sync.

Fetching all segments

GET: /segments

The pagination of the segments endpoint is identical to the content items endpoints.

Query by ID

Since IDs are unique in Prepr, you can find the segment you want using the id argument. Here is an example that demonstrates how to query a segment with the ID "535c1e-...":

GET: /segments/535c1e-4d52-4794-9136-71e28f2ce4c1