Segments
PUT (update) a Segment
Use this method to update an existing segment's name (name) and/or contact selection criteria (segment_criteria). You must specify both the name and the segment_criteria in the request body, even if you don't plan to update both. The segment's name must be unique and the JSON must be valid (requires single-string escaped JSON). To avoid returning a 400 error response, when specifying the segment_criteria do not request more than 500 email campaigns or a date range greater than 1825 days (5 years) be evaluated. For more use case information, see Update Segment Details in the API guide.
put/segments/{segment_id}
Path parameters
segment_idinteger required
The system generated ID that uniquely identifies the segment that you want to modify.
Request body
Example request
{
"name": "Re-engage contacts who did not open the last 5 email campaign activities.",
"segment_criteria": "{\"version\":\"1.0.0\",\"criteria\":{\"type\":\"and\",\"group\":[{\"source\":\"tracking\",\"field\":\"not_opened\",\"op\":\"contains-any\",\"const_value\":\"last-n-campaigns\",\"param\":\"5\"}]}}"
}Response
The segment was successfully updated.
Example response
{
"name": "Re-engage contacts who did not open the last 5 email campaign activities.",
"segment_criteria": "{\"version\":\"1.0.0\",\"criteria\":{\"type\":\"and\",\"group\":[{\"source\":\"tracking\",\"field\":\"not_opened\",\"op\":\"contains-any\",\"const_value\":\"last-n-campaigns\",\"param\":\"5\"}]}}",
"segment_id": 14,
"created_at": "2019-04-25T11:08:00.000Z",
"edited_at": "2019-04-25T11:08:00.000Z"
}