Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [v1.30.2](https://github.com/contentstack/contentstack-management-javascript/tree/v1.30.2) (2026-04-22)

- Update dependencies

## [v1.30.1](https://github.com/contentstack/contentstack-management-javascript/tree/v1.30.1) (2026-04-14)

- Enh
Expand Down
46 changes: 46 additions & 0 deletions lib/stack/taxonomy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,52 @@ export function Taxonomy (http, data = {}) {
throw error(err)
}
}

/**
* @description The Unpublish taxonomy call initiates a job to unpublish a taxonomy and/or specific terms from the specified environments and locales.
* @memberof Taxonomy
* @func unpublish
* @param {Object} data - Unpublish details (same shape as publish: locales, environments, items, etc.)
* @param {string} [api_version=''] - Optional API version (e.g., '3.2')
* @param {Object=} params - Optional query parameters. If params.branch is set, it is sent as the branch request header.
* @returns {Promise<Object>} Response object with unpublish job details
* @example
* import * as contentstack from '@contentstack/management'
* const client = contentstack.client()
*
* const unpublishData = {
* locales: ["en-us"],
* environments: ["development"],
* items: [
* { uid: "taxonomy_testing" }
* ]
* }
* client.stack({ api_key: 'api_key'}).taxonomy().unpublish(unpublishData, '3.2')
* .then((response) => console.log(response))
*/
this.unpublish = async function (data, api_version = '', params = {}) {
try {
const { branch, ...queryParams } = params
const headers = {
headers: { ...cloneDeep(this.stackHeaders) },
params: queryParams
}
if (api_version) {
headers.headers.api_version = api_version
}
if (branch) {
headers.headers.branch = branch
}
const response = await http.post(`${this.urlPath}/unpublish`, data, headers)
if (response.data) {
return response.data
} else {
throw error(response)
}
} catch (err) {
throw error(err)
}
}
}
bindModuleHeaders(this)
}
Expand Down
Loading
Loading