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

Parameters: list_contacts
NameTypeDescription
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
curl https://cotlet.dev/api/v1/privy/contacts \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("privy", "list_contacts")
Node.js
const result = await cotlet.call('privy', 'list_contacts');
CLI
cotlet call privy list_contacts

Example response

JSON

{
  "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
  }
}

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.