---
title: "BulkOperation"
description: "BulkOperation"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/javascript/reference/bulkoperation"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-06"
---

# BulkOperation

## BulkOperation

[Bulk operations](/docs/headless-cms/about-entries#bulk-operations-on-entries) such as Publish, Un-publish, and Delete on multiple entries or assets.

## publish

The Publish entries and assets in bulk request allows you to publish multiple entries and assets at the same time.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const publishDetails = {
  entries: [
    {
      uid: '{{entry_uid}}',
      content_type: '{{content_type_uid}}',
      version: '{{version}}',
      locale: '{{entry_locale}}'
    }
  ],
  assets: [{
    uid: '{{uid}}'
  }],
  locales: [
    'en'
  ],
  environments: [
    '{{env_uid}}'
  ]
}
client.stack({ api_key: 'api_key'}).bulkOperation().publish({ details:  publishDetails })
.then((response) => {  console.log(response.notice) })
// For Nested bulk publish pass api_version param with value 3.2
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const publishDetails = {
  environments:["{{env_uid}}","{{env_uid}}"],
  locales:["en-us"],
  entries:[
    {
      _content_type_uid: '{{content_type_uid}}',
      uid: '{{entry_uid}}'
    },
    {
      _content_type_uid: '{{content_type_uid}}',
      uid: '{{entry_uid}}'
    },
    {
      _content_type_uid: '{{content_type_uid}}',
      uid: '{{entry_uid}}'
    }
  ]
}
client
  .stack({ api_key: 'api_key'})
  .bulkOperation().publish({ 
     details:  publishDetails, 
     api_version: 3.2 
  })
  .then((response) => {  console.log(response.notice) })
```

Set this with details containing 'entries', 'assets', 'locales', and 'environments' to which you want to publish the entries or assets. If you do not specify a source locale, the entries or assets will be published in the master locale automatically.

Set this to 'true' to publish the entries that are at a workflow stage where they satisfy the applied publish rules.

Set this to 'true' to publish the entries that do not require an approval to be published.

## unpublish

The Unpublish entries and assets in bulk request allows you to unpublish multiple entries and assets at the same time.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const publishDetails = {
  entries: [
    {
      uid: '{{entry_uid}}',
      content_type: '{{content_type_uid}}',
      version: '{{version}}',
      locale: '{{entry_locale}}'
    }
  ],
  assets: [{
    uid: '{{uid}}'
  }],
  locales: [
    'en'
  ],
  environments: [
    '{{env_uid}}'
  ]
}
client.stack({ api_key: 'api_key'}).bulkOperation().unpublish({ details:  publishDetails })
.then((response) => {  console.log(response.notice) })
// Bulk nested publish
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const publishDetails = {
environments:["{{env_uid}}","{{env_uid}}"],
locales:["en-us"],
items:[
{
  _content_type_uid: '{{content_type_uid}}',
  uid: '{{entry_uid}}'
},
{
  _content_type_uid: '{{content_type_uid}}',
  uid: '{{entry_uid}}'
},
{
  _content_type_uid: '{{content_type_uid}}',
  uid: '{{entry_uid}}'
}
]
}
client.stack({ api_key: 'api_key'}).bulkOperation().unpublish({ details:  publishDetails, is_nested: true })
.then((response) => {  console.log(response.notice) })
```

Set this with details containing 'entries', 'assets', 'locales', and 'environments' to which you want to unpublish the entries or assets. If you do not specify a source locale, the entries or assets will be unpublished in the master locale automatically.

Set this to 'true' to un-publish the entries that are at a workflow stage where they satisfy the applied un-publish rules.

Set this to 'true' to un-publish the entries that do not require an approval to be published.

## delete

The Delete entries and assets in bulk request allows you to delete multiple entries and assets at the same time.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const publishDetails = {
  entries: [
    {
      uid: '{{entry_uid}}',
      content_type: '{{content_type_uid}}',
      locale: '{{entry_locale}}'
    }
  ],
  assets: [{
    uid: '{{uid}}'
  }]
}

client.stack({ api_key: 'api_key'}).bulkOperation().delete({ details:  publishDetails })
.then((response) => {  console.log(response.notice) })
```

Set this with details specifing the content type UIDs, entry UIDs or asset UIDs, and locales of which the entries or assets you want to delete.

## addItems

The addItems method allows you to add multiple items to a release in bulk.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const itemsData = {
  items: [
    {
      uid: 'entry_uid',
      content_type: 'content_type_uid'
    }
  ]
}
client.stack({ api_key: 'api_key'}).bulkOperation().addItems({ data: itemsData })
  .then((response) => { console.log(response) })
```

The data containing the items to be added.

The bulk operation version . (2.0)

## updateItems

The updateItems method allows you to update multiple items in a release in bulk.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const itemsData = {
  items: [
    {
      uid: 'entry_uid',
      content_type: 'content_type_uid'
    }
  ]
  or 
  [ '$all' ]
}
client.stack({ api_key: 'api_key'}).bulkOperation().updateItems({ data: itemsData })
  .then((response) => { console.log(response) })
```

The data containing the items to be added.

The bulk operation version . (2.0)

## jobStatus

The jobStatus method allows you to check the status of a bulk job.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).bulkOperation().jobStatus({ job_id: 'job_id' })
  .then((response) => { console.log(response) })
```

The bulk job's UID

The bulk operation version . (2.0)

## BulkOperation | JavaScript Management SDK | Contentstack

BulkOperation lets you publish, unpublish, and delete multiple entries or assets in a single request in the JavaScript Management SDK.