List segments

Segments from Contacts, then Segmentation, with their filters.

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

read

Returns the segments on the My Segments page with their segment_id, name and a plain-language summary of the filters. Use the name as the segment parameter of list_contacts, set_campaign_recipients and unsubscribe_contacts.

Parameters

No parameters.

Request

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

Example response

JSON

{
  "segments": [
    {
      "segment_id": 2938471,
      "name": "Did not open: Autumn offer",
      "filters": "Not opened the campaign \"Autumn offer\" AND is subscribed to list \"Newsletter\""
    },
    {
      "segment_id": 2951108,
      "name": "Subscribers in Germany",
      "filters": "Property country is \"DE\""
    }
  ]
}

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.