---
title: "Import data into a table (synchronous, deprecated)"
method: POST
path: "/v2/storage/tables/{tableId}/import"
tags: ["Tables"]
---

# Import data into a table (synchronous, deprecated)

`POST /v2/storage/tables/{tableId}/import`

## Request

- Base URL: `https://connection.keboola.com`
- URL: `https://connection.keboola.com/v2/storage/tables/{tableId}/import`
- Auth: one of:
  - API key in header `X-StorageApi-Token`
  - API key in header `X-KBC-ManageApiToken`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/keboola/apis/keboola-storage-api/docs/v2/storage/tables/:tableId/import/post.ts> (a function with typed inputs; its response is checked against the schema)

Imports an uploaded CSV file into an existing table and waits for the import to finish.
This endpoint is deprecated; use the asynchronous
`POST /v2/storage/tables/{id}/import-async` endpoint instead.

The CSV file must have a header row with column names, unless `withoutHeaders` is used.
Every column already present in the table must also be present in the CSV; any CSV column
not yet on the table is created automatically. The file may be compressed - a `.gz`,
`.gzip` or `.zip` extension makes it unpacked before the import.

## Path parameters

- `tableId` string, required

## Request body `multipart/form-data`

- object: The imported data is taken from "dataString" (inline CSV) when it is set to a non-empty value other than "0"; otherwise the uploaded "data" file is used. If neither yields data the request fails with a 400 error.
  - `data` string, binary: CSV file to import. Used when "dataString" is empty, unset, or "0".
  - `dataString` string: Inline CSV data. Takes precedence over "data" unless it is empty or "0".
  - `incremental` boolean: When true, the data is appended to the table instead of replacing it.
  - `delimiter` string: Field delimiter, default ",".
  - `enclosure` string: Field enclosure, default '"'.
  - `escapedBy` string: Escape character, default none.
  - `columns` string: Comma separated list of column names, used when the file has no header.
  - `withoutHeaders` boolean: When true, the first row is treated as data and the table column order is used.

## Response `200`

The import result.

- ImportSyncResponse: Result of a synchronous table import.
  - `transaction` 'null', nullable, required: Always `null`, kept for backward compatibility.
  - `warnings` string[], required
  - `importedColumns` string[], required: Columns the data was imported into.
  - `totalRowsCount` integer, required
  - `totalDataSizeBytes` integer, required
  - `importedRowsCount` integer, required: For a full load this equals `totalRowsCount`; for an incremental load it is the number of imported rows.
  - `newColumns` union, required: Columns added to the table by the import. An object keyed by the column's position in the import when the new columns do not lead the column list, e.g. `{"2": "c"}`.
    - string[]
    - object

## Other responses

- `400`: Validation error in the upload, CSV or import.
- `403`: Write access to the table bucket was denied.
- `404`: The table was not found, or synchronous import is disabled on this stack.
- `503`: The bucket or its backend is under maintenance.

---

[API](https://skmtc.dev/keboola/apis/keboola-storage-api.md) - [All operations](https://skmtc.dev/keboola/apis/keboola-storage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keboola/apis/keboola-storage-api/revisions/34b5ceac0317?raw)
