---
title: "Imports rows from a CSV or Excel (.xlsx) file."
method: POST
path: "/datatables/{tableId}/rows/import"
tags: ["DataTables"]
---

# Imports rows from a CSV or Excel (.xlsx) file.

`POST /datatables/{tableId}/rows/import`

## Request

- Base URL: `https://api.reveldigital.com`
- URL: `https://api.reveldigital.com/datatables/{tableId}/rows/import`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://id.reveldigital.com/connect/authorize`
    - Token URL: `https://id.reveldigital.com/connect/token` scopes: `webapi`
  - API key in header `X-RevelDigital-ApiKey`
  - API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/reveldigital/apis/revel-digital-rest-api/docs/datatables/:tableId/rows/import/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `tableId` string, required

## Request body `multipart/form-data`

- object
  - `file` string, binary: The CSV or Excel (.xlsx/.xls) file to import. The header row must match the table's column keys or names (case-insensitive); unmatched columns are ignored.
  - `mode` string: How imported rows are applied: `append` (default) adds them after existing rows; `replace` deletes all existing rows first, then imports.

## Response `200`

OK

- ImportRowsResponse
  - `successCount` integer
  - `errorCount` integer
  - `errors` ImportRowErrorModel[], nullable
    - `lineNumber` integer
    - `error` string, nullable

---

[API](https://skmtc.dev/reveldigital/apis/revel-digital-rest-api.md) - [All operations](https://skmtc.dev/reveldigital/apis/revel-digital-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/reveldigital/apis/revel-digital-rest-api/revisions/39d5c8302822?raw)
