> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stax.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Query people rows

> People table rows. Default columns: name, company, first email, first phone number with type and extension, and tags. Opt-in via `columns`: notes, n_plans, n_employers, n_companies, n_deals, created_at. Contacts carry no created timestamp of their own, so created_at is read from the id, which encodes the time the record was made. Sorting is limited to name and company — email and phone are arrays, so ordering by them would not match the value the row shows.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /contacts/_query
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /contacts/_query:
    post:
      tags:
        - contacts
      summary: Query people rows
      description: >-
        People table rows. Default columns: name, company, first email, first
        phone number with type and extension, and tags. Opt-in via `columns`:
        notes, n_plans, n_employers, n_companies, n_deals, created_at. Contacts
        carry no created timestamp of their own, so created_at is read from the
        id, which encodes the time the record was made. Sorting is limited to
        name and company — email and phone are arrays, so ordering by them would
        not match the value the row shows.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pkg_routes_contacts.QueryPeopleRequest'
        description: Query people request
        required: true
      responses:
        '200':
          description: People rows
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_contacts.QueryPeopleResponse'
        '400':
          description: Bad request - invalid request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_contacts.QueryPeopleRequest:
      type: object
      properties:
        columns:
          description: Columns names the optional cells to add to the default response.
          type: array
          items:
            type: string
        filters:
          $ref: '#/components/schemas/pkg_routes_contacts.QueryPeopleFilters'
        page:
          $ref: '#/components/schemas/types.ListPagination'
        sort:
          $ref: '#/components/schemas/types.ListSort'
    pkg_routes_contacts.QueryPeopleResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_contacts.PersonRow'
        total:
          type: integer
    pkg_routes_contacts.QueryPeopleFilters:
      type: object
      properties:
        client:
          description: >-
            Client narrows to the people who are a contact on one of these
            companies,

            as either an internal contact or an external one.
          type: array
          items:
            type: string
        company:
          type: array
          items:
            type: string
        confirmed:
          description: >-
            Confirmed narrows to people whose details have been confirmed, or
            away

            from them. Omit for both.
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        ids:
          type: array
          items:
            type: string
        search:
          type: string
        state:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
    types.ListPagination:
      type: object
      properties:
        limit:
          type: integer
        skip:
          type: integer
    types.ListSort:
      type: object
      properties:
        field:
          type: string
        last: {}
        order:
          type: integer
    pkg_routes_contacts.PersonRow:
      type: object
      properties:
        _id:
          type: string
        company:
          description: >-
            Company is the free-text employer on the contact record. It is not
            the

            count of companies the person is a contact on — that is n_companies.
          type: string
        created_at:
          type: string
        email:
          description: >-
            Email and phone are the first of each on the record; a contact can
            carry

            several, and the table shows the one it would reach them on.
          type: string
        n_companies:
          type: integer
        n_deals:
          type: integer
        n_employers:
          type: integer
        n_plans:
          type: integer
        name:
          type: string
        notes:
          description: The opt-in cells, null unless their column was requested.
          type: string
        phone:
          type: string
        phone_extension:
          type: string
        phone_type:
          type: string
        tags:
          type: array
          items:
            type: string
    types.ListFilterData:
      type: object
      properties:
        key:
          type: string
        op:
          type: string
        value: {}
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.