List segments
Segments of the shop from Messaging > Segments, with their Segment Size.
GET https://cotlet.dev/api/v1/postscript/segments
Returns the segments on the Segments page, including the default ones such as All Customers and Subscribers (INTL Included). size is the Segment Size Postscript shows; it refreshes daily for segments used in a campaign in the last 30 days and is otherwise as of the last manual refresh. Unsubscribed people are never counted. Use segment names as include_segments and exclude_segments of create_campaign.
Parameters
| Name | Type | Description |
|---|---|---|
| search string | string | Only segments whose name contains this text. |
Request
curl https://cotlet.dev/api/v1/postscript/segments \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("postscript", "list_segments") const result = await cotlet.call('postscript', 'list_segments'); cotlet call postscript list_segments Example response
{
"segments": [
{
"segment_id": "41872",
"name": "All Customers and Subscribers (INTL Included)",
"size": 18240
},
{
"segment_id": "52310",
"name": "Subscribers with No Orders",
"size": 5127
}
]
}