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
- Base URLhttps://api.mailchimp.com
- Auth
- HTTP bearer
- or OAuth 2Authorization codehttps://login.mailchimp.com/oauth2/authorizeToken URLhttps://login.mailchimp.com/oauth2/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
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
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.