---
title: "Import CSV data"
method: POST
path: "/tables/import/{dbId}/{tableId}"
tags: ["Data Import"]
---

# Import CSV data

`POST /tables/import/{dbId}/{tableId}`

Import CSV data in chunks for large files. Requires that a file has been uploaded using the `/upload` endpoint first. Automatically resumes from last byte position. Use `status=true` to check import progress without processing data.

## Path parameters

- `dbId` string, required
- `tableId` string, required

## Request body

- object
  - `status` boolean — If true, returns only import status without processing data (default: false)
  - `max_time` integer — Maximum execution time in seconds (default: 30, min: 10, max: 120). Processes as many rows as possible within this time.
  - `delimiter` 'comma' | 'tab' | 'semicolon' | ',' | ';' — CSV delimiter - comma, tab, semicolon (default: comma)

## Response `200`

successful operation

- ImportResponse
  - `status` string
  - `csv_info` object
    - `csv_file_path` string — Path to the CSV file being imported
    - `csv_uploaded_at` string, date-time — When the CSV file was uploaded
    - `file_size` integer — Total file size in bytes
    - `file_size_mb` number, float — Total file size in megabytes
  - `batch` object — Information about the current batch processed
    - `rows_processed` integer — Number of rows processed in this batch
    - `byte_offset_start` integer — File byte position where this batch started
    - `byte_offset_end` integer — File byte position where this batch ended (resume point for next batch)
    - `execution_time_seconds` number, float — Execution time for this batch in seconds
    - `execution_time_formatted` string — Human-readable execution time
  - `progress` object — Overall import progress information
    - `total_rows_processed` integer — Total cumulative rows imported so far
    - `progress_percent` number, float — Import completion percentage (based on file size)
    - `import_status` 'ready' | 'in_progress' | 'completed' — Current import status
    - `has_more` boolean — Whether there are more batches to process
  - `next` object — Only present if has_more is true. Contains information for resuming import.
    - `byte_offset` integer — Byte offset for next batch (resume point)
    - `endpoint` string — API endpoint to call for next batch
    - `message` string

## Other responses

- `400` — Validation error - table has data or data inconsistency

## Changes

- **2025-12-01** `c9fac12336ea` — 2 info
  - api tag `Data Import` added
  - api tag `Tables` removed
- **2025-09-06** `a278ba81f405` — 1 info
  - endpoint added
- **2023-12-21** `1451f79c7f04` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/ihsn/apis/data-tables/changes/tables/import/:dbId/:tableId/post.md)

---

[API](https://skmtc.dev/ihsn/apis/data-tables.md) · [All operations](https://skmtc.dev/ihsn/apis/data-tables/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ihsn/data-tables/revisions/6fb7730a430d/schema)
