---
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`

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.

---

[API](https://skmtc.net/office-of-national-statistics/apis/bundle-administration.md) · [All operations](https://skmtc.net/office-of-national-statistics/apis/bundle-administration/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/office-of-national-statistics/bundle-administration/revisions/4ac833f533b1/schema)
