> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Dataset 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.

For example, if an edit operation changes the name of a column, subsequent edit operations in
the same request should reference the column using its original name.

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.



## OpenAPI

````yaml https://api.galileo.ai/public/v2/openapi.json patch /v2/datasets/{dataset_id}/content
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.galileo.ai
    description: Galileo Public APIs - galileo-v2
security: []
paths:
  /v2/datasets/{dataset_id}/content:
    patch:
      tags:
        - datasets
      summary: Update Dataset Content
      description: >-
        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.


        For example, if an edit operation changes the name of a column,
        subsequent edit operations in

        the same request should reference the column using its original name.


        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.
      operationId: update_dataset_content_v2_datasets__dataset_id__content_patch
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Dataset Id
        - name: If-Match
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: ETag of the dataset as a version identifier.
            title: If-Match
          description: ETag of the dataset as a version identifier.
          example: d89cce33-549d-4b6d-b220-afb641d859c8
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDatasetContentRequest'
      responses:
        '204':
          description: Dataset content updated successfully
          headers:
            ETag:
              description: New version identifier for the dataset
              schema:
                type: string
        '404':
          description: Dataset not found
        '412':
          description: >-
            ETag mismatch; client's If-Match does not match current resource
            version
        '422':
          description: Validation error in request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '423':
          description: >-
            Resource lock could not be acquired; another update may be in
            progress
      security:
        - APIKeyHeader: []
        - OAuth2PasswordBearer: []
        - HTTPBasic: []
components:
  schemas:
    UpdateDatasetContentRequest:
      properties:
        edits:
          items:
            oneOf:
              - $ref: '#/components/schemas/DatasetPrependRow'
              - $ref: '#/components/schemas/DatasetAppendRow'
              - $ref: '#/components/schemas/DatasetUpdateRow'
              - $ref: '#/components/schemas/DatasetDeleteRow'
              - $ref: '#/components/schemas/DatasetFilterRows'
              - $ref: '#/components/schemas/DatasetCopyRecordData'
            discriminator:
              propertyName: edit_type
              mapping:
                append_row:
                  $ref: '#/components/schemas/DatasetAppendRow'
                copy_record_data:
                  $ref: '#/components/schemas/DatasetCopyRecordData'
                delete_row:
                  $ref: '#/components/schemas/DatasetDeleteRow'
                filter_rows:
                  $ref: '#/components/schemas/DatasetFilterRows'
                prepend_row:
                  $ref: '#/components/schemas/DatasetPrependRow'
                update_row:
                  $ref: '#/components/schemas/DatasetUpdateRow'
          type: array
          minItems: 1
          title: Edits
          error: Edits list cannot be empty.
      type: object
      required:
        - edits
      title: UpdateDatasetContentRequest
      description: >-
        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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DatasetPrependRow:
      properties:
        edit_type:
          type: string
          const: prepend_row
          title: Edit Type
          default: prepend_row
        values:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - additionalProperties:
                  anyOf:
                    - type: string
                    - type: integer
                    - type: number
                    - type: 'null'
                type: object
              - type: 'null'
          type: object
          title: Values
        row_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Row Id
      type: object
      required:
        - values
      title: DatasetPrependRow
    DatasetAppendRow:
      properties:
        edit_type:
          type: string
          const: append_row
          title: Edit Type
          default: append_row
        values:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - additionalProperties:
                  anyOf:
                    - type: string
                    - type: integer
                    - type: number
                    - type: 'null'
                type: object
              - type: 'null'
          type: object
          title: Values
        row_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Row Id
      type: object
      required:
        - values
      title: DatasetAppendRow
    DatasetUpdateRow:
      properties:
        row_id:
          type: string
          format: uuid4
          title: Row Id
        edit_type:
          type: string
          const: update_row
          title: Edit Type
          default: update_row
        values:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - additionalProperties:
                  anyOf:
                    - type: string
                    - type: integer
                    - type: number
                    - type: 'null'
                type: object
              - type: 'null'
          type: object
          title: Values
      type: object
      required:
        - row_id
        - values
      title: DatasetUpdateRow
    DatasetDeleteRow:
      properties:
        row_id:
          type: string
          format: uuid4
          title: Row Id
        edit_type:
          type: string
          const: delete_row
          title: Edit Type
          default: delete_row
      type: object
      required:
        - row_id
      title: DatasetDeleteRow
    DatasetFilterRows:
      properties:
        edit_type:
          type: string
          const: filter_rows
          title: Edit Type
          default: filter_rows
        row_ids:
          items:
            type: string
            format: uuid4
          type: array
          minItems: 1
          title: Row Ids
      type: object
      required:
        - row_ids
      title: DatasetFilterRows
      description: This global operation filters a set of rows and discard the rest.
    DatasetCopyRecordData:
      properties:
        edit_type:
          type: string
          const: copy_record_data
          title: Edit Type
          default: copy_record_data
        project_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Project Id
        queue_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Queue Id
        ids:
          items:
            type: string
            format: uuid4
          type: array
          title: Ids
          description: List of trace or span IDs to copy data from
        prepend:
          type: boolean
          title: Prepend
          description: A flag to control appending vs prepending
          default: true
        use_generated_output_column:
          type: boolean
          title: Use Generated Output Column
          description: >-
            If True, write trace output to generated_output column; if False,
            write to output column (backward compatible)
          default: false
      type: object
      required:
        - ids
      title: DatasetCopyRecordData
      description: Prepend or append trace or span data to dataset.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Galileo-API-Key
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: https://api.galileo.ai/login
    HTTPBasic:
      type: http
      scheme: basic

````