Skip to navigation

List Segments

Get the segments of a list. The response contains only metadata. It includes advanced segments and read-only segments that other Mailchimp tools made, for example Google Analytics segments and segments from the AI segment builder. The read_only property of each segment shows if you can update it.

Authentication

AuthorizationBearer

Authorization using a Mailchimp API key (a.k.a. Bearer token)

OR
AuthorizationBearer
Authorization using OAuth

Query parameters

fieldslist of stringsOptional

A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

exclude_fieldslist of stringsOptional

A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

countintegerOptional1-1000Defaults to 10
The number of segments to return. The default is 10. Use a whole number from 1 to 1000. If you use a different value, the API returns a 400 error. The API does not change the value.
cursorstringOptional

To get the next page of segments, set cursor to the next_cursor value from the previous response. Do not make or change a cursor value. If you do, pagination can stop without notice. To get the first page, do not include cursor. If a response does not contain next_cursor, there are no more pages. If segments are created or deleted while you get the pages, the response can skip or repeat a segment.

list_idstringRequired
The unique ID of the list to get segments from.
sort_fieldenumOptional
The field to sort the segments by.
Allowed values:
sort_direnumOptionalDefaults to DESC

The sort direction. The default is DESC. Use ASC or DESC. The value is not case-sensitive. If you use a different value, the API returns a 400 error.

Allowed values:

Response

next_cursorstringOptionalRead-only

A cursor pointing to the last item on this page of the collection. Paginate through a collection of records by setting the cursor parameter on a subsequent request to this value.

segmentslist of objectsOptional

The segments of the list. The read_only property of each segment shows if you can update it.