Skip to navigation

Get Segment

Get the metadata of a segment. If the segment is not read-only, the response also contains its definition. Read-only segments do not have a definition.

Authentication

AuthorizationBearer

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

OR
AuthorizationBearer
Authorization using OAuth

Path parameters

segment_idstringRequired
The unique id for the segment.

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.

Response

created_atdatetimeOptionalRead-only
The date and time when Mailchimp created the segment, in ISO 8601 format.
definitionmap from strings to anyOptional

The segment definition. Read-only segments do not have a definition, so the response does not include this property for them. It contains the match and conditions that you sent, the current schema_version, and the contacts object. In the contacts object, each entry selects exactly one subscription status. The request body of Add Segment shows all properties of a definition.

idstringOptionalRead-onlyformat: "uuid"
The unique ID of the segment. Do not parse or change this value. Use it exactly as you received it.
list_idstringOptionalRead-only
The unique ID of the list that contains the segment.
read_onlybooleanOptionalRead-only

If true, you can read, count, and snapshot the segment, but you cannot update or delete it. Segments that other Mailchimp tools made, for example Google Analytics segments, are read-only. A read-only segment does not have a definition.

namestringOptional
The name of the segment.