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

# Insert rows

> Create a private Explorer table or add rows to an existing table.

The API creates a private Explorer table in your organization when `table_name` does not exist. If the table exists, the API adds rows to it.

Send `data` as an array of objects with the same column names. Set `overwrite` to `true` to replace an existing table and its data. The default is `false`.

```bash theme={null}
curl -X POST "https://api.allium.so/api/v1/explorer/data-management/tables/wallet_addresses/insert" \
  -H "X-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "data": [
      {"address": "0x123", "chain": "ethereum", "label": "treasury"},
      {"address": "0x456", "chain": "ethereum", "label": "operations"},
      {"address": "0x789", "chain": "base", "label": "treasury"}
    ],
    "overwrite": false
  }'
```

The API returns an ingest job before the rows finish loading. Save its `job_id` and [get the ingest job](https://docs.allium.so/api/data-upload/get-ingest-job.md) to check the status and row counts.

## Upload limits

| Limit | Value |
| - | - |
| JSON request body | 32 MiB |
| Rows per upload | 1 to 200,000 |
| Columns | 1 to 100 |

Every row must have the same column names. The table name must start with a letter or underscore. It can contain only letters, digits, or underscores and have no more than 255 characters.


## OpenAPI

````yaml _openapi/data-upload-api.json POST /api/v1/explorer/data-management/tables/{table_name}/insert
openapi: 3.1.0
info:
  title: Data Upload API
  version: 1.0.0
  description: Create private Explorer tables, add rows, and track ingest jobs.
servers:
  - url: https://api.allium.so
security: []
paths:
  /api/v1/explorer/data-management/tables/{table_name}/insert:
    post:
      tags:
        - Data Upload API
      summary: Insert rows
      description: >-
        Create a private Explorer table or add rows to an existing table. The
        API returns an ingest job before the rows finish loading.
      operationId: >-
        insert_table_api_v1_explorer_data_management_tables__table_name__insert_post
      parameters:
        - name: table_name
          in: path
          required: true
          schema:
            type: string
            title: Table Name
            pattern: ^[A-Za-z_][A-Za-z0-9_]{0,254}$
          description: >-
            Table name. Starts with a letter or underscore and contains only
            letters, digits, or underscores.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InsertTableBody'
            example:
              data:
                - address: '0x123'
                  chain: ethereum
                  label: treasury
                - address: '0x456'
                  chain: ethereum
                  label: operations
                - address: '0x789'
                  chain: base
                  label: treasury
              overwrite: false
        description: >-
          The JSON body can be up to 32 MiB and contain 1 to 200,000 rows. Each
          row must have the same columns, with 1 to 100 columns per row.
      responses:
        '200':
          description: >-
            The upload job was created. Check its status to learn whether the
            rows were loaded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestJob'
        '400':
          description: The table name or upload data is invalid.
        '401':
          description: The API key is missing or invalid.
        '403':
          description: The API key cannot upload to this organization or table.
        '413':
          description: >-
            The JSON request body exceeds 32 MiB. The response body is plain
            text.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: Data uploads are unavailable for this organization.
      security:
        - APIKeyBearer: []
components:
  schemas:
    InsertTableBody:
      properties:
        data:
          items:
            additionalProperties: true
            type: object
            minProperties: 1
            maxProperties: 100
          type: array
          title: Data
          description: Rows with the same column names. Each row has 1 to 100 columns.
          minItems: 1
          maxItems: 200000
        overwrite:
          type: boolean
          title: Overwrite
          default: false
          description: If true, replace the table and its existing data. Defaults to false.
      type: object
      required:
        - data
      title: InsertTableBody
      description: Rows to add to the table.
    IngestJob:
      properties:
        job_id:
          type: string
          title: Job Id
        table_name:
          type: string
          title: Table Name
        status:
          $ref: '#/components/schemas/IngestJobStatus'
          default: queued
        creator_organization_id:
          type: string
          title: Creator Organization Id
        creator_org_team_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Creator Org Team User Id
        overwrite:
          type: boolean
          title: Overwrite
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        stats:
          anyOf:
            - $ref: '#/components/schemas/UploadStats'
            - type: 'null'
          description: Row counts when available. May be null while the job runs.
      type: object
      required:
        - job_id
        - table_name
        - creator_organization_id
        - overwrite
        - created_at
        - updated_at
      title: IngestJob
      description: A job that uploads rows to a table.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    IngestJobStatus:
      type: string
      enum:
        - queued
        - running
        - completed
        - failed
        - up_for_retry
      title: IngestJobStatus
      description: Current upload job state.
    UploadStats:
      properties:
        rows_inserted:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Inserted
        rows_updated:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Updated
      type: object
      title: UploadStats
      description: Rows inserted and updated by an ingest job.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````