Python
import requests
url = "https://app.langwatch.ai/api/v1/dataset/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "name": "<string>" }
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('name', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'X-Auth-Token': '<api-key>'}};
options.body = form;
fetch('https://app.langwatch.ai/api/v1/dataset/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/dataset/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-Token: <api-key>' \
--form 'name=<string>' \
--form file=@example-file{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"columnTypes": [
{
"name": "<string>",
"type": "string"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"recordsCreated": 4503599627370495
}Datasets
Create a new dataset from an uploaded file
deprecated
Create a new dataset from an uploaded file (CSV, JSON, JSONL) upload the file as a stored object with the purpose dataset_import, then create the dataset from it
POST
/
api
/
v1
/
dataset
/
upload
Python
import requests
url = "https://app.langwatch.ai/api/v1/dataset/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "name": "<string>" }
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('name', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'X-Auth-Token': '<api-key>'}};
options.body = form;
fetch('https://app.langwatch.ai/api/v1/dataset/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/dataset/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-Token: <api-key>' \
--form 'name=<string>' \
--form file=@example-file{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"columnTypes": [
{
"name": "<string>",
"type": "string"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"recordsCreated": 4503599627370495
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Last modified on October 12, 2026
Was this page helpful?