> ## 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 Sheet File Import

> Import a CSV file into an existing Table sheet.

Start an asynchronous CSV import into an existing Table sheet.

Send `file_name` ending in `.csv` and `file_content_base64` containing the base64-encoded CSV content.

Pass `operation_id` when you want a stable client-side identifier for polling and webhook correlation. If omitted, PromptLayer generates one.

The response returns an `operation_id` and `status_url` for polling with [Get Table Sheet Import Operation](/reference/get-table-sheet-operation).


## OpenAPI

````yaml POST /api/public/v2/tables/{table_id}/sheets/{sheet_id}/imports/file
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/tables/{table_id}/sheets/{sheet_id}/imports/file:
    post:
      tags:
        - tables
      summary: Import File Into Table Sheet
      description: >-
        Start an asynchronous CSV import into an existing Table 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: createTableSheetFileImport
      parameters:
        - name: X-API-KEY
          in: header
          required: true
          schema:
            type: string
          description: >-
            Your PromptLayer API key. The key's workspace scopes table resources
            for this request.
        - name: table_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Table ID.
        - name: sheet_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Table sheet ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTableSheetFileImportRequest'
      responses:
        '202':
          description: File import queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TableSheetImportStartResponse'
        '400':
          description: Invalid request body, file, or workspace context.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Table or sheet not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to upload file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateTableSheetFileImportRequest:
      type: object
      title: CreateTableSheetFileImportRequest
      required:
        - file_name
        - file_content_base64
      properties:
        operation_id:
          type: string
          nullable: true
          description: >-
            Optional client-provided operation ID. A UUID is generated when
            omitted.
        file_name:
          type: string
          minLength: 1
          maxLength: 255
          description: CSV file name. Must end with .csv.
        file_content_base64:
          type: string
          minLength: 1
          description: Base64-encoded CSV file content.
      additionalProperties: false
    TableSheetImportStartResponse:
      type: object
      title: TableSheetImportStartResponse
      required:
        - success
        - message
        - operation_id
        - operation
        - status_url
      properties:
        success:
          type: boolean
        message:
          type: string
        operation_id:
          type: string
        operation:
          $ref: '#/components/schemas/TableImportOperation'
        status_url:
          type: string
      additionalProperties: false
    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.
    TableImportOperation:
      type: object
      description: Status of an asynchronous sheet import operation.
      properties:
        operation_id:
          type: string
        source:
          type: string
          enum:
            - file
            - request_logs
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
        progress:
          type: number
          nullable: true
        message:
          type: string
          nullable: true
        rows_added:
          type: integer
          nullable: true
        row_count:
          type: integer
          nullable: true
        file_name:
          type: string
          nullable: true
        error_message:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````