---
docId: doc_b0a5e62112f346a2abc4b9af16578782
title: List contacts
description: Get the list of contacts of all your workspaces, with pagination and filtering options.
api:
  group: clientes
  auth: bearer
  operations:
    - operationId: listClients
      method: GET
      path: /v1/clients
      postmanName: List Clients
---

<script>
  import { Ways, Collapsible } from '$lib/components';
</script>

# List contacts

Lists contacts from your workspaces with filters and pagination.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/clients?status=active&limit=50" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
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`.

</Ways.Way>
</Ways>

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `limit` | number | Maximum number of contacts in the response. Maximum: `200`. Default: `50` | — |
| `pageToken` | string | The `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 | — |
| `offset` | number | Number of records to skip. Legacy alternative to `pageToken`; maximum `100000` | — |
| `sortBy` | enum | Field to sort by: `name` (default) or `creationDate` | — |
| `sortDirection` | enum | Sort direction: `asc` (default) or `desc` | — |
| `status` | enum | Filter by status: `active` or `blocked`. `active` includes contacts that never had an explicit status | — |
| `email` | string | Only the contact with that exact email. Case-insensitive | — |
| `searchTerm` | string | Reserved. It is accepted but does not filter results yet | — |
| `tags` | array | List of tags to filter by | — |
| `dateFilter` | object | Filter by date or period | — |
| `workspace` | string | Read only that workspace. Without it, every workspace of the credential is read. A workspace the credential does not cover answers `400` | — |

<Collapsible summary="dateFilter examples">

**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"}
```

</Collapsible>

The list returns `status` but not the complete `moderation` object: for that use [Get a contact](/api-reference/contacts/get).

## Response

```json
{
  "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..."
}
```

| Field | Description |
|-------|-------------|
| `id` | Internal ID of the contact |
| `phoneNumber` | Contact's phone number without the `+` prefix |
| `name` | Full name of the contact |
| `firstname` | Contact's first name |
| `lastname` | Contact's last name |
| `email` | Email address |
| `birthdate` | Date of birth |
| `gender` | Gender |
| `company` | Company name |
| `country` | Country of residence |
| `state` | State of residence |
| `city` | City of residence |
| `address` | Full address |
| `postalCode` | Postal code |
| `status` | Contact status: `active` or `blocked` |
| `tags` | Tags on the contact |
| `owners` | List of the responsible users' emails |
| `customFields` | The contact's custom fields |
| `creationDate` | Creation date in ISO 8601 format |
| `lastUpdate` | Last update date in ISO 8601 format |

### Pagination fields

| Field | Description |
|-------|-------------|
| `clientsCount` | Total contacts returned in that workspace |
| `pagination.limit` | Maximum number of results requested |
| `pagination.offset` | Number of results skipped |
| `pagination.hasMore` | Whether more results exist in that workspace |
| `nextPageToken` | Token for the next page; `null` when finished. Returned at the root and covers every workspace of the key |

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | A filter or `pageToken` is invalid, or `dateFilter` has an invalid date. `details.issues` says which field |
| `400` | `INVALID_REQUEST` | The supplied `?workspace=` is not authorized. `details.available` lists the available workspaces and `details.requested` shows the one you sent |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential does not have the Contacts module (`Missing contacts permission`) |
| `404` | `WORKSPACE_NOT_FOUND` | The credential does not carry any workspace |

The general error format is in [Errors](/api-reference/errors).
