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

# Create Table

> Create a new table in the specified database.



## OpenAPI

````yaml openapi.yaml POST /databases/{databaseId}/tables
openapi: 3.0.0
info:
  title: Softr Database API
  description: >
    Public API to communicate with Softr Databases. The API follows REST
    semantics and uses JSON to encode objects.


    **Rate Limiting:**

    All calls are subject to rate limiting. On exceeding the limit, you will
    receive a 429 HTTP Response Status Code.

    - **Reads** (GET, POST /search): 40 requests/second per token.

    - **Writes** (POST, PUT, PATCH, DELETE): 30 requests/second per token.
  version: 1.0.0
servers:
  - url: https://tables-api.softr.io/api/v1
    description: Production Server
security:
  - ApiKeyAuth: []
tags:
  - name: Databases
    description: Operations related to Softr databases.
  - name: Tables
    description: Operations related to tables within a database.
  - name: Table Fields
    description: Operations to manage fields within a table.
  - name: Records
    description: Operations to manage records (rows) within a table.
paths:
  /databases/{databaseId}/tables:
    parameters:
      - name: databaseId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Tables
      summary: Create Table
      description: Create a new table in the specified database.
      operationId: createTable
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                primaryFieldName:
                  type: string
                fields:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      type:
                        type: string
                      options:
                        type: object
                        additionalProperties: true
      responses:
        '200':
          description: The newly created table.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Table'
        '429':
          description: Rate limit exceeded.
components:
  schemas:
    Table:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        primaryFieldId:
          type: string
        defaultViewId:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/TableField'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    TableField:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
          description: Optional description of the field.
        type:
          type: string
          description: The type of the field.
          enum:
            - SINGLE_LINE_TEXT
            - CHECKBOX
            - CURRENCY
            - DATE
            - DATETIME
            - DURATION
            - EMAIL
            - SELECT
            - NUMBER
            - ATTACHMENT
            - RATING
            - LINKED_RECORD
            - LONG_TEXT
            - URL
            - PERCENT
            - PHONE
            - LOOKUP
            - ROLLUP
            - FORMULA
            - CREATED_AT
            - UPDATED_AT
            - CREATED_BY
            - UPDATED_BY
            - AUTONUMBER
            - RECORD_ID
            - USER
        options:
          type: object
          description: >-
            Configuration options for the field, specific to its type. See the
            official documentation for the structure of each type.
          additionalProperties: true
        allowMultipleEntries:
          type: boolean
        readonly:
          type: boolean
        required:
          type: boolean
        locked:
          type: boolean
        defaultValue:
          type: string
          nullable: true
        aiOptions:
          type: object
          nullable: true
          description: AI-powered auto-fill configuration. Null if not configured.
          properties:
            aiFillable:
              type: boolean
            aiOnly:
              type: boolean
            allowWebSearch:
              type: boolean
            aiModel:
              type: string
            prompt:
              type: string
            canBeTriggeredManually:
              type: boolean
            runWhenRecordIsCreated:
              type: boolean
            runWhenRecordIsUpdated:
              type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Softr-Api-Key

````