List segments
Saved segments of a list with the conditions each one is built from.
GET https://cotlet.dev/api/v1/emailoctopus/lists/{list_id}/segments
read
Returns the reusable segments shown on the Segments tab of the Contacts page: name, match type (all, any or none) and the conditions in the words of the segment editor. Use a segment name as the segment parameter of list_contacts, set_campaign_recipients and unsubscribe_contacts. One-off segments built inside a campaign are not saved, so they do not appear.
Parameters
| Name | Type | Description |
|---|---|---|
| list_id string required | string | List ID from list_lists. |
Request
curl https://cotlet.dev/api/v1/emailoctopus/lists/list_8c41d2/segments \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("emailoctopus", "list_segments", {"list_id":"list_8c41d2"}) const result = await cotlet.call('emailoctopus', 'list_segments', {"list_id":"list_8c41d2"}); cotlet call emailoctopus list_segments --data '{"list_id":"list_8c41d2"}' Example response
{
"segments": [
{
"name": "Clicked in last 90 days",
"match": "all",
"conditions": [
"Campaign activity: clicked, any campaign within the last 90 days"
]
},
{
"name": "Did not open: Autumn offer",
"match": "all",
"conditions": [
"Campaign activity: did not open, Autumn offer",
"Campaign activity: was sent, Autumn offer"
]
}
]
}