Python
import requests
url = "https://app.langwatch.ai/api/v1/dataset/{slugOrId}/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
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/{slugOrId}/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/{slugOrId}/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-Token: <api-key>' \
--form file=@example-file{
"datasetId": "<string>",
"recordsCreated": 4503599627370495
}Datasets
Upload a file
deprecated
Upload a file (CSV, JSON, JSONL) to an existing dataset upload the file as a stored object with the purpose dataset_import, then create the dataset from it
POST
/
api
/
v1
/
dataset
/
{slugOrId}
/
upload
Python
import requests
url = "https://app.langwatch.ai/api/v1/dataset/{slugOrId}/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
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/{slugOrId}/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/{slugOrId}/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-Token: <api-key>' \
--form file=@example-file{
"datasetId": "<string>",
"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.
Path Parameters
Body
multipart/form-data
Last modified on October 12, 2026
Was this page helpful?