Get a list of all segments in the given project.
Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.
The filter
parameter supports the following operators: equals
, anyOf
, and exists
.
You can also combine filters in the following ways:
,
) as an AND operator|
) as an OR operator()
) to group filtersYou can only filter certain fields in segments when using the filter
parameter. Additionally, you can only filter some fields with certain operators.
When you search for segments, the filter
parameter supports the following fields and operators:
Here are a few examples:
?filter=tags anyOf ["enterprise", "beta"],query equals "toggle"
matches segments with “toggle” in their key, name, or description that also have “enterprise” or “beta” as a tag.?filter=excludedKeys anyOf ["segmentKey1", "segmentKey2"]
excludes the segments with those keys from the results.?filter=unbounded equals true
matches larger list-based segments and synced segments.The documented values for filter
query parameters are prior to URL encoding. For example, the [
in ?filter=tags anyOf ["enterprise", "beta"]
must be encoded to %5B
.
The project key
The environment key
The number of segments to return. Defaults to 20.
Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit
.
Accepts sorting order and fields. Fields can be comma separated. Possible fields are ‘creationDate’, ‘name’, ‘lastModified’. Example: sort=name
sort by names ascending or sort=-name,creationDate
sort by names descending and creationDate ascending.
Accepts filter by excludedKeys
, external
, includedKeys
, query
, tags
, unbounded
. To learn more about the filter syntax, read the ‘Filtering segments’ section above.
Segment collection response
An array of segments
The location and content type of related resources
The total number of segments