List contacts

SDK platic.clients.list()

Lists contacts from your workspaces with filters and pagination.

Example

const page = await platic.clients.list({ status: "active" });

Read contacts in page.data. For the next page, send page.nextPageToken as pageToken. Each contact includes its workspaceId.

Query parameters

ParameterTypeDescriptionRequired
limitnumberMaximum number of contacts in the response. Maximum: 200. Default: 50—
pageTokenstringThe nextPageToken cursor from the previous response. Preferred over offset. It cannot be combined with offset and is invalidated if you change the filters or the sort order—
offsetnumberNumber of records to skip. Legacy alternative to pageToken; maximum 100000—
sortByenumField to sort by: name (default) or creationDate—
sortDirectionenumSort direction: asc (default) or desc—
statusenumFilter by status: active or blocked. active includes contacts that never had an explicit status—
emailstringOnly the contact with that exact email. Case-insensitive—
searchTermstringReserved. It is accepted but does not filter results yet—
tagsarrayList of tags to filter by—
dateFilterobjectFilter by date or period—
workspacestringRead only that workspace. Without it, every workspace of the credential is read. A workspace the credential does not cover answers 400—

Specific date:

GET /v1/clients?dateFilter={"type":"specific","date":"2024-01-15"}

Date range:

GET /v1/clients?dateFilter={"type":"range","startDate":"2024-01-01","endDate":"2024-01-31"}

The list returns status but not the complete moderation object: for that use Get a contact.

Response

{
  "workspaces": [
    {
      "id": "g6yCA16pkWl5eXo7KszB",
      "name": "ws_1",
      "clients": [
        {
          "id": "167b545fcde641dcb319eca0cc4d7b0f",
          "phoneNumber": "12345678910",
          "name": "Ana",
          "firstname": "Ana",
          "lastname": "Garcia",
          "email": "ana@acme.com",
          "birthdate": null,
          "gender": "female",
          "company": null,
          "country": "MX",
          "state": "Michoacán",
          "city": "Morelia",
          "address": null,
          "postalCode": null,
          "status": "active",
          "tags": [],
          "owners": ["user1@acme.com", "user2@acme.com"],
          "customFields": {
            "plate": "",
            "reception_id": "",
            "claim_date": ""
          },
          "creationDate": "2025-02-06T16:45:50.146Z",
          "lastUpdate": "2025-02-06T16:45:50.146Z"
        }
      ],
      "clientsCount": 1,
      "pagination": {
        "limit": 50,
        "offset": 0,
        "hasMore": true
      }
    }
  ],
  "nextPageToken": "eyJ2IjoxLCJxIjoiYTFi..."
}
FieldDescription
idInternal ID of the contact
phoneNumberContact's phone number without the + prefix
nameFull name of the contact
firstnameContact's first name
lastnameContact's last name
emailEmail address
birthdateDate of birth
genderGender
companyCompany name
countryCountry of residence
stateState of residence
cityCity of residence
addressFull address
postalCodePostal code
statusContact status: active or blocked
tagsTags on the contact
ownersList of the responsible users' emails
customFieldsThe contact's custom fields
creationDateCreation date in ISO 8601 format
lastUpdateLast update date in ISO 8601 format

Pagination fields

FieldDescription
clientsCountTotal contacts returned in that workspace
pagination.limitMaximum number of results requested
pagination.offsetNumber of results skipped
pagination.hasMoreWhether more results exist in that workspace
nextPageTokenToken for the next page; null when finished. Returned at the root and covers every workspace of the key

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTA filter or pageToken is invalid, or dateFilter has an invalid date. details.issues says which field
400INVALID_REQUESTThe supplied ?workspace= is not authorized. details.available lists the available workspaces and details.requested shows the one you sent
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe credential does not have the Contacts module (Missing contacts permission)
404WORKSPACE_NOT_FOUNDThe credential does not carry any workspace

The general error format is in Errors.