Skip to main content
The SDKs, the CLI and the MCP server list, create, read, update and delete datasets and their records. Every call needs a LangWatch API key.

Setup

If you are using a service API key (e.g. for CI/CD or multi-project setups), you must also set the LANGWATCH_PROJECT_ID environment variable so the SDK knows which project to access. You can find the project ID in your project settings.

List Datasets

Retrieve all datasets for your project with pagination support.

Create a Dataset

Create a new dataset with an optional column schema.

Get a Dataset

Fetch a dataset by slug or ID, including all its entries.

Update a Dataset

Update a dataset’s name or column types.

Delete a Dataset

Archive a dataset by slug or ID.

List Records

Retrieve records from a dataset with pagination.

Create Records

Batch-add records to an existing dataset.

Update a Record

Update (or upsert) a single record by ID.

Delete Records

Batch-delete records by their IDs.

Upload a File

Upload a CSV, JSON, or JSONL file to a dataset. If the dataset does not exist, it is created automatically.
The if_exists parameter controls how conflicts are handled:

Using with Evaluations

Datasets are commonly used to run offline evaluations against your LLM or agent.

Dataset Entry Structure

Each dataset entry contains: Which fields you get back depends on the operation. list_records returns all six. create_records returns id, entry and createdAt. In Python, get_dataset returns entries with id and entry only.

Typed Datasets (TypeScript)

You can define types for your dataset entries for better type safety:

CLI

The langwatch CLI has the same operations. Set LANGWATCH_API_KEY and run:
A service API key also needs LANGWATCH_PROJECT_ID, so the CLI knows which project to use. A project API key from the project settings page already carries the project. --if-exists takes append (default), replace or error. records add reads a JSON array from --json, --file or --stdin. Every command accepts --format json for machine-readable output.

MCP Tools (AI Coding Agents)

If you’re using an AI coding agent (Claude Code, Cursor, etc.) with the LangWatch MCP server, dataset tools are available directly: The platform_list_datasets, platform_get_dataset and platform_list_dataset_records tools support a format parameter, use "json" for raw data or "digest" (default) for AI-readable markdown.

Finding Your Dataset Slug or ID

Every call accepts the dataset slug or its ID.
  1. Go to the Datasets page and click your dataset.
  2. The URL reads app.langwatch.ai/{project}/datasets/{id}; the ID starts with dataset_.
  3. The slug is shown under the Name field when you open Edit columns, and in the slug field of every SDK and CLI response.
Last modified on September 6, 2026