---
title: "Create Data Source from CSV"
method: POST
path: "/adapter/csv"
tags: ["Data Source"]
---

# Create Data Source from CSV

`POST /adapter/csv`

## Request

- Base URL: `https://data.lucid.app`
- URL: `https://data.lucid.app/adapter/csv`
- Auth: OAuth 2
  - Authorization code: `https://lucid.app/oauth2/authorize`
  - Token URL: `https://api.lucid.co/oauth2/token` scopes: `data-service.admin`

If able to successfully parse the attached file as a CSV file, a new data source with be created (with the same name as the attached file) that includes a single collection. The single collection in the newly created data source will contain the data from the CSV file. Each row will be an item, and each column will be labelled A, B, C, …, AA, AB, AC, .. in the order in which they were in the original file. There will be a single metadata collection created which represents the mapping between the id of each created item and the original row number of the row it was created from.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: CSV file to upload

## Response `200`

OK with Data Source

- object
  - `uri` string, required: URI of the data source
  - `name` string, required: Name of the data source
  - `adapterType` string, required: Type of adapter used to create the data source. Valid values are `CSV`, `DATA_API`, and `UNKNOWN`
  - `collections` string, required: Link to get collections for the data source
  - `created` string, required: Date the data source was created
  - `lastModified` string, required: Date the data source was last modified
  - `pending` boolean, required: If a data source is marked pending it won't be availble for users to select within Lucid
  - `dataSet` string, required: Link to get the data set for the data source
  - `linkParameters` object: Link parameters for the data source
  - `deleted` string: Date the data source was deleted

## Other responses

- `400`: Bad Request if no file provided or unable to read file

---

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