datasets

Update a dataset.

Only the fields in the request change; omitted fields keep their value. Setting a schema or transformations checks every existing example against the result. Returns 400, leaving the dataset unchanged, if an example does not match, the dataset is not a key-value dataset, or a transformation points into inputs or outputs that have no schema. The X-Updated-Examples-Count response header holds the number of examples changed through patch_examples. Returns 404 if the dataset does not exist and 409 if the new name is already used.

patch/api/v1/datasets/{dataset_id}

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v1/datasets/{dataset_id}
  • Auth
    • API key in header X-API-Key
    • or API key in header X-Tenant-Id
    • or HTTP bearer

Path parameters

dataset_idstring uuid required

Request body

patch_examplesobject nullable

Example updates keyed by example ID, applied in the same transaction so existing examples can be fixed to match a new schema. Only used when the request also sets inputs_schema_definition, outputs_schema_definition, or transformations and the dataset ends up with at least one schema; otherwise it is ignored. Each update replaces the inputs, outputs, metadata, or split it sets and keeps the rest; attachment operations are ignored. An ID that is not an example in this dataset returns 404.

Response

Dataset updated successfully

namestring required
descriptionstring nullable
created_atstring date-time
inputs_schema_definitionobject nullable
outputs_schema_definitionobject nullable
externally_managedboolean nullable
data_type'kv' | 'llm' | 'chat'

Enum for dataset data types.

idstring uuid required
tenant_idstring uuid required

Changes

    • breaking

      the / response's property type changed from object to string for status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status