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

# Create Table

> Create a new Table. By default, an empty Sheet 1 with a Column A text column and one empty row is created. Pass create_default_sheet: false to create a table without a default sheet. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace.

Create a new Table. By default, an empty `Sheet 1` with a `Column A` text column and one empty row is created automatically.

Pass `create_default_sheet: false` to create a table without a default sheet. The response omits `default_sheet` and `table.sheet_count` is `0`. Add sheets later with [Create Sheet](/reference/table-sheets-create).

The table is created in the workspace associated with your API key.

Tables are versioned, multi-sheet tables that can run LLM, code, and comparison columns to generate or evaluate data at scale.


## OpenAPI

````yaml POST /api/public/v2/tables
openapi: 3.1.0
info:
  title: PromptLayer API
  description: >-
    REST API for PromptLayer: prompt template management, request logging,
    observability, evaluations, and workflows.
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/tables:
    post:
      tags:
        - smart-tables
      summary: Create Table
      description: >-
        Create a new Table. By default, an empty Sheet 1 with a Column A text
        column and one empty row is created. Pass create_default_sheet: false to
        create a table without a default sheet. Requests are scoped to the
        workspace associated with the API key; table, sheet, column, cell,
        operation, and version IDs must belong to that workspace.
      operationId: create_table
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTableRequest'
            examples:
              withDefaultSheet:
                summary: Create with default Sheet 1
                value:
                  title: Regression suite
              withoutDefaultSheet:
                summary: Create without a default sheet
                value:
                  title: Regression suite
                  create_default_sheet: false
      responses:
        '201':
          description: >-
            Table created. When create_default_sheet is true (default), the
            response includes default_sheet and table.sheet_count is 1. When
            create_default_sheet is false, default_sheet is omitted and
            table.sheet_count is 0.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTableResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: Folder not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CreateTableRequest:
      type: object
      title: CreateTableRequest
      properties:
        title:
          type: string
          description: Table title. Defaults to a unique 'Untitled Table' name if omitted.
          nullable: true
        folder_id:
          type: integer
          description: Folder to place the table in.
          nullable: true
        create_default_sheet:
          type: boolean
          default: true
          description: >-
            When true (default), creates Sheet 1 with a Column A text column and
            one empty row. When false, creates an empty table with no sheets.
    CreateTableResponse:
      type: object
      title: CreateTableResponse
      properties:
        success:
          type: boolean
        message:
          type: string
        table:
          $ref: '#/components/schemas/TableDetail'
        default_sheet:
          allOf:
            - $ref: '#/components/schemas/Sheet'
          description: >-
            The default sheet created when create_default_sheet is true. Omitted
            when create_default_sheet is false.
      required:
        - success
        - table
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
          description: Indicates that the request failed.
        message:
          type: string
          description: Human-readable error message.
        error:
          type: string
          description: Machine-readable or fallback error message.
      additionalProperties: true
      description: >-
        Standard error response. Some legacy endpoints may return either message
        or error.
    TableDetail:
      allOf:
        - $ref: '#/components/schemas/Table'
      type: object
      properties:
        sheet_row_counts:
          type: object
          description: Map of sheet_id → row count.
          additionalProperties:
            type: integer
    Sheet:
      type: object
      description: A sheet within a Table.
      properties:
        id:
          type: string
          format: uuid
        table_id:
          type: string
          format: uuid
        workspace_id:
          type: integer
          description: >-
            Workspace that owns this resource; determined by the authenticated
            request scope.
        title:
          type: string
        index:
          type: integer
          description: Display order of the sheet within the table (0-based).
        row_count:
          type: integer
        version_count:
          type: integer
          description: >-
            Current sheet version number. It increments when sheet data, layout,
            score configuration, imports, or execution output changes.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Table:
      type: object
      description: >-
        A Table — a versioned, multi-sheet table that can run LLM columns to
        generate or evaluate data at scale.
      properties:
        id:
          type: string
          format: uuid
          description: Unique table identifier.
        workspace_id:
          type: integer
          description: >-
            Workspace that owns this resource; determined by the authenticated
            request scope.
        title:
          type: string
        folder_id:
          type: integer
          nullable: true
        sheet_count:
          type: integer
          description: Number of active sheets.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    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
  responses:
    UnauthorizedError:
      description: Unauthorized - missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error - request parameters or body are invalid.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/HTTPValidationError'
              - $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````