v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Segments

List segments

Retrieves a list of segments.

The list doesn't include the customers that belong to respective segments. To return a list of customers who belong to a segment, use GET List customers endpoint with the segment_id query parameter.

To return a list of different results, use the filters[created_at][conditions][$before] and filters[created_at][conditions][$after] query parameters as pagination.

get/v1/segments

Query parameters

limitinteger

Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

order'created_at' | '-created_at'

Apply this filter to order the segments according the date and time when they were created. By default, lists the segments from the newest to the oldest. Use created_at to list from the oldest to the newest.

junction'and' | 'or'

Logical Operator Between Filters. Filter by conditions set on the junction parameter indicating how the conditions should be accounted for in the query. An AND is an all-inclusive logical operator, meaning the AND operator displays a record if ALL the conditions separated by AND are TRUE, while an OR operator displays a record if ANY of the conditions separated by OR is TRUE.

Filters for listing templates.

{
  "created_at": {
    "conditions": {
      "$after": "2024-01-01T00:00:00.000Z",
      "$before": "2024-01-01T00:00:00.000Z"
    }
  }
}
idsstring[]

Contains the list of segments in the sequence defined by the order parameter.

Response

Returns a data array with segment objects.

object'list' required

The type of the object represented by JSON. This object stores information about segments.

data_ref'data' required

Identifies the name of the attribute that contains the array of segments.

totalinteger required

Total number of segments returned for given filters and query parameters with the exception of limit.

Example response

{
  "segments": [
    {
      "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2",
      "created_at": "2022-05-12T13:01:56.896Z",
      "updated_at": "2022-10-03T12:24:58.008Z"
    }
  ]
}