> ## 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.

# Add rows to table

> Add rows to a table in batch. Uses human-readable column names.

**options.allow_new_columns** — when `true`, any column name in `fields` that doesn't exist yet will be auto-created as a text column.

**options.dedupe** — when `enabled: true`, rows whose `keys` columns match an existing row are skipped (`action: skipped_duplicate`) instead of inserted.



## OpenAPI

````yaml /api-reference/openapi.json POST /v1/table/{table_uuid}/rows
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/{table_uuid}/rows:
    post:
      tags:
        - Table
      summary: Insert multiple rows into a table
      description: >-
        Add rows to a table in batch. Uses human-readable column names.


        **options.allow_new_columns** — when `true`, any column name in `fields`
        that doesn't exist yet will be auto-created as a text column.


        **options.dedupe** — when `enabled: true`, rows whose `keys` columns
        match an existing row are skipped (`action: skipped_duplicate`) instead
        of inserted.
      operationId: Batch_insert_rows_v1_table__table_uuid__rows_post
      parameters:
        - name: table_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The UUID of the table
            title: Table Uuid
          description: The UUID of the table
        - name: x-apikey
          in: header
          required: true
          schema:
            type: string
            title: API Key
            description: API Key for authentication
          description: API Key for authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchInsertRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchInsertResponse'
        '400':
          description: Validation error (BATCH_TOO_LARGE, UNKNOWN_COLUMNS, INVALID_DATA).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SDKErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BatchInsertRequest:
      properties:
        rows:
          items:
            $ref: '#/components/schemas/InsertRow'
          type: array
          maxItems: 50
          minItems: 1
          title: Rows
          description: List of rows to insert (max 50).
        options:
          anyOf:
            - $ref: '#/components/schemas/InsertOptions'
            - type: 'null'
          description: Insert options (auto-create columns, deduplication).
        return_rows:
          type: boolean
          title: Return Rows
          description: If true, each result includes full row_data after insert.
          default: false
      type: object
      required:
        - rows
      title: BatchInsertRequest
      example:
        options:
          allow_new_columns: true
          dedupe:
            enabled: true
            keys:
              - column1
              - column2
              - column3
        return_rows: false
        rows:
          - fields:
              email: alice@example.com
              first_name: Alice
              title: PM
          - fields:
              email: bob@example.com
              first_name: Bob
    BatchInsertResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/BatchInsertResultItem'
          type: array
          title: Results
      type: object
      required:
        - results
      title: BatchInsertResponse
      example:
        results:
          - action: created
            id: a1b2c3d4-0000-0000-0000-000000000001
            index: 0
          - action: created
            id: a1b2c3d4-0000-0000-0000-000000000002
            index: 1
    SDKErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: 'Error code: BATCH_TOO_LARGE, UNKNOWN_COLUMNS, INVALID_DATA.'
        max_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Size
          description: Maximum batch size (only for BATCH_TOO_LARGE).
        columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Columns
          description: Unknown column names (only for UNKNOWN_COLUMNS).
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: Human-readable error message (only for INVALID_DATA).
      type: object
      required:
        - error
      title: SDKErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InsertRow:
      properties:
        fields:
          type: object
          title: Fields
          description: Column values for the new row, keyed by human-readable column name.
          example:
            email: alice@example.com
            first_name: Alice
      type: object
      required:
        - fields
      title: InsertRow
    InsertOptions:
      properties:
        allow_new_columns:
          type: boolean
          title: Allow New Columns
          description: >-
            If true, unknown column names in fields will be auto-created as text
            columns.
          default: false
        dedupe:
          anyOf:
            - $ref: '#/components/schemas/DedupeOptions'
            - type: 'null'
          description: Deduplication settings.
      type: object
      title: InsertOptions
    BatchInsertResultItem:
      properties:
        index:
          type: integer
          title: Index
          description: Original index in the request array.
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: UUID of the created row (null if skipped).
        action:
          type: string
          enum:
            - created
            - skipped_duplicate
          title: Action
          description: '''created'' or ''skipped_duplicate''.'
        row_data:
          anyOf:
            - type: object
            - type: 'null'
          title: Row Data
          description: Full row data (only when return_rows=true).
      type: object
      required:
        - index
        - action
      title: BatchInsertResultItem
    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
    DedupeOptions:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Enable deduplication check before inserting.
          default: false
        keys:
          items:
            type: string
          type: array
          title: Keys
          description: Column names to check for duplicates.
      type: object
      title: DedupeOptions

````