## Update a dataset item

**patch** `/v5/dataset-items/{dataset_item_id}`

Update the data payload and optional file associations of a dataset item.

The request replaces the item's data in full and, if provided, its file associations; there is no
partial-field merge. Data keys may not collide with reserved dataset- or evaluation-item field
names, and any referenced files must exist and be a supported media format. Items that are
archived or soft-deleted cannot be updated. The update is applied as a new dataset version rather
than overwriting the previous record, so prior versions remain retrievable.

### Path Parameters

- `dataset_item_id: string`

### Body Parameters

- `data: map[unknown]`

  Updated dataset item data

- `files: optional map[string]`

  Files to be associated to the dataset

### Returns

- `DatasetItem object { id, content_hash, created_at, 7 more }`

  - `id: string`

    The unique identifier of the entity.

  - `content_hash: string`

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" or "service_account"`

      - `"user"`

      - `"service_account"`

    - `object: optional "identity"`

      - `"identity"`

  - `data: map[unknown]`

  - `updated_at: string`

    The date and time when the entity was last updated in ISO format.

  - `archived_at: optional string`

    The date and time when the entity was archived in ISO format.

  - `dataset_id: optional string`

  - `files: optional map[string]`

  - `object: optional "dataset.item"`

    - `"dataset.item"`

### Example

```http
curl https://api.egp.scale.com/v5/dataset-items/$DATASET_ITEM_ID \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $SGP_API_KEY" \
    -d '{
          "data": {
            "foo": "bar"
          }
        }'
```

#### Response

```json
{
  "id": "id",
  "content_hash": "content_hash",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "data": {
    "foo": "bar"
  },
  "updated_at": "2019-12-27T18:11:19.117Z",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "dataset_id": "dataset_id",
  "files": {
    "foo": "string"
  },
  "object": "dataset.item"
}
```
