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.
Update a dataset by its slug or id
Update a dataset by its slug or id. New columnTypes re-key every record; send columnRenames to say which existing column each renamed column came from, so a save that deletes one column and renames another moves the right values.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
Which existing column each renamed column came from, as `{ from, to }` names. Sent, values move by these renames and by unchanged names only. Omitted, columns left over after matching names pair by position.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/dataset/<slugOrId>"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.patch( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/dataset/<slugOrId>";const response = await fetch(url, { method: "PATCH", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request PATCH \ --url 'https://app.langwatch.ai/api/v1/dataset/<slugOrId>' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project.Request: PATCH https://app.langwatch.ai/api/v1/dataset/<slugOrId>Reference: https://langwatch.ai/docs/api-reference/datasets/update-dataset.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.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", "platformUrl": "string"}Path parameters
slugOrIdstringrequiredRequest body
application/json
namestringcolumnTypesobject[]columnRenamesobject[]Which existing column each renamed column came from, as { from, to } names. Sent, values move by these renames and by unchanged names only. Omitted, columns left over after matching names pair by position.
Responses
200Success
application/json
idstringrequirednamestringrequiredslugstringrequiredcolumnTypesobject[]requiredcreatedAtstring (date-time)requiredupdatedAtstring (date-time)requiredplatformUrlstringrequiredRenaming a dataset keeps its slug, so the old slug still resolves. A new name whose slug another dataset in the project already holds is refused with 409.
New columnTypes re-key every record. To rename a column in the same request
that deletes another, send columnRenames with { from, to } for each renamed
column, so each value stays with the column it came from. Without it, columns
left over after matching names pair by position.