# List contacts

> 🔐 **Required role:** `API_ADMIN`
📖 **Data dictionary:** [Contact](/reference/data-dictionary/contact)

**Retrieve all contacts with basic pagination support**
Uses standard limit/offset pagination via `pageSize` and `page` — see [Pagination](/reference/pagination). Use `total.aggregate.count` to detect the end.
Returns a paginated list of contacts. Default sort prioritizes last/first name.

Endpoint: POST /gql/v1/contacts
Version: 1.0.0
Security: BearerAuth, CfAccessClientId, CfAccessClientSecret

## Security:

  - `BearerAuth` (unknown)
    http bearer JWT

  - `CfAccessClientId` (unknown)
    apiKey in header CF-Access-Client-Id

  - `CfAccessClientSecret` (unknown)
    apiKey in header CF-Access-Client-Secret

## Request fields (application/json):

  - `pageSize` (integer)
    Limit — number of records to return (not a page count).

  - `page` (integer)
    Offset — number of records to skip. This is not a page index.
To fetch the next N rows after the first N, send `pageSize: N`
and `page: N`. An offset at or beyond `total.aggregate.count`
returns an empty result array.

## Request examples:

  - `Default pagination` (unknown)

## Response 200:

  - `200` (unknown)
    Successfully retrieved contacts

## Response 200 fields (application/json):

  - `contacts` (array, required)

  - `contacts.id` (integer, required)
    Example: 1001

  - `contacts.pms_ref` (string, required)
    Example: C-4451

  - `contacts.active` (boolean, required)
    Example: true

  - `contacts.contact_info_id` (integer, required)
    Example: 7001

  - `contacts.office_id` (integer | null, required)
    Example: 3

  - `contacts.staff_id` (integer | null, required)
    Example: null

  - `contacts.type` (string | null, required)
    Example: Billing

  - `contacts.fwd_email_confirmation` (boolean, required)
    Example: false

  - `contacts.inactivated_at` (string | null, required)
    When the contact was inactivated (no time zone offset); null while active
    Example: null

  - `contacts.created_at` (string, required)
    When the record was created
    Example: 2024-03-01T15:20:11.104223+00:00

  - `contacts.updated_at` (string, required)
    When the record was last updated
    Example: 2024-09-14T08:02:47.551092+00:00

  - `contacts.is_managed_by_aiwyn` (boolean, required)
    Whether Aiwyn manages the record's lifecycle
    Example: false

  - `contacts.is_created_by_aiwyn` (boolean, required)
    Whether the record was created in Aiwyn
    Example: false

  - `contacts.username` (string | null, required)
    Client portal username of the contact; null when the contact has no portal account
    Example: jane.smith@acme.com

  - `contacts.custom_field_values` (object | null, required)
    Firm-defined custom fields for the contact, keyed by custom field code
    Example: null

  - `contacts.contact_info` (object, required)
    Name, email, phone and address of a contact

  - `contacts.contact_info.id` (integer, required)
    Example: 7001

  - `contacts.contact_info.pms_ref` (string, required)
    Example: C-4451

  - `contacts.contact_info.salutation` (string | null, required)
    Example: Ms.

  - `contacts.contact_info.firstName` (string | null, required)
    Example: Jane

  - `contacts.contact_info.lastName` (string | null, required)
    Example: Smith

  - `contacts.contact_info.email` (string | null, required)
    Example: jane.smith@acme.com

  - `contacts.contact_info.phone` (string | null, required)
    Example: 555-0123

  - `contacts.contact_info.address` (string | null, required)
    Example: 123 Main St

  - `contacts.contact_info.address2` (string | null, required)
    Example: Suite 400

  - `contacts.contact_info.city` (string | null, required)
    Example: Charlotte

  - `contacts.contact_info.state` (string | null, required)
    Example: NC

  - `contacts.contact_info.country` (string | null, required)
    Example: US

  - `contacts.contact_info.zip_code` (string | null, required)
    Example: 28202

  - `contacts.contact_info.active` (boolean, required)
    Example: true

  - `contacts.contact_clients` (array, required)
    Links between this contact and clients (active and inactive)

  - `contacts.contact_clients.client_id` (integer, required)
    Example: 2180

  - `contacts.contact_clients.contact_id` (integer, required)
    Example: 1001

  - `contacts.contact_clients.pms_ref` (string, required)
    Example: LL-9981

  - `contacts.contact_clients.active` (boolean, required)
    Example: true

  - `total` (object, required)

  - `total.aggregate` (object, required)

  - `total.aggregate.count` (integer, required)
    Number of contacts matching the request (the filtered count for search)
    Example: 959

## Response 400:

  - `400` (unknown)
    Bad request - invalid pagination parameters

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 200 examples:

  - `One page of contacts` (unknown)

  - `No contacts (or offset at/beyond the total)` (unknown)

