List contacts
Contacts of one list with their properties, filtered by segment or email address.
GET https://cotlet.dev/api/v1/mailjet/lists/{list_id}/contacts
read
Lists the contacts of one contact list with their email address, subscription state and contact properties such as first name. segment narrows it to a segment from list_segments, and search matches a complete email address. Pass next_cursor back as cursor for the next page. The response also carries the total number of matching contacts.
Parameters
| Name | Type | Description |
|---|---|---|
| list_id integer required | integer | Contact list ID from list_contact_lists. |
| segment string | string | Name of a segment from list_segments. |
| search string | string | A complete email address to look for. |
| cursor string | string | next_cursor from the previous call. |
Request
curl https://cotlet.dev/api/v1/mailjet/lists/1/contacts \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("mailjet", "list_contacts", {"list_id":1}) const result = await cotlet.call('mailjet', 'list_contacts', {"list_id":1}); cotlet call mailjet list_contacts --data '{"list_id":1}' Example response
{
"total": 197,
"contacts": [
{
"email": "sam@example.com",
"subscribed": true,
"properties": {
"firstname": "Sam",
"country": "GB"
}
},
{
"email": "lena@example.org",
"subscribed": true,
"properties": {
"firstname": "Lena",
"country": "DE"
}
}
],
"next_cursor": "2"
}