List segments

List custom and smart segments with the number of mailable and textable contacts.

GET https://cotlet.dev/api/v1/privy/segments

read

Returns the four Smart Segments (Engaged Contacts, Unengaged Contacts, Potential Customers, Current Customers) and your custom segments, each with prebuilt, mailable_count and textable_count. Segments are dynamic, so the counts are the current ones, and the segment ids go into create_email_campaign and duplicate_campaign.

Parameters

Parameters: list_segments
NameTypeDescription
page integer integer Page number, starting at 1
per_page integer integer Items per page

Request

cURL
curl https://cotlet.dev/api/v1/privy/segments \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("privy", "list_segments")
Node.js
const result = await cotlet.call('privy', 'list_segments');
CLI
cotlet call privy list_segments

Example response

JSON

{
  "data": [
    {
      "id": "seg_2b11",
      "name": "Engaged Contacts",
      "prebuilt": true,
      "mailable_count": 6310,
      "textable_count": 1240
    },
    {
      "id": "seg_c9e4",
      "name": "Unengaged Contacts",
      "prebuilt": true,
      "mailable_count": 2150,
      "textable_count": 380
    },
    {
      "id": "seg_7d20",
      "name": "Did not open October sale",
      "prebuilt": false,
      "mailable_count": 2890,
      "textable_count": 0
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total_count": 3,
    "total_pages": 1
  }
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.