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

# Update an AI Table column

> Update the name or query associated with a column. Does not automatically update the cells if a new query is provided



## OpenAPI

````yaml POST /api/ai/table/{ai_table_id}/column/{ai_column_id}/update
openapi: 3.0.3
info:
  title: Petal API Document
  description: Reference document for Petal app
  license:
    name: MIT
  version: 1.2.5
servers:
  - url: https://cite.petal.org
security:
  - bearerAuth: []
tags:
  - name: signup
  - name: extraction
  - name: referral
  - name: site
  - name: citegen
  - name: invite
  - name: user
  - name: tag
  - name: ai
  - name: notification
  - name: organization
  - name: annotation
  - name: search
  - name: attachment
  - name: collection
  - name: discourse
  - name: main
  - name: ai-create
  - name: document
  - name: payment
  - name: comment
  - name: lambda
  - name: sauce
  - name: admin
  - name: error
  - name: opengraph
  - name: default
  - name: media
  - name: file
  - name: oauth
paths:
  /api/ai/table/{ai_table_id}/column/{ai_column_id}/update:
    post:
      tags:
        - ai
      summary: Update a column in the AI table
      description: >-
        Update the name or query associated with a column. Does not
        automatically update the cells if a new query is provided
      operationId: post_/api/ai/table/{ai_table_id}/column/{ai_column_id}/update
      parameters:
        - description: The unique ID of the AI Table
          in: path
          name: ai_table_id
          required: true
          schema:
            format: int32
            type: integer
        - description: The unique ID of the column
          in: path
          name: ai_column_id
          required: true
          schema:
            format: int32
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AIColumnBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIColumn'
          description: OK
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Unprocessable Entity
components:
  schemas:
    AIColumnBody:
      additionalProperties: false
      properties:
        meta:
          title: Meta
          description: >-
            Metadata, for internal use. Note that the language and model
            settings for the column are here. Avoid changing the model to avoid
            unexpected costs
          type: object
        name:
          title: Name
          description: The displayed name of the column
          type: string
        order_id:
          title: Order ID
          description: The displayed order of the column in the UI
          type: number
        query:
          title: Query
          description: The user-provided query to the AI
          type: string
      title: AIColumnBody
      type: object
    AIColumn:
      additionalProperties: false
      properties:
        ai_table_id:
          title: AI Table ID
          description: The unique ID of the AI Table this column belongs to
          type: integer
        id:
          title: ID
          description: The unique ID of the column
          type: integer
        meta:
          title: Meta
          description: >-
            Metadata, for internal use. Note that the language and model
            settings for the column are here. Avoid changing the model to avoid
            unexpected costs
          type: object
        modified_at:
          title: Modified At
          description: Time the column was last modified, in UTC
          type: string
        name:
          title: Name
          description: The displayed name of the column
          type: string
        order_id:
          title: Order ID
          description: The displayed order of the column in the UI
          type: number
        query:
          title: Query
          description: The user-provided query to the AI
          type: string
      required:
        - id
        - name
        - query
        - meta
        - modified_at
        - order_id
      title: AIColumn
      type: object
    ValidationError:
      description: Model of a validation error response.
      items:
        $ref: '#/components/schemas/ValidationError.ValidationErrorElement'
      title: ValidationError
      type: array
    ValidationError.ValidationErrorElement:
      description: Model of a validation error response element.
      properties:
        ctx:
          title: Error context
          type: object
        loc:
          items:
            type: string
          title: Missing field name
          type: array
        msg:
          title: Error message
          type: string
        type:
          title: Error type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationErrorElement
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````