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

# Query Custom Data

> Query an indexed custom data table with facet filters and free text

This runs a deterministic query against a single table that has `searchIndexingEnabled` set to `true`.

Provide exact-match `filters` (each matches a column against one or more values) and/or a free-text
`text` query. Omit both to get the most recent records. Use
[`GET /data/facets/{table_name}`](/api-reference/custom-data/get-facets) to discover the available columns
and values to filter on.


## OpenAPI

````yaml POST /data/query
openapi: 3.1.0
info:
  title: Public API v1
  description: >-
    Public API v1 requiring API keys.


    **Timestamps:** All datetime fields in API responses are returned in UTC
    using ISO 8601 format (e.g., `2024-01-15T14:30:00Z`). When filtering by date
    parameters, provide timestamps in ISO 8601 format.
  version: 0.1.0
servers:
  - url: https://api.prod.usesimple.ai/api/v1
    description: Production API Server
security: []
paths:
  /data/query:
    post:
      tags:
        - Custom Data
      summary: Query Custom Data
      description: >-
        Deterministic facet-filtered query against a single custom data table
        that has search indexing enabled. Provide exact-match `filters` and/or a
        free-text `text`; omit both to get the most recent records.
      operationId: query_custom_data_data_query_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomDataQueryRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDataQueryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CustomDataQueryRequest:
      type: object
      required:
        - tableName
      properties:
        tableName:
          type: string
          pattern: ^[a-z0-9_]+$
          title: Table Name
          description: The indexed custom data table to query.
        filters:
          type: array
          title: Filters
          description: >-
            Exact-match filters. Each filter matches a column against one or
            more values (any-of). An empty filter is ignored.
          items:
            type: object
            required:
              - column
              - values
            properties:
              column:
                type: string
                pattern: ^[a-z0-9_]+$
                title: Column
              values:
                type: array
                title: Values
                items:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
        text:
          type: string
          maxLength: 5000
          title: Text
          description: Optional free-text search across all columns.
        size:
          type: integer
          minimum: 0
          maximum: 50
          title: Size
          description: Max records to return (default 25, max 50).
        from:
          type: integer
          minimum: 0
          title: From
          description: Offset for pagination.
      title: Custom Data Query Request
    CustomDataQueryResponse:
      type: object
      required:
        - records
        - total
      properties:
        records:
          type: array
          items:
            type: object
            additionalProperties: true
          title: Records
        total:
          type: integer
          title: Total
          description: >-
            Total number of records matching the query (may exceed the returned
            page).
      title: Custom Data Query Response
    ErrorResponse:
      type: object
      required:
        - status
        - success
        - error
        - errors
      properties:
        status:
          type: string
          default: error
        success:
          type: boolean
          default: false
        error:
          type: string
          title: Error
        errors:
          items:
            type: string
          type: array
          title: Errors
      title: Error Response
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization

````