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

# Update Table Schema

> Update the data schema for a table.



## OpenAPI

````yaml post /projects/{project_name}/tables/{table_id}/schema
openapi: 3.0.3
info:
  title: Cloudsquid
  description: This is the backend of cloudsquid specification
  termsOfService: cloudsquid.io
  contact:
    email: info@cloudsquid.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.11
servers:
  - url: https://api.cloudsquid.io/api
    description: API
security:
  - api-key: []
paths:
  /projects/{project_name}/tables/{table_id}/schema:
    parameters:
      - name: project_name
        in: path
        required: true
        description: The name of the project
        schema:
          type: string
      - name: table_id
        in: path
        required: true
        description: The id of the table
        schema:
          type: string
          format: uuid
    post:
      tags:
        - tables
      summary: POST /projects/{project_name}/tables/{table_id}/schema
      description: update a field
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSchema'
      responses:
        '200':
          description: Successfully created field
        '409':
          description: Collision in fields
        '500':
          description: Something went wrong
components:
  schemas:
    DataSchema:
      type: object
      description: schema of the data
      properties:
        schema:
          $ref: '#/components/schemas/DataSchemaFieldRoot'
      required:
        - schema
    DataSchemaFieldRoot:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        order:
          type: array
          items:
            type: string
        fields:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DataSchemaField'
      required:
        - name
        - fields
    DataSchemaField:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        type:
          type: string
          enum:
            - TEXT
            - FLOAT
            - BOOLEAN
            - BIGINT
            - DATE
            - TIMESTAMP
            - USER-DEFINED
            - ARRAY
            - UNIQUE
            - PRIMARY KEY
            - FOREIGN KEY
        long_array:
          type: boolean
          description: whether the field is a long array that gets chunked
        enum_values:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              color:
                type: string
        fields:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DataSchemaField'
      required:
        - name
        - description
        - type
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key

````