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

# Update Custom Data Table

> Update a custom data table schema

Send the complete column list you want the table to have after the update. Changing a table schema validates existing records before applying the change.


## OpenAPI

````yaml PATCH /data/tables/{id}
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/tables/{id}:
    patch:
      tags:
        - Custom Data
      summary: Update Custom Data Table
      description: >-
        Update a custom data table's label, search indexing setting, and column
        schema.
      operationId: update_custom_data_table_data_tables__id__patch
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            title: ID
          description: Custom data table ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomDataTableUpdate'
      responses:
        '200':
          description: Custom Data Table Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDataTable'
        '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:
    CustomDataTableUpdate:
      type: object
      required:
        - label
        - columns
      properties:
        label:
          type: string
          title: Label
          description: Human-readable table name shown in Simple AI.
        searchIndexingEnabled:
          type: boolean
          title: Search Indexing Enabled
          description: >-
            Whether this table can be searched with the custom data search and
            facets endpoints.
        columns:
          type: array
          items:
            $ref: '#/components/schemas/CustomDataColumnInput'
          minItems: 1
          title: Columns
      title: Custom Data Table Update
    CustomDataTable:
      type: object
      required:
        - id
        - name
        - label
        - searchIndexingEnabled
        - columns
        - recordCount
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
          title: ID
        name:
          type: string
          title: Name
        label:
          type: string
          title: Label
        searchIndexingEnabled:
          type: boolean
          title: Search Indexing Enabled
        columns:
          type: array
          items:
            $ref: '#/components/schemas/CustomDataColumn'
          title: Columns
        recordCount:
          type: integer
          title: Record Count
        createdAt:
          type: string
          format: date-time
          title: Created At
        updatedAt:
          type: string
          format: date-time
          title: Updated At
      title: Custom Data Table
    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
    CustomDataColumnInput:
      type: object
      required:
        - name
        - type
        - displayName
      properties:
        name:
          type: string
          maxLength: 63
          pattern: ^[a-z]([a-z0-9]+(_[a-z0-9]+)*)?$
          title: Name
          description: Column identifier. Use lowercase letters, numbers, and underscores.
        type:
          $ref: '#/components/schemas/CustomDataColumnType'
        displayName:
          type: string
          title: Display Name
          description: Human-readable column name shown in Simple AI.
        referenceTable:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Table
          description: >-
            Required for REFERENCE columns. Use a custom table name or a
            supported system reference table such as calls.
        jsonSchema:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: JSON Schema
          description: >-
            Required for OBJECT columns. Provide an OpenAPI/JSON Schema object
            that describes the structured value.
      title: Custom Data Column Input
    CustomDataColumn:
      type: object
      required:
        - id
        - name
        - type
        - displayName
        - referenceTable
        - jsonSchema
        - position
      properties:
        id:
          type: integer
          title: ID
        name:
          type: string
          title: Name
        type:
          $ref: '#/components/schemas/CustomDataColumnType'
        displayName:
          type: string
          title: Display Name
        referenceTable:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Table
        jsonSchema:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: JSON Schema
        position:
          type: integer
          title: Position
      title: Custom Data Column
    CustomDataColumnType:
      type: string
      enum:
        - STRING
        - NUMERIC
        - BOOLEAN
        - JSONB
        - TIMESTAMP
        - REFERENCE
        - STRING_ARRAY
        - NUMERIC_ARRAY
        - BOOLEAN_ARRAY
        - TIMESTAMP_ARRAY
        - OBJECT
      title: Custom Data Column Type
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization

````