Skip to contentSkip to page list

Docs

Import an uploaded file into a dataset

Add an uploaded and confirmed file's rows to a dataset

POST/api/v1/dataset/{slugOrId}/imports
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/dataset/<slugOrId>/imports"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}payload = {}​response = requests.post(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "datasetId": "string",  "recordsCreated": 0}
api-reference/datasets/import-an-uploaded-file-into-a-dataset

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.

Path parameters

slugOrIdstringrequired

Request body

application/json · Required

storedObjectIdstringrequired
At least 1 characterUp to 255 charactersPattern ^[A-Za-z0-9][A-Za-z0-9._:-]*$

Responses

200

Success

application/json

datasetIdstringrequired
recordsCreatedintegerrequired
Minimum 0Maximum 9007199254740991

Documentation