---
title: "Add assets to a bundle"
method: POST
path: "/api/v1/bundles/assets"
tags: ["Publishing"]
---

# Add assets to a bundle

`POST /api/v1/bundles/assets`

## Request

- Base URL: `https://docs.anzworldline-solutions.com.au`
- URL: `https://docs.anzworldline-solutions.com.au/api/v1/bundles/assets`
- Auth: none declared
- TypeScript: <https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/docs/api/v1/bundles/assets/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds assets to an existing bundle or creates a new bundle. Bundle resolution: (1) look up by bundleId, (2) if not found, look up unsent bundles by bundleName, (3) if still not found, auto-create a new bundle. A non-matching bundleId does NOT return 404 — it falls through to name lookup and then auto-creation. Assets already in the bundle are silently skipped (idempotent). Individual asset failures (e.g., no publish permission) are reported in the errors list as human-readable strings, not as HTTP errors.

## Request body

- AddAssetsToBundleForm: Form for adding assets to a bundle
  - `bundleId` string: Optional bundle ID. If provided and found, assets are added to this bundle. If not found, falls through to bundleName lookup, then auto-creation — does NOT return 404
  - `bundleName` string: Optional bundle name. Used as fallback when bundleId is not provided or not found. Searches unsent bundles by name (case-insensitive). If no match, a new bundle is created with this name
  - `assetIds` string[], required: List of asset identifiers to add to the bundle

## Response `200`

Assets processed (check errors list for per-asset failures)

- ResponseEntityAddAssetsToBundleView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` AddAssetsToBundleView
    - `bundleId` string, required: Bundle identifier (new or existing)
    - `bundleName` string: Name of the bundle
    - `created` boolean, required: Whether a new bundle was created by this call
    - `total` integer, required: Total non-duplicate assets processed (subtract errors count for successful adds). Assets already in the bundle are skipped and excluded from this count.
    - `errors` string[], required: Per-asset error messages as human-readable strings. Empty list = all assets added successfully
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400`: Invalid request (e.g., empty assetIds)
- `401`: Unauthorized - authentication required
- `403`: Forbidden - insufficient permissions
- `404`: bundleId provided but not found and no bundleName fallback
- `409`: Cannot add assets while bundle is in BUNDLING, SENDING_TO_ENDPOINTS, or PUBLISHING_BUNDLE status
- `500`: Internal server error

## Changes

- **2026-10-30** `4fd8e917d458`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/changes/api/v1/bundles/assets/post.md)

---

[API](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api.md) - [All operations](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/revisions/4fd8e917d458?raw)
