# List contacts (/api-reference/contacts/listContacts)

`GET /contacts`

Base URL: `https://next-api.useplunk.com`

Get a paginated list of contacts with cursor-based pagination.

## Query parameters

- `limit`: integer — Maximum items per page. Values above 100 are clamped to 100.
- `cursor`: string — Pagination cursor. Pass the `cursor` returned by the previous page.
- `search`: string — Case-insensitive substring match on email.
- `subscribed`: boolean — Filter by subscription state. Omit to return both subscribed and unsubscribed contacts.
- `sort`: enum ("email" | "createdAt") — Column to sort by. Unrecognised values fall back to `createdAt`.
- `dir`: enum ("asc" | "desc") — Sort direction. Unrecognised values fall back to the default.

## Responses

### `200` — List of contacts

- `data`: array<object>
  items:
    - `id`: string — Unique contact identifier
    - `email`: string (email) — Contact email address
    - `subscribed`: boolean — Subscription status
    - `data`: object — Custom contact data fields
    - `createdAt`: string (date-time)
    - `updatedAt`: string (date-time)
- `cursor`: string — Cursor for the next page. Pass this back as the `cursor` query parameter to fetch the next page.
- `hasMore`: boolean
- `total`: integer — Total count. Only populated on the first page (when no `cursor` is supplied); subsequent pages return `0` to avoid the recount cost.

```json
{
  "data": [
    {
      "id": "string",
      "email": "user@example.com",
      "subscribed": false,
      "data": null,
      "createdAt": "2026-08-09T17:56:20.150Z",
      "updatedAt": "2026-08-09T17:56:20.150Z"
    }
  ],
  "cursor": "string",
  "hasMore": false,
  "total": 0
}
```

### `401` — Missing or invalid API key.

- `success`: enum (false)
- `error`: object
  - `code`: string — Machine-readable error code, e.g. `VALIDATION_ERROR`, `INVALID_API_KEY`, `IDEMPOTENCY_KEY_REUSED`.
  - `message`: string
  - `statusCode`: integer
  - `requestId`: string — Correlation ID for this request. Include it when contacting support.
  - `errors`: array<object> — Field-level detail, present on validation failures.
    items:
      - `field`: string — Dot-path of the offending field, e.g. `attachments.0.filename`.
      - `message`: string
      - `code`: string — Validation issue code, e.g. `invalid_type`, `too_big`, `reserved_event`.
      - `received`: object — The value that was received, when available.
  - `details`: object — Additional error context.
  - `suggestion`: string — Hint for fixing the request.
- `timestamp`: string (date-time)

```json
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "statusCode": 0,
    "requestId": "string",
    "errors": [
      {
        "field": "string",
        "message": "string",
        "code": "string",
        "received": null
      }
    ],
    "details": null,
    "suggestion": "string"
  },
  "timestamp": "2026-08-09T17:56:20.150Z"
}
```

## Example request

```bash
curl -X GET 'https://next-api.useplunk.com/contacts' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```
