List segments
Saved segments under Contacts, within one list or across all contacts.
GET https://cotlet.dev/api/v1/simpletexting/segments
read
Reads the segments saved under Contacts > Segments: name, the list it belongs to (or all contacts) and how many contacts match now. Segments can be used in campaigns and autoresponders, so a segment name from here works as the segment of schedule_campaign.
Parameters
| Name | Type | Description |
|---|---|---|
| list string | string | Only segments created within this list. Leave out for all. |
Request
curl https://cotlet.dev/api/v1/simpletexting/segments \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("simpletexting", "list_segments") const result = await cotlet.call('simpletexting', 'list_segments'); cotlet call simpletexting list_segments Example response
{
"segments": [
{
"name": "Overdue for a cleaning",
"list": "Patients",
"contacts": 120
},
{
"name": "New this month",
"list": null,
"contacts": 34
}
]
}