Export segment list
/segments/list
Use this endpoint to export a list of segments, each of which includes its name, Segment API identifier, and whether it has analytics tracking enabled.
The segments are returned in groups of 100 sorted by time of creation (oldest to newest by default). Archived segments are not included.
When to use this endpoint
You send events and purchases to Braze with the /users/track endpoint. To view that data over time for a segment, the segment needs analytics tracking turned on. The analytics_tracking_enabled field in this endpoint’s response shows which segments have it on.
The Export segment details endpoint doesn’t return this setting, so this endpoint is how you check it through the API.
Use this endpoint to do the following:
- Confirm tracking is on before you send new data. Braze doesn’t backfill revenue and purchase data from before you turn on tracking. Check that
analytics_tracking_enabledistruefor the segments you plan to compare first. - Troubleshoot empty segment reports. If a segment’s sessions, custom events, or revenue reports are empty, check whether
analytics_tracking_enabledisfalsebefore you debug your integration. - Count your tracked segments. A workspace can have tracking turned on for up to 25 segments. Use the
pageparameter to retrieve every page, then count the segments whereanalytics_tracking_enabledistrueto see how many remain.
To check a few segments one time, select the Advanced Tracking Segments Only filter on the Segments page. Use this endpoint when you need the answer in a script or scheduled job.
This endpoint reads the tracking setting and doesn’t change it. To turn on tracking, go to a segment’s Segment Details section and turn on Analytics Tracking.
Combine this endpoint with other endpoints
These endpoints cover the rest of the user tracking workflow. For the segment endpoints, use an id from this endpoint’s response as the segment_id.
| Endpoint | How it supports your user tracking workflow |
|---|---|
/users/track endpoint |
Records the custom events, purchases, and attribute updates that your tracked segments report on. |
| Export segment details endpoint | Retrieves a segment’s filter description and tags for a given segment_id. |
| Export segment analytics endpoint | Retrieves the estimated size of a segment over time. |
/users/export/segment endpoint |
Exports the user profiles in a segment, so you can verify that the attributes, custom events, and purchases you sent landed on profiles. |
Endpoint reference
This reference is generated from the OpenAPI specification for this endpoint. To run the endpoint, copy the generated cURL example and send it from your terminal or Postman. You can also download the raw OpenAPI spec for this page at /docs/assets/api/openapi/export_segments_get_segment.yaml. Use this spec to validate that your requests include the correct parameters, fields, and structure before you send them. To learn how, see Use OpenAPI schemas for request validation.