---
title: "Add a dataset item to a bundle"
method: POST
path: "/bundles/{id}/contents"
tags: ["Private"]
---

# Add a dataset item to a bundle

`POST /bundles/{id}/contents`

## Request

- Base URL: `/v1` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/v1/bundles/{id}/contents`
- Auth: API key in header `Authorization`

Adds the dataset item to the list of items to be published as part of the bundle

## Request body

- ContentItem: A model which holds information about the datasets to be published as part of the bundle
  - `bundle_id` string: The ID of the bundle the content item is associated with.
  - `content_type` 'DATASET', required: The type of content the item is.
  - `metadata` object, required: The metadata for the content item.
    - `dataset_id` string: The dataset ID of the item in the bundle
    - `edition_id` string: The edition ID of the dataset item in the bundle
    - `title` string: The title of the dataset item. Pre-release, this field will be hydrated from the dataset API when requested. Post-release, the bundle API will store a snapshot of the dataset metadata to be returned on subsequent requests.
    - `version_id` integer: The version ID of the dataset item in the bundle
  - `id` string: An auto generated ID field to identify the item
  - `state` 'APPROVED' | 'PUBLISHED': The approval status of the item. Pre-release, this field will be hydrated from the dataset API when requested. Post-release, the bundle API will store a snapshot of the dataset metadata to be returned on subsequent requests.
  - `links` object: Navigational links for onward actions related to the content item.
    - `edit` string, url: The URL to the admin page to make changes to the content item.
    - `preview` string, url: The URL to the preview page for the content item.

## Response `201`

Content was added

- ContentItem: A model which holds information about the datasets to be published as part of the bundle
  - `bundle_id` string: The ID of the bundle the content item is associated with.
  - `content_type` 'DATASET', required: The type of content the item is.
  - `metadata` object, required: The metadata for the content item.
    - `dataset_id` string: The dataset ID of the item in the bundle
    - `edition_id` string: The edition ID of the dataset item in the bundle
    - `title` string: The title of the dataset item. Pre-release, this field will be hydrated from the dataset API when requested. Post-release, the bundle API will store a snapshot of the dataset metadata to be returned on subsequent requests.
    - `version_id` integer: The version ID of the dataset item in the bundle
  - `id` string: An auto generated ID field to identify the item
  - `state` 'APPROVED' | 'PUBLISHED': The approval status of the item. Pre-release, this field will be hydrated from the dataset API when requested. Post-release, the bundle API will store a snapshot of the dataset metadata to be returned on subsequent requests.
  - `links` object: Navigational links for onward actions related to the content item.
    - `edit` string, url: The URL to the admin page to make changes to the content item.
    - `preview` string, url: The URL to the preview page for the content item.

## Other responses

- `400`: Unable to process request due to a malformed or invalid request body or query parameter.
- `401`: Authentication information is missing or invalid.
- `403`: Access denied.
- `404`: The requested resource does not exist.
- `409`: Change rejected due to a conflict with the current resource state. A common cause is attempting to change a bundle that is already locked pending publication or has already been published.
- `500`: Failed to process the request due to an internal error.

## Changes

> 31 revisions in range; 2 not diffed.

- **2025-06-12** `5ac41686b046`: 1 info
  - added the non-success response with the status `409`
- **2025-04-30** `ef2686afc3f9`: 1 info
  - added the non-success response with the status `404`

[Operation history](https://skmtc.dev/office-of-national-statistics/apis/bundle-administration/changes/bundles/:id/contents/post.md)

---

[API](https://skmtc.dev/office-of-national-statistics/apis/bundle-administration.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/bundle-administration/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/bundle-administration/revisions/4ac833f533b1?raw)
