List contacts
Search contacts, or list the members of a segment, with consent and tags.
GET https://cotlet.dev/api/v1/privy/contacts
read
Returns contacts with name, email, phone, email_consent, sms_consent and tags. Only a contact whose email_consent is subscribed can receive marketing email, and only sms_consent subscribed can receive marketing texts. Contact ids start with cus_ and go into tag_contacts.
Parameters
| Name | Type | Description |
|---|---|---|
| search string | string | Name, email address or phone number |
| tag string | string | Only contacts with this Privy tag |
| segment_id string | string | Only members of this segment (id from list_segments) |
| page integer | integer | Page number, starting at 1 |
| per_page integer | integer | Items per page |
Request
curl https://cotlet.dev/api/v1/privy/contacts \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("privy", "list_contacts") const result = await cotlet.call('privy', 'list_contacts'); cotlet call privy list_contacts Example response
{
"data": [
{
"id": "cus_91f2",
"first_name": "Dana",
"last_name": "Reed",
"email": "dana@example.com",
"email_consent": "subscribed",
"sms_consent": "never_subscribed",
"tags": [
"spring-promo"
]
},
{
"id": "cus_a4c7",
"first_name": "Leo",
"last_name": "Park",
"email": "leo@example.com",
"email_consent": "subscribed",
"sms_consent": "subscribed",
"tags": []
}
],
"pagination": {
"page": 1,
"per_page": 25,
"total_count": 2,
"total_pages": 1
}
}