> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-pb-update-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# updateTable

> Updates the schema or the name of an existing table.



## OpenAPI

````yaml /tables-openapi.json put /v1/tables/{table}
openapi: 3.0.0
info:
  title: Botpress Tables API
  description: API for Botpress Tables
  version: 1.112.0
servers:
  - url: https://api.botpress.cloud
security:
  - BearerAuth: []
tags:
  - name: documented
paths:
  /v1/tables/{table}:
    put:
      tags:
        - Endpoints
      description: Updates the schema or the name of an existing table.
      operationId: updateTable
      parameters:
        - name: table
          in: path
          description: >-
            The table's name or unique identifier for targeting specific table
            operations.
          required: true
          schema:
            type: string
        - name: x-bot-id
          in: header
          description: Bot id
          required: true
          schema:
            type: string
        - name: x-integration-id
          in: header
          description: Integration id
          required: false
          schema:
            type: string
        - name: x-integration-alias
          in: header
          description: Integration alias
          required: false
          schema:
            type: string
        - name: x-integration-name
          in: header
          description: Integration name
          required: false
          schema:
            type: string
        - name: x-user-id
          in: header
          description: User Id
          required: false
          schema:
            type: string
        - name: x-user-role
          in: header
          description: User Role
          required: false
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/updateTableBody'
      responses:
        '200':
          $ref: '#/components/responses/updateTableResponse'
        default:
          $ref: '#/components/responses/updateTableResponse'
components:
  requestBodies:
    updateTableBody:
      description: The updated schema/name of the table.
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                description: Required. This name is used to identify your table.
                type: string
                minLength: 1
              frozen:
                type: boolean
                description: >-
                  A table designated as "frozen" is immutable in terms of its
                  name and schema structure; modifications to its schema or a
                  renaming operation are not permitted. The only action that can
                  be taken on such a table is deletion. The schema established
                  at the time of creation is locked in as the final structure.
                  To implement any changes, the table must be duplicated with
                  the desired alterations.
              keyColumn:
                type: string
                nullable: true
                description: >-
                  Designate a column as the primary unique identifier for this
                  table. When set, a unique index is automatically created on
                  this column, enabling significantly faster upsert operations.
                  All values in this column must be unique across the table.
                  When set to null, the key index is removed.
              schema:
                type: object
                additionalProperties: true
                description: >-
                  Provide an object or a JSON schema to define the columns of
                  the table. A maximum of 20 keys in the object/schema is
                  allowed.
              tags:
                type: object
                additionalProperties:
                  type: string
                description: >-
                  Optional tags to help organize your tables. These should be
                  passed here as an object representing key/value pairs.
              isComputeEnabled:
                type: boolean
                description: Indicates if the table is enabled for computation.
              factor:
                type: number
                minimum: 1
                maximum: 30
                description: >-
                  The 'factor' multiplies the row's data storage limit by 4KB
                  and its quota count. It can only be increased, not decreased.
                  For instance, a factor of 2 increases storage to 8KB but
                  counts as 2 rows in your quota.
            title: updateTableBody
            additionalProperties: false
  responses:
    updateTableResponse:
      description: The updated table
      content:
        application/json:
          schema:
            type: object
            properties:
              table:
                $ref: '#/components/schemas/Table'
              staleColumns:
                type: array
                items:
                  type: string
                description: >-
                  List of columns that have become stale following the
                  modification.
            required:
              - table
            title: updateTableResponse
            additionalProperties: false
  schemas:
    Table:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the table
        name:
          description: Required. This name is used to identify your table.
          type: string
          minLength: 1
        factor:
          default: 1
          type: number
          minimum: 1
          maximum: 30
          description: >-
            The 'factor' multiplies the row's data storage limit by 4KB and its
            quota count. It can only be increased (not decreased) after table
            creation via updateTable. For instance, a factor of 2 increases
            storage to 8KB but counts as 2 rows in your quota. The default
            factor is 1.
        frozen:
          type: boolean
          description: >-
            A table designated as "frozen" is immutable in terms of its name and
            schema structure; modifications to its schema or a renaming
            operation are not permitted. The only action that can be taken on
            such a table is deletion. The schema established at the time of
            creation is locked in as the final structure. To implement any
            changes, the table must be duplicated with the desired alterations.
        keyColumn:
          type: string
          nullable: true
          description: >-
            Designate a column as the primary unique identifier for this table.
            When set, a unique index is automatically created on this column,
            enabling significantly faster upsert operations. All values in this
            column must be unique across the table. When set to null, the key
            index is removed.
        schema:
          type: object
          properties:
            $schema:
              type: string
            properties:
              type: object
              additionalProperties:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - string
                      - number
                      - boolean
                      - object
                      - array
                      - 'null'
                  format:
                    type: string
                    enum:
                      - date-time
                  description:
                    type: string
                  pattern:
                    type: string
                    description: String properties must match this pattern
                  enum:
                    type: array
                    items:
                      type: string
                    description: String properties must be one of these values
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - string
                          - number
                          - boolean
                          - object
                          - array
                          - 'null'
                    required:
                      - type
                    additionalProperties: true
                    description: Defines the shape of items in an array
                  nullable:
                    default: true
                    type: boolean
                  properties:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - string
                            - number
                            - boolean
                            - object
                            - array
                            - 'null'
                      required:
                        - type
                      additionalProperties: true
                  x-zui:
                    type: object
                    properties:
                      index:
                        type: integer
                      id:
                        type: string
                        description: '[deprecated] ID of the column.'
                      searchable:
                        type: boolean
                        description: Indicates if the column is vectorized and searchable.
                      hidden:
                        type: boolean
                        description: Indicates if the field is hidden in the UI
                      order:
                        type: number
                        description: Order of the column in the UI
                      width:
                        type: number
                        description: Width of the column in the UI
                      schemaId:
                        type: string
                        description: ID of the schema
                      computed:
                        type: object
                        properties:
                          action:
                            type: string
                            enum:
                              - ai
                              - code
                              - workflow
                          dependencies:
                            default: []
                            type: array
                            items:
                              type: string
                          prompt:
                            type: string
                            description: Prompt when action is "ai"
                          code:
                            type: string
                            description: Code to execute when action is "code"
                          model:
                            default: gpt-4o
                            type: string
                            maxLength: 80
                            description: Model to use when action is "ai"
                          workflowId:
                            type: string
                            maxLength: 20
                            description: >-
                              ID of Workflow to execute when action is
                              "workflow"
                          enabled:
                            type: boolean
                        required:
                          - action
                        additionalProperties: false
                      typings:
                        type: string
                        description: >-
                          TypeScript typings for the column. Recommended if the
                          type is "object", ex: "\{ foo: string; bar: number \}"
                    required:
                      - index
                    additionalProperties: false
                required:
                  - type
                  - x-zui
                additionalProperties: false
              description: List of keys/columns in the table.
            additionalProperties:
              type: boolean
              enum:
                - true
              description: >-
                Additional properties can be provided, but they will be ignored
                if no column matches.
            required:
              type: array
              items:
                type: string
              description: Array of required properties.
            type:
              type: string
              enum:
                - object
          required:
            - properties
            - additionalProperties
            - type
          additionalProperties: false
        tags:
          type: object
          additionalProperties:
            type: string
          description: >-
            Optional tags to help organize your tables. These should be passed
            here as an object representing key/value pairs.
        isComputeEnabled:
          type: boolean
          description: Indicates if the table is enabled for computation.
        createdAt:
          type: string
          format: date-time
          description: Timestamp of table creation.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of the last table update.
      required:
        - id
        - name
        - schema
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````