segments
Update Segment
Update the name, the definition, or both of an advanced segment. You cannot update a read-only segment. The account's plan must include advanced segmentation. If it does not, the API returns a 403 error. You cannot change list_id or read_only. If a request includes one of them, the API returns a 400 error.
patch/3.0/segments/{segment_id}
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.
Path parameters
segment_idstring required
The unique id for the segment.
Request body
Example request
{
"definition": {
"schema_version": 2,
"contacts": {
"email": {
"marketing": [
{
"sendable": true
}
]
}
},
"match": "all",
"conditions": [
{
"field": "merge0",
"op": "contains",
"value": [
"yahoo.com"
]
}
]
},
"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.