> ## 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.

# Get Custom Data Facets

> Get facet values for an indexed custom data table

Facets are available for indexed tables and include distinct values for facetable columns.


## OpenAPI

````yaml GET /data/facets/{table_name}
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/facets/{table_name}:
    get:
      tags:
        - Custom Data
      summary: Get Custom Data Facets
      description: >-
        Return distinct values and counts for facetable columns in an indexed
        custom data table.
      operationId: get_custom_data_facets_data_facets__table_name__get
      parameters:
        - name: table_name
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z0-9_]+$
            title: Table Name
          description: Custom data table name.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDataFacetsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Custom Data Table Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CustomDataFacetsResponse:
      type: object
      required:
        - tableName
        - tableLabel
        - totalRecords
        - facets
      properties:
        tableName:
          type: string
          title: Table Name
        tableLabel:
          type: string
          title: Table Label
        totalRecords:
          type: integer
          title: Total Records
        facets:
          type: array
          items:
            $ref: '#/components/schemas/CustomDataColumnFacet'
          title: Facets
      title: Custom Data Facets 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
    CustomDataColumnFacet:
      type: object
      required:
        - columnName
        - columnDisplayName
        - columnType
        - values
      properties:
        columnName:
          type: string
          title: Column Name
        columnDisplayName:
          type: string
          title: Column Display Name
        columnType:
          $ref: '#/components/schemas/CustomDataColumnType'
        values:
          type: array
          items:
            $ref: '#/components/schemas/CustomDataFacetValue'
          title: Values
      title: Custom Data Column Facet
    CustomDataColumnType:
      type: string
      enum:
        - STRING
        - NUMERIC
        - BOOLEAN
        - JSONB
        - TIMESTAMP
        - REFERENCE
        - STRING_ARRAY
        - NUMERIC_ARRAY
        - BOOLEAN_ARRAY
        - TIMESTAMP_ARRAY
        - OBJECT
      title: Custom Data Column Type
    CustomDataFacetValue:
      type: object
      required:
        - value
        - count
      properties:
        value:
          anyOf:
            - type: string
            - type: number
            - type: boolean
          title: Value
        count:
          type: integer
          title: Count
      title: Custom Data Facet Value
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization

````