---
title: "Update Dataset Content"
method: PATCH
path: "/public/v2/datasets/{dataset_id}/content"
tags: ["datasets"]
---

# Update Dataset Content

`PATCH /public/v2/datasets/{dataset_id}/content`

Update the content of a dataset.

The `index` and `column_name` fields are treated as keys tied to a specific version of the dataset.
As such, these values are considered immutable identifiers for the dataset's structure.

Edits are applied sequentially in list order, and each edit sees the table state left by the
previous one. For example, after a `rename_column` edit renames `col_a` to `col_b`, any
subsequent `update_row` in the same request must reference the column as `col_b`, not `col_a`.

The `If-Match` header is used to ensure that updates are only applied if the client's version of the dataset
matches the server's version. This prevents conflicts from simultaneous updates. The `ETag` header in the response
provides the new version identifier after a successful update.

## Path parameters

- `dataset_id` string, uuid4, required

## Headers

- `If-Match` string, nullable — ETag of the dataset as a version identifier.

## Request body

- UpdateDatasetContentRequest — This structure represent the valid edits operations that can be performed on a dataset. There edit operations are: - Row edits: These edits are performed on a specific row of the dataset. - EditMode.id: The edit is performed on the index (numeric index). DEPRECATED - EditMode.row_id: The edit is performed on the row_id of the row. - Global edits: These edits are performed on the entire dataset and should not be mixed with row edits. - EditMode.global_edit
  - `edits` union[], required
    - union
      - DatasetPrependRow
        - `edit_type` 'prepend_row'
        - `values` object, required
        - `row_id` string, uuid4, nullable
      - DatasetAppendRow
        - `edit_type` 'append_row'
        - `values` object, required
        - `row_id` string, uuid4, nullable
      - DatasetUpdateRow
        - `row_id` string, uuid4, required
        - `edit_type` 'update_row'
        - `values` object, required
      - DatasetDeleteRow
        - `row_id` string, uuid4, required
        - `edit_type` 'delete_row'
      - DatasetFilterRows — This global operation filters a set of rows and discard the rest.
        - `edit_type` 'filter_rows'
        - `row_ids` string[], required
      - DatasetCopyRecordData — Prepend or append trace or span data to dataset.
        - `edit_type` 'copy_record_data'
        - `project_id` string, uuid4, nullable
        - `queue_id` string, uuid4, nullable
        - `ids` string[], required — List of trace or span IDs to copy data from
        - `prepend` boolean — A flag to control appending vs prepending
        - `use_generated_output_column` boolean — If True, write trace output to generated_output column; if False, write to output column (backward compatible)
      - DatasetRemoveColumn — Drop a column from the dataset schema.
        - `edit_type` 'remove_column'
        - `column_name` string, required
      - DatasetRenameColumn — Rename a column in the dataset schema, preserving values.
        - `edit_type` 'rename_column'
        - `column_name` string, required
        - `new_column_name` string, required

## Response `204`

Dataset content updated successfully

## Other responses

- `404` — Dataset not found
- `412` — ETag mismatch; client's If-Match does not match current resource version
- `422` — Validation error in request body
- `423` — Resource lock could not be acquired; another update may be in progress

---

[API](https://skmtc.net/galileo/apis/galileo-api-server.md) · [All operations](https://skmtc.net/galileo/apis/galileo-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/galileo/galileo-api-server/versions/933e8c8e6366/schema)
