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

# Update Data Source from CSV

`PUT /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, the endpoint will overwrite the contents of the single collection with the new data. The collection reference is left unchanged, but will have new items.

A specific collection in a data source can be replaced by including both the data source and collection query parameters. In this case, the items in that single collection will be overwritten with the values from the CSV. The target collection's id will remain the same, i.e., the original collection is the same, just the items have changed. The specified collection must belong to the specified data source.

## Query parameters

- `dataSource` string, required
- `collection` string

## 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, unable to read file, or datasource query parameter is missing

---

[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)
