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

# Query Rows

> Query contact rows



## OpenAPI

````yaml POST /lists/contact/rows/query
openapi: 3.0.1
info:
  title: OpenAPI Simpu API
  description: Simpu API Documentation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.simpu.co
security:
  - apiKeyAuth: []
paths:
  /lists/contact/rows/query:
    post:
      description: Query contact rows
      parameters:
        - name: limit
          in: query
          description: Number of rows to retrieve per page.
          required: false
          schema:
            type: integer
            default: 100
        - name: page
          in: query
          description: The page number for paginated results.
          required: false
          schema:
            type: integer
            default: 1
        - name: query_id
          in: query
          description: The scroll query ID for paginated results.
          required: false
          schema:
            type: integer
            default: 0
      requestBody:
        description: Query contact rows object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RowsQueryRequest'
        required: true
      responses:
        '200':
          description: Successful response containing table, row data, and metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      $ref: '#/components/schemas/Row'
                  table:
                    $ref: '#/components/schemas/Table'
                  smartlist:
                    $ref: '#/components/schemas/SmartList'
                  meta:
                    $ref: '#/components/schemas/MetaQueryRows'
        '404':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RowsQueryRequest:
      type: object
      properties:
        smartlist_id:
          description: ID of the SmartList to apply custom filters
          type: string
          example: '1234'
        filters:
          description: List of filter criteria to apply to the query
          type: array
          items:
            $ref: '#/components/schemas/RowsFilter'
    Row:
      required:
        - id
        - columns
      type: object
      properties:
        id:
          description: 'ID of the row '
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        columns:
          description: Data values for each column in the row
          type: object
          example:
            674535b2b39158b9aae90188fcec23ec: John Doe
            674535b2b39158b9aae90188fcec23ed: john@acme.org
            674535b2b39158b9aae90188fcec23ee: '9291234567'
        created_datetime:
          description: Date and time the Row was created
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
        updated_datetime:
          description: Date and time the Row was last updated, if any
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
    Table:
      required:
        - id
        - columns
      type: object
      properties:
        id:
          description: ID of the Table
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        columns:
          description: List of column names in the table
          type: array
          items:
            $ref: '#/components/schemas/TableColumn'
          example:
            - id: 674535b2b39158b9aae90188fcec23ec
              name: name
              type: TEXT
            - id: 674535b2b39158b9aae90188fcec23ed
              name: Email
              type: EMAIL
            - id: 674535b2b39158b9aae90188fcec23ee
              name: Mobile
              type: PHONE NUMBER
        created_datetime:
          description: Date and time the table was created
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
        updated_datetime:
          description: Date and time the table was last updated, if any
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
    SmartList:
      required:
        - id
      type: object
      properties:
        id:
          description: 'Smartlist ID '
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        created_datetime:
          description: Date and time the smartlist was created
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
        updated_datetime:
          description: Date and time the smartlist was last updated, if any
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
    MetaQueryRows:
      required:
        - method
        - resource
      type: object
      properties:
        method:
          description: The HTTP method used to make the request
          type: string
          example: POST
        resource:
          description: The resource requested
          type: string
          example: /lists/contact/rows/query
        pagination:
          $ref: '#/components/schemas/Pagination'
    Error:
      required:
        - status
        - message
      type: object
      properties:
        status:
          type: integer
          format: int32
          example: 200
        message:
          type: string
          example: Invalid request
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: 'Error in field: ''name'' Field required.'
              type:
                type: string
                example: missing
    RowsFilter:
      type: object
      properties:
        column_id:
          type: string
          example: fe9bafa8ae434a838a278aa7e710cded
        name:
          type: string
          example: full_name
        value:
          type: string
          example: John
        operator:
          type: string
          example: contain
          enum:
            - equal
            - not_equal
            - empty
            - not_empty
            - contain
            - not_contain
            - is_any
            - is_none_of
    TableColumn:
      required:
        - id
        - name
        - type
      type: object
      properties:
        id:
          description: ID of the column
          type: string
          example: 674535b2b39158b9aae90188fcec23ec
        name:
          description: Name of the column
          type: string
          example: name
        type:
          description: Type of the column
          type: string
          example: TEXT
          enum:
            - TEXT
            - NUMBER
            - DATE
            - PHONE NUMBER
            - EMAIL
            - URL
            - SELECT
            - MULTI SELECT
    Pagination:
      required:
        - next_page
        - per_page
        - count_total
        - page_total
        - page
        - prev_page
        - query_id
      type: object
      properties:
        next_page:
          description: Indicates if there is a subsequent page
          type: boolean
          example: 'True'
        per_page:
          description: ' Specifies the number of items displayed per page in the current query'
          type: number
          example: 7
        count_total:
          description: >-
            The total count of all items available across all pages for the
            current query
          type: number
          example: 50
        page_total:
          description: >-
            The total number of pages available based on the per_page setting
            and the total item count
          type: number
          example: 100
        page:
          description: The current page number for the query or response
          type: number
          example: 9
        prev_page:
          description: >-
            Indicates if there is a previous page available; true if a prior
            page exists
          type: boolean
          example: 'True'
        query_id:
          description: >-
            A unique identifier for the current query, which may correspond to
            the last row ID
          type: string
          example: '1234'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: An API key to authenticate requests

````