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

# Create a table

> Create a new table in your workspace. Optionally specify a name, column names, and number of empty rows. By default the table is created with columns column1/column2/column3 and 0 rows.



## OpenAPI

````yaml POST /v1/table/create
openapi: 3.1.0
info:
  title: Databar.ai API
  description: >-

    # Authentication


    Databar uses API keys to allow access to the API. You can find your API key
    in your workspace home page, but to use the REST API you’ll first need to
    schedule a call with us.

    Our API expects the API key to be included in all API requests to the server
    in the Header of your request with the key `x-apikey`.

    To find your API key, head over to your Databar workspace and click
    Integrations.


    **Example:**


    `bash

    curl https://api.databar.ai/v1/user/me -H x-apikey: {YOUR_API_KEY}`
  contact:
    email: info@databar.ai
  version: 0.1.2
servers:
  - url: https://api.databar.ai
    description: Production
security: []
paths:
  /v1/table/create:
    post:
      tags:
        - Table
      summary: Create a table
      description: >-
        Create a new table in your workspace. Optionally specify a name, column
        names, and number of empty rows. By default the table is created with
        columns column1/column2/column3 and 0 rows.
      operationId: Create_a_table_v1_table_create_post
      parameters:
        - name: x-apikey
          in: header
          required: true
          schema:
            type: string
            title: API Key
            description: API Key for authentication
          description: API Key for authentication
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/CreateTableRequest'
                - type: 'null'
              title: Body
      responses:
        '200':
          description: Table created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
              example:
                identifier: 123e4567-e89b-12d3-a456-426614174000
                name: My Table
                created_at: '2023-05-01T12:00:00Z'
                updated_at: '2023-05-01T12:00:00Z'
                table_url: >-
                  https://databar.ai/tables?table=123e4567-e89b-12d3-a456-426614174000&workspace=abc12345-6789-0abc-def0-123456789abc
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                detail: Not allowed
        '410':
          description: Expired token
          content:
            application/json:
              example:
                detail: The token has expired
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateTableRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Columns
        rows:
          type: integer
          title: Rows
          default: 0
      type: object
      title: CreateTableRequest
    Table:
      properties:
        identifier:
          type: string
          title: Identifier
        name:
          type: string
          title: Name
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        workspace_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Workspace Identifier
        table_url:
          type: string
          title: Table Url
          readOnly: true
      type: object
      required:
        - identifier
        - name
        - created_at
        - updated_at
        - table_url
      title: Table
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````