Skip to contentSkip to page list

Docs

Create a new dataset from an uploaded file

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
Request and response examples
request.py
import osimport requestsimport json​origin = "https://app.langwatch.ai"path = "/api/v1/dataset/upload"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}​# Supply your request body in payload.jsonwith open("payload.json") as file:    payload = json.load(file)​response = requests.post(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "id": "string",  "name": "string",  "slug": "string",  "columnTypes": [    {      "name": "string",      "type": "string"    }  ],  "createdAt": "2026-01-01T00:00:00Z",  "updatedAt": "2026-01-01T00:00:00Z",  "recordsCreated": 0}
api-reference/datasets/create-upload

Authorization

X-Auth-Tokenstringheaderrequired

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.

Request body

multipart/form-data · Required

namestringrequired
At least 1 character
filestring (binary)required

Responses

201

Success

application/json

idstringrequired
namestringrequired
slugstringrequired
columnTypesobject[]required
namestringrequired
At least 1 character
typestringrequired
One of"string""boolean""number""date""list""json""spans""rag_contexts""chat_messages""annotations""evaluations""image""file"
createdAtstring (date-time)required
updatedAtstring (date-time)required
recordsCreatedintegerrequired
Minimum 0Maximum 9007199254740991

Documentation