---
title: "GET metadata for files by collection or bundle ID"
method: GET
path: "/files"
tags: ["Fetch files from collection or bundle"]
---

# GET metadata for files by collection or bundle ID

`GET /files`

## Request

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

## Query parameters

- `collection_id` string
- `bundle_id` string

## Response `200`

Collection of file metadata

- MetaDataCollection: Collection of File metadata
  - `count` integer: Number of items returned
  - `limit` integer: Number of items requested
  - `offset` integer: Start point
  - `total_count` integer: total number of items available
  - `items` 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`: Authorisation 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)
