segments

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.

get/3.0/segments

Request

Query parameters

fieldsstring[]

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

exclude_fieldsstring[]

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

countinteger

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.

cursorstring

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_idstring required

The unique ID of the list to get segments from.

sort_field'created_at' | 'name'

The field to sort the segments by.

sort_dir'ASC' | '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.

Response

next_cursorstring

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.

total_itemsinteger

The total number of segments that match the request. It does not change with count or cursor.

Example response

{
  "segments": [
    {
      "created_at": "2025-01-15T10:30:00+00:00",
      "id": "0dbaba26-0003-8000-8000-000000000919",
      "list_id": "a1b2c3d4e5",
      "name": "Example Segment"
    }
  ],
  "total_items": 12
}

Changes

No recorded changes to this operation across all 1 revision of this API.