---
title: "Import dataset items from CSV or JSONL"
method: POST
path: "/v1/datasets-v2/{datasetId}/import"
tags: ["Datasets v2"]
---

# Import dataset items from CSV or JSONL

`POST /v1/datasets-v2/{datasetId}/import`

## Request

- Base URL: `https://api.lunary.ai`
- URL: `https://api.lunary.ai/v1/datasets-v2/{datasetId}/import`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lunary/apis/lunary-api/docs/v1/datasets-v2/:datasetId/import/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `datasetId` string, uuid, required

## Request body

- DatasetV2ImportRequest
  - `format` 'csv' | 'jsonl', required
  - `content` string, required

## Response `200`

Number of imported items

- object
  - `insertedCount` integer

---

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