Find contacts
GET/api/partner-gateway/contacts
Searches the contacts of your account, with filters, sorting and pagination.
- Which contacts are searched: all of them, unless you send one of
listIds,notListIdsorsortPriorityListId. At most one of the three can be used per call. - Filters add up:
search,gender,isValid,communicationSupported,isTest,phoneNumber,emailand the consent filters are combined with AND. - Consent filters:
emailStatus,emailTrackingStatus,smsStatus,waStatusandrcsStatustake comma-separated values amongOPTIN,OPTOUTandNONE(no consent recorded). A contact matches if its consent is any of them:emailStatus=OPTIN,NONEleaves out the email opt-outs. - Exact lookups:
phoneNumbermatches the contact'smobilePhoneNumberor any of itsphoneNumbers, in E.164 format with the+URL-encoded as%2B.emailmatchesmainEmailor any of theemailAddresses, ignoring case. - Pagination and sorting:
pageis 0-based,limitgoes from 1 to 1000 (default 10),sortBydefaults tofullNameandsortOrderisascordesc. - Not supported: filtering by
id,lastContactTypeorlastCampaignTypeis refused with400. To read one contact, useGET /contacts/{id}.
With
listIds, a contact that is in several of the lists is returned once for each of them and counted as many times intotalCount. De-duplicate the results byid, or query one list at a time.
How listIds, notListIds and sortPriorityListId choose the contacts
| Parameter | Contacts returned |
|---|---|
| None of them | All the contacts of your account. |
listIds | The contacts that belong to at least one of those lists. |
notListIds | The contacts that belong to none of those lists: useful to find the contacts not yet in a target list. |
sortPriorityListId | All your contacts, with the ones that belong to that list first. |
For the contacts of one list, GET /contacts/list/{listId}/contacts is simpler.
Request
Responses
- 200
- 400
- 401
- 500
One page of the contacts that match the filters.
A parameter is invalid: more than one of listIds, notListIds and sortPriorityListId, a list ID that is not a positive integer, a sortOrder other than asc or desc, a page below 0, a limit outside 1-1000, a consent filter value other than OPTIN, OPTOUT or NONE, or an unsupported filter. The response body names the parameter.
The API key is missing, invalid, or lacks the CONTACTS operation.
Unexpected server error.