---
title: "Updates the content_item information for a file's metadata"
method: PUT
path: "/files/{path}"
tags: ["Update file metadata content_item"]
---

# Updates the content_item information for a file's metadata

`PUT /files/{path}`

## Request

- Base URL: `http://localhost:26900`
- URL: `http://localhost:26900/files/{path}`
- Auth: API key in header `Authorization`

## Path parameters

- `path` string, required

## Request body

- ContentItemChange: Wrapper payload used by PUT /files/{path} to update content item
  - `content_item` ContentItemUpdate: Content item information to update for a file's metadata
    - `dataset_id` string: The dataset ID
    - `edition` string: The edition
    - `version` string: The version

## Response `200`

File metadata

- MetaData: File metadata
  - `path` string: Path to file
  - `is_publishable` boolean: Is the file publishable
  - `collection_id` string: The collection ID to which the file is attached
  - `bundle_id` string: The bundle ID to which the file is attached
  - `title` string: The title given to the file
  - `size_in_bytes` integer: Size of the file in bytes
  - `type` string: The file type
  - `licence` string: The type of licence the file has
  - `licence_url` string: Licence URL
  - `etag` string: File etag
  - `state` string: File state
  - `content_item` object: Dataset information that the file relates to
    - `dataset_id` string: The dataset ID
    - `edition` string: The edition
    - `version` string: The version

## Other responses

- `400`: Request could not be processed
- `401`: Authentication information is missing or invalid.
- `403`: Authorization Failed - Check logs
- `404`: The requested resource does not exist.
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/files-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/files-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/files-api/revisions/b34c9662a495?raw)
