segments

Add Segment

Create an advanced segment from a segment definition. The account's plan must include advanced segmentation. If it does not, the API returns a 403 error.

post/3.0/segments

Request

Request body

list_idstring required

The unique ID of the list that contains the segment.

namestring required

The name of the segment.

Example request

{
  "definition": {
    "schema_version": 2,
    "contacts": {
      "email": {
        "marketing": [
          {
            "sendable": true
          }
        ]
      }
    },
    "match": "all",
    "conditions": [
      {
        "field": "merge0",
        "op": "contains",
        "value": [
          "yahoo.com"
        ]
      }
    ]
  },
  "list_id": "a1b2c3d4e5",
  "name": "Example Segment"
}

Response

created_atstring date-time

The date and time when Mailchimp created the segment, in ISO 8601 format.

definitionobject

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.

idstring uuid

The unique ID of the segment. Do not parse or change this value. Use it exactly as you received it.

list_idstring

The unique ID of the list that contains the segment.

read_onlyboolean

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.

namestring

The name of the segment.

Example response

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

Changes

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