---
title: "Contentstack Management Java SDK"
description: "Documentation for Java Management SDK"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/java/reference"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2025-11-03"
---

# Contentstack Management Java SDK

## Contentstack - Java Management SDK

## Java Management SDK for Contentstack

Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. All you have to do is build your application frontend, and Contentstack will take care of the rest.

This SDK uses the Content Management API (CMA). The CMA is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account. To use the CMA, you will need to authenticate your users with a Management Token or an Authtoken. Read more about it in Authentication.

**Note:** By using CMA, you can execute GET requests for fetching content. However, we strongly recommend that you always use the Content Delivery API to deliver content to your web or mobile properties.

## Prerequisite

You need Java JDK 8 version or above installed on your machine to use the Contentstack Java CMS SDK.

## Setup and Installation

**Install it via maven:**

<dependency>  
<groupId>com.contentstack.sdk<groupId>  
<artifactId>cms<artifactId>  
<version>{version}<version>  
<dependency>

**Install it via Gradle:**

implementation 'com.contentstack.sdk:cms:{version}'

## Quickstart in 5 mins

## Initialising The SDK

To use the Java CMA SDK, you need to first initialize it. To do this, use the following code:

import com.contentstack.cms.Contentstack;  
Contentstack contentstack = new Contentstack.Builder().build();

## Authentication

To use this SDK, you need to authenticate your users using the Authtoken, credentials, or Management Token (stack-level token).  

**Login**

To Login to Contentstack by using credentials, you can use the following lines of code:

import contentstack  
  
Contentstack contentstack = new Contentstack.Builder().build();  
contentstack.login("EMAIL","PASSWORD");

**Authtoken**

An Authtoken is a read-write token used to make authorized CMA requests and a user-specific token.

import contentstack  
Contentstack contentstack = new Contentstack.Builder().setAuthtoken("AUTHTOKEN").build();

**Management Token**

Management Tokens are stack-level tokens, with no users attached to them.

import com.contentstack.cms.Contentstack;  
Contentstack contentstack = new Contentstack.Builder().build();  
Stack stack = contentstack.stack("API\_KEY","MANAGEMENT\_TOKEN");

## Fetch Stack Detail

Use the following lines of code to fetch your stack detail using this SDK:

import com.contentstack.cms.Contentstack;  
  
Contentstack contentstack = new Contentstack.Builder().setAuthtoken("AUTHTOKEN").build();  
Response&lt;ResponseBody&gt; response = contentstack.stack("API\_KEY").fetch().execute();

## Create Entry

To create an entry in a specific content type of a stack, use the following lines of code:

package com.contentstack.cms.stack;  
  
import com.contentstack.cms.Contentstack;  
  
Contentstack contentstack = new Contentstack.Builder().setAuthtoken("AUTHTOKEN").build();  
Stack stack = contentstack.stack("API\_KEY");  
// \[Create JSONObject Request body to upload\]  
JSONObject jsonBody = new JSONObject()  
jsonBody.put("key","value");  
  
// \[Add Query parameters to the entry\]  
entry.addParam("locale","en-us");  
Response&lt;ResponseBody&gt; response = entry.create(jsonBody).execute();  
if(response.isSuccessful()){  
 System.out.println(response.body());}  
else{  
 System.out.println(response.errorBody());  
}

## Create Asset

The following lines of code can be used to upload assets to your stack:

package com.contentstack.cms.stack;  
import com.contentstack.cms.Contentstack;  
  
Contentstack contentstack = new Contentstack.Builder().setAuthtoken("AUTHTOKEN").build();  
Asset asset = contentstack.stack("API\_KEY").asset();  
Response ResponseBody response = asset.uploadAsset("file/path/from/local", "description").execute();  
if(response.isSuccessful()){  
  System.out.println(response.body());  
}else{  
  System.out.println(response.errorBody());  
}

## Contentstack

Java Management SDK Interact with the Content Management APIs and allow you to create, update, delete, and fetch content from your Contentstack account.

## organisation

The organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users. The organization allows easy management of projects as well as users within the Organization.

## user

All accounts registered with Contentstack are known as Users. A stack can have many users with varying permissions and roles

## stack

A [Stack](https://www.contentstack.com/docs/developers/apis/content-management-api/#stacks) is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.

The apiKey for the stack

The authorization for the stack

The branch that include branching in the response

## login

Before executing any calls, retrieve the authtoken by authenticating yourself via the login call of User Session. The authtoken is returned to the 'Response' body of the login call and is mandatory in all the calls.

The email id of the user

The password of the contentstack user

The tfa token

## earlyAccess

With the earlyAccess header support, you can access features that are part of the early access program.

## setHost

The setHost method specifies the API endpoint for your Contentstack region. This method ensures that your requests are routed to the appropriate regional host enabling optimal performance and compliance with regional data policies.

For a complete list of supported regions and their base URLs, refer to the [Content Management API](/docs/developers/apis/content-management-api#base-url) documentation.

## User

All accounts registered with Contentstack are known as Users. A Stack can have many users with varying permissions and roles.

## activateAccount

The activate\_token a user account call activates the account of a user after signing up.

The activation token is received at the registered email address. You can find the activation token in the activation URL sent to the email address used while signing up.

The body.

## getUser

The "Get user" call returns comprehensive information about an existing user account. The information returned includes details of the stacks owned by and shared with the specified user account.

## login

The "login to your account" request is used to sign in to your Contentstack account and obtain the authtoken.

Email id for the user.

The password for the user.

The tfa token.

## logout

The "Log out of your account" call is used to sign out the user of the Contentstack account.

## logoutWithAuthtoken

The "Log out of your account" call is used to sign out the user of the Contentstack account.

The authtoken of the user.

## requestPassword

The "Request for a password" call requests a temporary password to log in to an account if a user has forgotten the login password.

Using this temporary password, you can log in to your account and set a new password for your Contentstack account.

Provide the user's email address in JSON format

The request body.

## resetPassword

The "Reset password" call sends a request for resetting the password of your Contentstack account.

When executing the call, in the 'Body' section, you need to provide the token that you receive via email, your new password, and password confirmation in JSON format.

The request body.

## update

The "Update User" API Request updates the details of an existing user account. Only the information entered here will be updated; the existing data will remain unaffected.

When executing the API call, under the 'Body' section, enter the user's information that you wish to update. This information should be in JSON format.

The request body.

## Alias

An alias acts as a pointer to a particular branch. You can specify the alias ID in your frontend code to pull content from the target branch associated with an alias.

## addHeader

Sets header for the request

Header key for the request.

Header value for the request.

## addParam

Sets params for the request.

Query parameter key for the request.

Query parameter value for the request.

## removeParam

Set header for the request.

Removes query parameter using a key of request.

## find

The "Get all aliases" request returns comprehensive information about all the aliases available in a particular stack in your account.

## fetch

The "Get a single alias" request returns information about a specific alias.

## update

The "Assign an alias" request creates a new alias in a particular stack of your organization. This alias can point to any existing branch (target branch) of your stack.

The request body to update the Alias.

## delete

The "Delete an alias" request deletes an existing alias.

To confirm the deletion of an alias, you need to specify the force=true query parameter.

When executing the API call, in the “URL Parameters” section, provide the UID of your alias.

## Asset

Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use.

## uploadAsset

The "Upload asset" request uploads an asset file to your stack.

To upload assets from your local system to Contentstack and manage their details, you need to use the following "form-data" parameters:

The file path.

The description of the asset file.

Select the input type as 'File.' Then, browse and select the asset file that you want to import.

If needed, assign a parent folder to your asset by passing the UID of the parent folder.

Enter a title for your uploaded asset.

Assign a specific tag(s) to your uploaded asset.

Set this to 'true' to display the relative URL of the asset.

Set this to 'true' to include the dimensions (height and width) of the image in the response.

## updateDetails​

The "Update asset revision" call upgrades a specified version of an asset as the latest version of that asset.

JSON Request body.

## unpublish

Unpublish an asset call is used to unpublish a specific version of an asset from a desired environment.

In the case of Scheduled Unpublished, add the scheduled\_at key and provide the date/time in the ISO format as its value. Example: "scheduled\_at":"2016-10-07T12:34:36.000Z"

JSON Request body.

## subfolder

The "Get assets and folders of a parent folder" retrieves details of assets and asset subfolders within a specific parent asset folder.

Folder uid.

Provide true or false.

## setVersionName

The "Set version name for asset" request allows you to assign a name to a specific version of an asset.

Asset version number.

The request body of JSONObject.

## rteInformation

The "Get information on RTE assets" call returns comprehensive information on all assets uploaded through the Rich Text Editor field.

## replace

The Replace asset call will replace an existing asset with another file on the stack.

Tip: You can try the call manually in any REST API client, such as Postman. Under Body, pass a body parameter named asset\[upload\] and select the input type as 'File'. This will enable you to select the file that you wish to import. You can assign a parent folder to your asset by using the asset\[parent\_uid\] parameter, where you can pass the UID of the parent folder. Additionally, you can pass optional parameters such as asset\[title\] and asset\[description\] which let you enter a title and a description for the uploaded asset, respectively.

The file path.

The file description.

## getVersionNameDetails

The "Get details of all versions of an asset" request allows you to retrieve the details of all the versions of an asset.

The details returned include the actual version number of the asset; the version name along with details such as the assigned version name, the UID of the user who assigned the name, and the time when the version was assigned a name; and the count of the versions.

Enter the maximum number of version details to be returned.

Set to true if you want to retrieve only the named versions of your asset.

Enter 'true' to get the total count of the asset version details.

## getReferences

The "Get asset references" request returns the details of the entries and the content types in which the specified asset is referenced.

## publish

The "Publish an asset" call is used to publish a specific version of an asset on the desired environment either immediately or at a later date/time.

In case of Scheduled Publishing, add the scheduled\_at key and provide the date/time in the ISO format as its value. Example: "scheduled\_at":"2016-10-07T12:34:36.000Z"

JSON Request body.

## getPermanentUrl

The "Download an asset with a permanent URL" request displays an asset in the response. The asset returned to the response can be saved to your local storage system. Make sure to specify the unique identifier (slug) in the request URL.

This request will return the most recent version of the asset; however, to download the latest published version of the asset, pass the environment query parameter with the environment name.

The unique identifier of the asset.

## getByType

Based on the query request, "Get either images or videos" retrieves assets that are either image files or video files.

Asset type that you want to retrieve.

\- For images, "images"

\- For videos, "videos"

## generatePermanentUrl

Generate Permanent Asset URL request allows you to generate a permanent URL for an asset. This URL remains constant irrespective of any subsequent updates to the asset.

The JSONObject request body.

## folder

Get folder instance.

The UID of the folder that you want either to update or move.

## find

The "Get all assets" request returns comprehensive information on all assets available in a stack.

## fetch

The "Get an asset" call returns comprehensive information about a specific version of an asset of a stack

**Tip**: To include the publishing details in the response, use the include\_publish\_details parameter and set its value to ‘true'. This query will return the publishing details of the entry in every environment, along with the version number published in each environment.

## deleteVersionName

The "Delete Version Name of an Asset" request allows you to delete the name assigned to a specific version of an asset. This request resets the name of the asset version to the version number.

The asset version.

## delete

Delete asset call deletes an existing asset from the stack.

## byFolderUid

The "Get assets of a specific folder" retrieves all assets of a specific asset folder; however, it doesn't retrieve the details of sub-folders within it.

The folderUid of a specific folder.

## removeParam

Set header for the request.

Removes query parameter using a key of request.

## addParam

The addParam method adds a query parameter to the Asset request for filtering or configuring the response (e.g., locale, publish details).

Query parameter name sent with the request (for example, locale or include\_publish\_details). Set when building the request and applied to Asset methods such as find() and fetch().

Value assigned to the query parameter. Determines the behavior or filtering applied to the request (for example, "en-us" for locale, or true for include\_publish\_details).

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## fetchAsPojo

The fetchAsPojo method fetches a single asset by UID and deserializes it into a POJO.

## findAsPojo

The findAsPojo method fetches multiple assets and deserializes them into POJOs.

## byFolderUidAsPojo

The byFolderUidAsPojo method retrieves all assets of a specific asset folder; however, it doesn't retrieve the details of sub-folders within it.

## subfolderAsPojo

The subfolderAsPojo method retrieves details of assets and asset subfolders within a specific parent asset folder.

## getSingleFolderByNameAsPojo

The getSingleFolderByNameAsPojo method retrieves a folder by name and deserializes into POJOs.

## getSubfolderAsPojo

The getSubfolderAsPojo method fetches all subfolders.

## AuditLog

An audit log displays a record of all the activities performed in a stack and helps you track all published items, updates, deletes, and the current status of the existing content.

## find

The "Get audit log" request is used to retrieve the audit log of a stack.

## fetch

The "Get audit log item" request is used to retrieve a specific item from the audit log of a stack.

## removeParam

Set header for the request.

header key for the request

## addParam

Sets header for the request.

Header key for the request.

Header value for the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## Branch

Branches allow you to isolate and easily manage your “in-progress” work from your stable, live work in the production environment. It helps multiple development teams to work in parallel in a more collaborative, organized, and structured manner without impacting each other.

## create

The "Create a branch" request creates a new branch in a particular stack of your organization.

The request body.

## fetch

The "Get a single branch" request returns information about a specific branch.

## find

The "Get all branches" request returns comprehensive information about all the branches available in a particular stack in your account.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header key for the request.

Header key for the request.

Header value for the request.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## delete

The "Get assets and folders of a parent folder" retrieves details of both assets and asset subfolders within a specific parent asset folder.

## BulkOperation

Use the BulkOperation class to perform actions—such as publishing, unpublishing, deleting, or updating workflows—on multiple entries and assets in a single API request.

## create

The create method creates a new release in the stack.

The requestBody to create a release.

## unpublish

The unpublish method removes multiple entries and assets from specific environments and locales.

Data to unpublish multiple items

## delete

The delete method permanently deletes multiple entries or assets from your stack.

Data to delete multiple items from stack

## updateWorkflow

The updateWorkflow method updates the workflow stage for multiple entries in bulk.

The requestBody to update workflow

## addReleaseItems

The addReleaseItems method adds multiple entries or assets to a release in a single request.

Items to be added to the release

## updateReleaseItems

The updateReleaseItems method updates all items in a release to their latest saved versions.

Configuration to update release items

## jobStatus

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

UID of the bulk job

The bulk operation version (2.0)

## ContentType

The content type defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required first to create a content type and then create entries using the content type.

You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include\_branch query parameter to true to include the \_branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.

## referenceIncludeGlobalField

The "Get all references of content type" call will fetch all the content types in which a specified content type is referenced.

**Note**: You must use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication. You need to use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request

## importOverwrite

The "Import a content type" call imports a content type into a stack by uploading a JSON file.

## fieldVisibilityRule

The "Set Field Visibility Rule for Content Type API request" lets you add Field Visibility Rules to existing content types. These rules allow you to show and hide fields based on the state or value of certain fields.

The request body.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## entry

An entry is a content created using one of the defined content types.

The entry uid.

## create

The "Create a content type" call creates a new content type in a particular stack of your Contentstack account.

In the Body section, you need to provide the complete schema of the content type.

The request body.

## reference

The "Get all references of content type" call will fetch all the content types in which a specified content type is referenced.

**Note**: You must use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication. You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.

Include Global Field true/false

## imports

The "Import a content type" call imports a content type into a stack by uploading a JSON file.

## export

This call is used to export a specific content type and its schema. The data is exported in JSON format. However, please note that the entries of the specified content type are not exported through this call. The schema of the content type returned will depend on the version number provided.

**Note**: You must use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.

## find

The "Get all content types" call returns comprehensive information on all the content types available in a particular stack in your account.

**Note**: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.

## update

The "Update Content Type" call is used to update the schema of an existing content type.

**Note**: Whenever you update a content type, it will auto-increment the content type version.

The request body to update the Alias.

## fetch

The "Get a single content type" call returns information about a specific content type.

## delete

The "Delete Content Type" call deletes an existing content type and all the entries within it. When executing the API call, in the URI Parameters section, provide the UID of your content type.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## fetchAsPojo

The fetchAsPojo method fetches a single content type and deserializes the response into a POJO.

## findAsPojo

The findAsPojo method fetches a list of content types and deserializes them into POJOs.

## Entry

An entry is the actual piece of content created using one of the defined content types.

You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include\_branch query parameter to true to include the \_branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.

## versionName

Version naming allows you to assign a name to a version of an entry for easy identification.

Enter the version number of the entry to which you want to assign a name.

The request body in JSONObject format.

## unpublish

The "Unpublish an entry" call will unpublish an entry at once and allow you to do so automatically at a later date/time.

In the 'Body' section, you can specify the locales and environments from which you want to unpublish the entry. These details should be specified in the entry parameter. However, if you do not specify a locale, it will be unpublished from the master locale automatically.

You also need to mention the master locale and the version number of the entry that you want to publish.

In the case of Scheduled Unpublished, add the scheduled\_at key and provide the date/time in the ISO format as its value.

Example: "scheduled\_at":"2016-10-07T12:34:36.000Z"

The request body in JSONObject format.

## unlocalized

The "Unlocalize an entry request" is used to unlocalize an existing entry.

Enter the code of the language to localize the entry of that particular language.

## publishWithReference

The "Publishing an Entry With References" request allows you to publish an entry with all its references simultaneously.

The request body in JSONObject format.

## publish

The "Publish an entry" request lets you publish an entry either immediately or schedule it for a later date/time.

In the 'Body' section, you can specify the locales and environments to which you want to publish the entry. When you pass locales in the "Body", the following actions take place:

If you have not localized your entry in any of your stack locales, the Master Locale entry gets localized in those locales and is published

If you have localized any or all of your entries in these locales, the existing localized content of those locales will NOT be published. However, if you need to publish them all, you need to perform a Bulk Publish operation.

The locale and environment details should be specified in the entry parameter. However, if you do not specify any source locale(s), it will be published in the master locale automatically.

Along with the above details, you also need to mention the master locale and the version number of the entry that you want to publish.

In the "Body" parameter, you need to provide the content of your entry based on the content type.

## localize

The "Localize an entry" request allows you to localize an entry, i.e., the entry will cease to fetch data from its fallback language and possess independent content specific to the selected locale.

**Note**: This request will only create the localized version of your entry and not publish it. To publish your localized entry, you need to use the Publish an entry request and pass the respective locale code in the locale={locale\_code} parameter.

In the "Body" parameter, you need to provide the content of your entry based on the content type.

Enter the code of the language to localize the entry of that particular language.

## importExisting

The "Import an existing entry" call will import a new version of an existing entry. You can create multiple versions of an entry.

## getReference

The "Get references of an entry" call returns all the entries of content types that are referenced by a particular entry.

## getLanguage

The "Get languages of an entry" call returns the details of all the languages that an entry exists in.

## detailOfAllVersion

The "Get Details of All Versions of an Entry" request allows you to retrieve the details of all the versions of an entry.

The version details returned include the actual version number of the entry; the version name along with details such as the assigned version name, the UID of the user who assigned the name, and the time when the version was assigned a name; and the locale of the entry.

## versionNumber

Atomic operations are particularly useful when we do not want content collaborators to overwrite data. Though it works efficiently for singular fields, these operations come in handy, especially in the case of fields that are marked as "Multiple".

Enter the version number of the entry that you want to delete.

Request body for the delete operation.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## find

The "Find" call fetches the list of all the entries of a particular content type. It also returns the content of each entry in JSON format. You can also specify the environment and locale where you wish to get the entries.

## fetch

The "Get a single entry" request fetches a particular entry of a content type.

The content of the entry is returned in JSON format. You can also specify the environment and locale from which you wish to retrieve the entries.

## delete

The "Delete an entry" request allows you to delete a specific entry from a content type. This API request also allows you to delete single and/or multiple localized entries.

You can delete specific localized entries by passing the locale codes in the Request body using the locales key.

## update

The "Update an entry" call lets you update the content of an existing entry.

Passing the locale parameter will cause the entry to be localized in the specified locale.

The request body for the entry update.

## export

The "Export an entry" call is used to export an entry. The exported entry data is saved in a downloadable JSON file.

## imports

The "Import an entry" call is used to import an entry. To import an entry, you need to upload a JSON file that has entry data in the format that fits the schema of the content type it is being imported to.

The Import an existing entry call will import a new version of an existing entry. You can create multiple versions of an entry.

## create

The "Create an entry" call creates a new entry for the selected content type.

When executing the API call, in the 'Body' section, you need to provide the content of your entry based on the content type created.

The requestBody to create/add a single Item.

## addParam

Sets header for the request.

**Note: Since HashMap does not allow duplicate keys like include\[\], use the includeReference method to retrieve the entry with reference fields.**

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## includeReference

The includeReference method retrieves the content of the referenced entry.

Enter the reference\_field value

## setWorkflowStage

The setWorkflowStage method allows you to set or update the workflow stage of an entry.

Details for the workflow stage

## publishRequest

The publishRequest method allows you to either send a publish request or accept/reject a received publish request.

**Request Structure**

**Headers:** Include the API Key (stack identifier) and Auth Token (authentication).

**Body Parameters:**

*   uid – Publish rule identifier
*   action – "publish", "unpublish", or "both"
*   status – 0 (Approval Requested), 1 (Approval Accepted), -1 (Approval Rejected)
*   notification\_settings – Controls notification triggers
*   comment – Optional note for the approver

Details for the publishing rule

## fetchAsPojo

The fetchAsPojo method fetches a single entry by UID and deserializes it into a POJO.

## findAsPojo

The findAsPojo method fetches multiple entries for a content type and deserializes them into POJOs.

## Environment

A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.

## update

The "Update environment" call will update the details of an existing publishing environment for a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

The request body.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## find

The "Get all environments" call fetches the list of all environments available in a stack.

You can add queries to extend the functionality of this API call.

## fetch

The "Get a single environment" call returns more details about the specified environment of a stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

## delete

"Delete environment" call will delete an existing publishing environment from your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

## create

The "Add an environment call" will add a publishing environment for a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

The request body.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## DeliveryToken

Delivery tokens provide read-only access to the associated environments, while management tokens provide read-write access to the content of your stack. Use these tokens and the stack API key to make authorized API requests.

## delete

The "Delete delivery token" request deletes a specific delivery token.

## update

The "Update delivery token" request lets you update the details of a delivery token.

In the Request Body, you need to pass the updated details of the delivery token in JSON format. The details include the updated name, description, and/or the environment of the delivery token.

Thee body should be a JSON Object.

## create

The Create delivery token request creates a delivery token in the stack.

In the Request Body, you need to pass the details of the delivery token in JSON format. The details include the name, description, and environment of the delivery token.

The request body to create a delivery token.

## find

The "Get all delivery tokens" request returns the details of all the delivery tokens created in a stack.

## fetch

The "Get a single delivery token" request returns the details of all the delivery tokens created in a stack.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## removeParam

Sets header for the request.

Remove query parameters of request by key.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## Extensions

Extensions let you create custom fields and widgets to customize Contentstack default UI and behavior.

You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include\_branch query parameter to true to include the \_branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.

## uploadCustomField

The "Upload a custom field" request is used to upload a custom field to Contentstack.

Select the HTML file of the custom field that you want to upload.

Enter the title of the custom field that you want to upload.

Enter the data type for the input field of the custom field.

Enter the tags that you want to assign to the custom field.

Enter ‘true’ if you want your custom field to store multiple values.

Enter the type as ‘field’ since this is a custom field extension.

The request body.

## update

The "Update Extensions call" will update the details of a custom field.

The request body to update the Extension.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## find

The "Get all custom fields" request is used to get the information of all custom fields created in a stack.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## fetch

The "Fetch" request returns information about a specific extension.

## delete

The "Delete custom field" request deletes a specific custom field.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## Folder

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## delete

The "Delete a folder" call is used to delete an asset folder along with all the assets within that folder.

When executing the API call, provide the parent folder UID.

## create

The "Create a folder" call is used to create an asset folder and/or add a parent folder to it (if required).

The request body to create a delivery token.

## update

The "Update or move folder" request can be used either to update the details of a folder or set the parent folder if you want to move a folder under another folder.

When executing the API request, provide the UID of the folder that you want to move/update.

The request body.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## fetch

The "Get a single folder" call gets the comprehensive details of a specific asset folder using folder UID.

When executing the API call to search for a subfolder, you will need to provide the parent folder UID.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## GlobalFields

A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and effort) to repeatedly create the same set of fields in multiple content types.

You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. You can also set the include\_branch query parameter to true to include the \_branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.

A nested global field is a reusable set of sub-fields you can embed within other global fields or content types. It helps manage complex data structures more efficiently across your stack.

**Note:** To work with nested global fields, set api\_version to 3.2 in the request headers. This version is required for all CRUD operations to work correctly.

## create

The Create a global field request allows you to create a new global field in a particular stack of your Contentstack account. You can use this global field in any content type within your stack.

**Note**: Only the stack owner, administrator, and developer can create global fields.  
You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about [authentication](/docs/developers/security).

The request body.

## imports

The "Import global field" call imports global fields into Stack.

**Note**: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.

The request body.

## export

This request is used to export a specific global field and its schema. The data is exported in JSON format.

The version of the content type you want to retrieve. If the version number is not specified, you will get the latest version of the content type.

## update

The "Update a global field" request allows you to update the schema of an existing global field.

When executing the API call, in the URI Parameters section, provide the unique ID of your global field.

**Note**: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.

The request body.

## removeParam

Set header for the request.

Removes query param using key of request.

## find

The "Get all global fields" call returns comprehensive information on all the global fields available in a particular stack in your account

**Note**: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about [authentication](/docs/developers/security).

## fetch

The "Get a Single global field" request lets you fetch comprehensive details of a specific global field.

When executing the API call, in the URI Parameters section, provide the unique ID of your global field.

**Note**: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.

## Label

Labels allow you to group a collection of content within a stack. Using labels, you can group content types that need to work together.

You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include\_branch query parameter to true to include the \_branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## addBranch

Enter your branch's unique ID.

Branch's unique ID.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## delete

The "Delete label" call is used to delete a specific label.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account

## update

The "Update label" call is used to update an existing label.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

The request body to update the Label.

## find

The "Find label" call fetches all the existing labels of the stack.

When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Using addParam(String, Object), you can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

## fetch

The "Get label" call returns information about a particular label of a stack.

## create

This call is used to create a label.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

The request body.

## Locale

Contentstack has a sophisticated, multilingual capability. It allows you to create and publish entries in any language. This feature allows you to set up multilingual websites and cater to a wide variety of audiences by serving content in their local language(s).

## update

The "Update language" call will let you update the details (such as display name) and the fallback language of an existing language of your stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Thee body should be a JSON Object.

## delete

The "Delete language" call deletes an existing language from your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

## find

This call fetches the list of all languages (along with the language codes) available for a stack.

When executing the API call, under the Header section, you need to enter the authtoken that you receive after logging into your account.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## setFallback

The "Set a fallback" language request allows you to assign a fallback language for an entry in a particular language.

When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging in to your account.

The request body.

## updateFallback

The "Update fallback language" request allows you to update the fallback language for an existing language of your stack.

When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging in to your account.

The request body.

## fetch

The "Get a language" call returns information about a specific language available on the stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

## create

This call lets you add a new language to your stack. You can either add a supported language or a custom language of your choice.

When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

The request body.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## ManagementToken

To authenticate Content Management API (CMA) requests over your stack content, you can use Management Tokens.

## update

The "Update management token" request lets you update the details of a management token. You can change the name and description of the token, update the stack-level permissions assigned to the token, and change the expiry date of the token (if set).

The request body.

## find

The "Get all management tokens" request returns the details of all the management tokens generated in a stack and NOT the actual management tokens.

## fetch

The "Get a single management token" request returns the details of a specific management token generated in a stack and NOT the actual management token.

## delete

The Delete management token request deletes a specific management token

## create

The "Create management token" request creates a management token in a stack. This token provides you with read-write access to the content of your stack.

Details of the management token.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## publishQueue

The Publish Queue displays the historical and current details of activities such as publishing, unpublishing, or deleting that can be performed on entries and/or assets. It also shows details of Release deployments. These details include time, entry, content type, version, language, user, environment, and status.

## cancelScheduledAction

The "Cancel Scheduled Action" request will allow you to cancel any scheduled publishing or unpublishing activity of entries and/or assets and cancel the deployment of releases.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## FetchActivity

The "Get publish queue activity" request returns comprehensive information on a specific publish, unpublish, or delete action performed on an entry and/or asset. You can also retrieve details of a specific release deployment.

## removeParam

Set header for the request.

Removes query param using the key of request.

## find

The "Get publish queue" request returns comprehensive information on activities such as publish, unpublish, and delete performed on entries and/or assets. This request also includes the details of the release deployments in the response body.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## ReleaseItem

The "Get all items in a Release" request retrieves a list of all items (entries and assets) that are part of a specific Release and perform CRUD operations on it.

## createMultiple

The "Add multiple items to a Release" request allows you to add multiple items (entries and/or assets) to a Release.

When executing the API request, you need to provide the Release UID.

The requestBody to create/add a single Item.

## update

The "Update Release items to their latest versions" request let you update all the release items (entries and assets) to their latest versions before deployment

**Note**: You need to use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request.

The requestBody to create/add a single Item.

## find

The "Get all items in a Release request" retrieves a list of all items (entries and assets) that are part of a specific Release.

## delete

The "Remove an item from a Release" request removes one or more items (entries and/or assets) from a specific Release.

## create

The "Add a single item to a Release" request allows you to add an item (entry or asset) to a Release.

When executing the API request, you need to provide the Release UID.

The requestBody to create/add a single Item.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## removeParam

Sets header for the request.

Param key for the request.

## deleteReleaseItems

The deleteReleaseItems method removes multiple entries or assets from a specific release in a single request.

Data defining the items to be removed

## deleteReleaseItem

The deleteReleaseItem method removes a single entry or asset from a release.

Data defining the item to remove

## move

The move method allows you to move multiple items within a specific release.

The data containing the items to be moved.

The release version(2.0)

## Releases

The Releases class provides methods to create, manage, and deploy content releases that group entries and assets for coordinated publishing across environments.

**Note:** Pass the release\_version parameter as 2.0 in the Headers section if you have the latest release enabled for your organization. Reach out to our support team for more information.

## create

The create method creates a new release in the stack.

The requestBody to create a release.

## update

The update method modifies the name, description, or schedule of an existing release.

Request body to update a release

## fetch

The fetch method retrieves details of a specific release using its UID.

## clone

The clone method creates a duplicate of an existing release with a new name or description.

Request body to clone a release

## delete

The delete method removes a specific release from the stack

## deploy

The deploy method deploys all entries and assets from a release to specified environments and locales.

The requestBody to deploy a release.

## addParam

The addParam method sets a query parameter for the release request.

Key of the query parameter

Value of the query parameter

## addHeader

The addHeader method sets a header for the release request.

Key of the header

Value of the header

## removeParam

The removeParam method removes a previously set query parameter from the release request.

Key of the query parameter to remove

## Role

A role is a collection of permissions that will be applicable to all the users who are assigned this role.

## create

The create role method adds a new role to your stack.

The body should be of a JSONObject type

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## delete

The "Delete role" call deletes an existing role from your stack.

## fetch

The "Get a single role" request returns comprehensive information on a specific role.

## find

The "Get all roles" request returns comprehensive information about all roles created in a stack.

You can add queries to extend the functionality of this API request.

## update

The "Update role" request lets you modify an existing role of your stack. However, the pre-existing system roles cannot be modified.

The body should be of a JSONObject type.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## Stack

A stack is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.

## workflow

A workflow is a tool that allows you to streamline the process of content creation and publishing and lets you manage the content lifecycle of your project smoothly.

The UID of your workflow that you want to retrieve.

## roles

A role is a collection of permissions that is applied to all the users who are assigned this role.

The Update User Role API Request updates the roles of an existing user account. This API Request will override the existing roles assigned to a user. For example, we have an existing user with the Developer role, and if you execute this API request with the "Content Manager" role, the user role will lose Developer rights, and the user role be updated to just Content Manager.

The unique ID of the role of which you want to retrieve the details.

## webhook

A webhook is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account. Webhooks allow you to specify a URL to which you would like Contentstack to post data when an event happens.

Enter the unique webhook ID from which you want to retrieve the details. Execute the Get all webhooks call to retrieve the UID of a webhook.

## updateSetting

The "Add stack settings" request lets you add additional settings for your existing stack.

The request body in JSONObject format.

## update

The Update stack call lets you update the name and description of an existing stack.

The request body in JSONObject format.

## unshare

The "Unshare stack" removes the user account from the list of collaborators. Once this call is executed, the user will not be able to view the stack in their account.

The request body in JSONObject format.

## transferOwnership

The Transfer stack ownership to other users calls sends the specified user an email invitation for accepting the ownership of a particular stack.

Once the specified user accepts the invitation by clicking on the link provided in the email, the ownership of the stack gets transferred to the new user. Subsequently, the previous owner will no longer have permission on the stack.

The request body in JSONObject format.

## tokens

Contentstack provides different types of tokens to authorize API requests. You can use Delivery Tokens to authenticate Content Delivery API (CDA) requests and retrieve the published content of an environment. To authenticate Content Management API (CMA) requests over your stack content, you can use Management Tokens.

Delivery tokens provide read-only access to the associated environments, while management tokens provide read-write access to the content of your stack. Use these tokens along with the stack API key to make authorized API requests

## share

The Share a stack call shares a stack with the specified user to collaborate on the stack.

The request body.

## setting

The "Get stack settings" call retrieves the configuration settings of an existing stack.

## resetSetting

The "Reset stack settings" call resets your stack to default settings and, additionally, lets you add parameters to or modify the settings of an existing stack.

The request body.

## releases

You can pin a set of entries and assets (along with the deploy action, i.e., publish/unpublish) to a release, and then deploy this release to an environment. This will publish/unpublish all the items of the release to the specified environment.

The unique ID of the release of which you want to retrieve the details.

## publishQueue

The Publishing Queue displays the historical and current details of activities such as publishing, unpublishing, or deleting that can be performed on entries and/or assets. It also shows details of Release deployments. These details include time, entry, content type, version, language, user, environment, and status.

The UID of a specific publish queue activity of which you want to retrieve the details. Execute the Get publish queue API request to retrieve the UID of a particular publish queue activity.

## locale

Contentstack has a sophisticated, multilingual capability. It allows you to create and publish entries in any language. This feature allows you to set up multilingual websites and cater to a wide variety of audiences by serving content in their local language(s).

The locale code.

## label

Labels allow you to group a collection of content within a stack. Using labels you can group content types that need to work together.

The label.

## globalField

A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and effort) to create the same set of fields repeatedly in multiple content types.

The globalField UID.

## extensions

Extensions let you create custom fields and widgets to customize Contentment's default UI and behavior. Read more about Extensions.

The customField Uid.

## environment

A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.

The environment UID

## create

The "Create stack call" creates a new stack in your Contentstack account.

The organization uid.

The request body should be in JSONObject format.

## contentType

The ContentType defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type.

Enter the unique ID of the content type from which you want to retrieve the details. The UID is generated based on the title of the content type. The unique ID of a content type is unique across a stack

## branch

Branches allow you to isolate and easily manage your in-progress work from your stable, live work in the production environment. It helps multiple development teams to work in parallel in a more collaborative, organized, and structured manner without impacting each other.

The unique ID of the branch of which you want to retrieve the details.

## auditLog

An audit log displays a record of all the activities performed in a stack and helps you track all published items, updates, deletes, and the current status of the existing content.

The log Item Uid.

## asset

Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use.

The asset Uid.

Enter either the UID of a specific folder to get the assets of that folder or enter ‘cs\_root’ to get all assets and their folder details from the root folder.

Example:bltd899999999.

Set this parameter to ‘true’ to include the details of the created folders along with the details of the assets.

Example:true.

Enter the name of the environment to retrieve the assets published on them. You can enter multiple environments.

Example: production

Specify the version number of the asset that you want to retrieve. If the version is not specified, the details of the latest version will be retrieved.

Example:1

Enter 'true' to include the published details of the entry.  
Example:true

Set this parameter to 'true' to include the total number of assets available in your stack in the response body.

Set this to 'true' to display the relative URL of the asset.

Enter the unique ID of the field for sorting the assets in ascending order by that field.

Example:created\_at

Enter the unique ID of the field for sorting the assets in descending order by that field.

Example:file\_size

Set this to 'true' to include the \_branch top-level key in the response. This key states the unique ID of the branch where the concerned Contentstack module resides.

Example:false

## allUsers

The "Get all users" of a stack call fetches the list of all users of a particular stack.

## alias

An alias acts as a pointer to a particular branch. You can specify the alias ID in your frontend code to pull content from the target branch associated with an alias.

The unique ID of the alias of which you want to retrieve the details. The UID of an alias is unique across a stack. Execute the Get all aliases call to retrieve the UID of an alias

## acceptOwnership

The "Accept stack owned by another user" call allows a user to accept the ownership of a particular stack via an email invitation.

Once the user accepts the invitation by clicking the link, the ownership is transferred to the new user account. Subsequently, the user who transferred the stack will no longer have any permission on the stack.

The ownership token received via email by another user.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## find

Find call fetches stack information.

All Stack: auth token is required to fetch all the stacks.

Single Stack: api\_key and authtoken is required, and organization\_uid is optional.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## Tokens

Contentstack provides different types of tokens to authorize API requests.

## deliveryTokens

You can use Delivery Tokens to authenticate Content Delivery API (CDA) requests and retrieve the published content of an environment.

The UID of the token that you want to retrieve.

## managementToken

To authenticate Content Management API (CMA) requests over your stack content, you can use Management Tokens.

The managementTokenUid.

## Webhook

A webhook is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account. Webhooks allow you to specify a URL to which you would like Contentstack to post data when an event happens.

## getExecutionLog

This call will return a comprehensive detail of all the webhooks that were executed at a particular execution cycle.

The execution unique ID of the webhook.

## GetExecution

The "Get executions of a webhook" request allows you to fetch the execution details of a specific webhook, which includes the execution UID. These details are instrumental in retrieving webhook logs and retrying a failed webhook.

## importExisting

The "Import an Existing Webhook" request will allow you to update the details of an existing webhook.

## export

## retry

This call makes a manual attempt to execute a webhook after the webhook has finished executing its automatic attempts.

When executing the API call, in the URI Parameter section, enter the execution UID that you receive when you execute the 'Get executions of webhooks' call.

The execution unique ID of the webhook.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## find

The "Get all Webhooks request" returns comprehensive information on all the available webhooks in the specified stack

When executing the API call, under the Header section, you need to enter the authtoken that you receive after logging into your account.

## fetch

The "Get webhook" request returns comprehensive information on a specific webhook.

## delete

The "Delete webhook" call deletes an existing webhook from a stack.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## update

The "Update webhook" request allows you to update the details of an existing webhook in the stack.

The body should be of a JSONObject type.

## importWebhook

The **Import Webhook** section consists of the following two requests that will help you to import new Webhooks or update existing ones by uploading JSON files.

the file name

jsonPath like example "/Downloads/import.json"

## Error

## getErrorCode

The "GetErrorCode" method returns the error code in integer form.

## getErrorMessage

The "GetErrorMessage" method returns the error details.

## getErrors

The "GetError" method returns the error in JSONObject format.

## Workflow

Workflow is a tool that allows you to streamline the process of content creation and publishing and lets you manage the content lifecycle of your project smoothly.

## updatePublishRule

The "Add or Update Publish Rules" request allows you to add a publishing rule or update the details of the existing publishing rules of a workflow.

The UID of the publishing rule that you want to update.

The request body.

## fetchPublishContentType

The "Get Publish Rules by Content Types" request allows you to retrieve details of a Publish Rule applied to a specific content type of your stack.

The UID of the content type of which you want to retrieve the Publishing Rule.

## deletePublishRule

The "Delete Publish Rules" request allows you to delete an existing publish rule.

The UID of the published rule that you want to delete.

## createPublishRule

The "Create Publish Rules" request allows you to create publish rules for the workflow of a stack.

Specify the unique IDs of the branches for which the publishing rule will be applicable in the schema in the request body.

## fetchTasks

The "Get all Tasks" request retrieves a list of all tasks assigned to you.

When executing the API request, in the 'Header' section, you need to provide the API Key of your stack and the authtoken that you receive after logging into your account.

## disable

Disable Workflow request allows you to disable a workflow.

## enable

The "Enable Workflow" request allows you to enable a workflow.

## update

The "Add or Update Workflow" request allows you to add a workflow stage or update the details of the existing stages of a workflow.

The body should be in JSONObject format.

## create

The "Create a Workflow" request allows you to create a Workflow.

The details of the workflow in JSONObject format.

## delete

The "Delete webhook" call deletes an existing webhook from a stack.

## fetch

The "Get a Single Workflow" request retrieves the comprehensive details of a specific Workflow of a stack.

## find

The "Get a Single Workflow" request retrieves the comprehensive details of a specific Workflow of a stack.

## addParam

Sets header for the request.

Query parameter key for the request.

Query parameter value for the request.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## Organization

The Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources and users. The Organization allows easy management of projects and users within the organization.

## roles

Gets organization roles.

Below are the parameters to use in the method - addParam(String, Object):

The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.

The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.

The "include\_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.

The include\_stack\_roles parameter, when set to true, includes the details of stack-level roles in the Response body.

## stacks

The "Get all stacks" in an organization call fetches the list of all stacks in an Organization

The query parameters for the method - addParam(String, Object) are as follows:

The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. Example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The 'asc' parameter allows you to sort the list of organization invitations in ascending order on the basis of a specific parameter.

The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.

The 'include\_count' parameter returns the number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.

The 'typeahead' parameter allows you to perform a name-based search on all the stacks in an organization based on the value provided.

## find

The "Get all organizations" call lists all organizations related to the system user in the order that they were created

Following are the query parameters for the method - addParam(String, Object):

The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.

The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.

The "include\_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.

"contentstack".

## allInvitations

The "Get all organization invitations" call gives you a list of all the Organization invitations. Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.

When executing the API call, provide the Organization UID.

The query parameters for addParam(String, Object) are as follows:

The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The 'asc' parameter allows you to sort the list of organization invitations in ascending order based on a specific parameter.

The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.

The 'include\_count' parameter returns the total number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.

The 'include\_roles' parameter, when set to 'true', will display the details of the roles that are assigned to the user in an organization.

The 'include\_invited\_by' parameter, when set to 'true', includes the details of the user who sent out the organization invitation.

The 'include\_user\_details' parameter, when set to 'true', lets you know whether the user who has been sent the organization invitation has enabled Two-factor Authentication or not.

## transferOwnership

The "Transfer organization ownership" call transfers the ownership of an Organization to another user. When the call is executed, an email invitation for accepting the ownership of a particular Organization is sent to the specified user.

The request body.

## logsDetails

The "Get Organization log details" request is used to retrieve the audit log details of an organization

**Tip**: This request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form.

## logItem

The" Get Organization log details" request is used to retrieve the audit log details of an organization

**Tip**: This request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form

The log uid.

## resendInvitation

Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation.

Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.

The share uid.

## removeUsers

The "Remove Users from Organization" request allows you to remove existing users from your organization.

**Note**: Only the owner or the admin of the organization can remove users.

The request body in JSONObject format.

## inviteUser

The "Add Users to organization" call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.

## fetch

The "Get a single organization" call gets the comprehensive details of a specific organization related to the system user.

## removeParam

Set header for the request.

Removes query parameters using the key of the request.

## addHeader

Sets header for the request.

Header key for the request.

Header value for the request.

## addParam

Sets header for the request.

The query parameter key for the request.

The query parameter value for the request.

## Taxonomy

Taxonomy helps you categorize pieces of content within your stack to facilitate easy navigation, search, and retrieval of information. You can hierarchically organize your web properties based on your requirements, such as their purpose, target audience, or any other aspects of your business.

## addParam

The addParam method adds a parameter to a collection using a key-value pair.

The key of the parameter

The value of the parameter

## addHeader

The addHeader method adds a header with a key-value pair to a request.

The key of the header

The value of the header

## addHeaders

The addHeaders method adds a headers to a HashMap.

The key-value pair of the header

## addParams

The addParams takes a HashMap of String keys and Object values as input and returns a generic type T.

The parameters to be added

## find

The find method retrieves the list of all taxonomies in the stack.

Whether to include the count of terms in the response.

Whether to include the count of referenced terms in the response.

Whether to include the count of referenced entries in the response.

Whether to include the total count of taxonomies in the response.

Sort order based on the UID field.

Search string for typeahead functionality.

Whether to include deleted taxonomies in the response.

Number of records to skip in pagination.

Maximum number of records to return

## fetch

The fetch method retrieves the information of a specific taxonomy.

Whether to include the count of terms in the response.

Whether to include the count of referenced terms in the response.

Whether to include the count of referenced entries in the response.

UID of the taxonomy

## create

The create method lets you add a new taxonomy in the stack.

The request body to sent in the call.

## update

The update method lets you make changes in the existing taxonomy in the stack.

UID of the taxonomy

## delete

The delete method lets you remove an existing taxonomy from the stack.

UID of the taxonomy

## query

Get an instance of the taxonomy search filter class through which you can query on a taxonomy based on an entry endpoint. Provide the user's email address in JSON format.

The query of type JSONObject.

## terms

The terms method retrieves the information of the terms in the specific taxonomy.

UID of the taxonomy

## Terms

Terms are the fundamental building blocks in a taxonomy. They are used to create hierarchical structures and are integrated into entries to classify and categorize information systematically.

## addParam

The addParam method adds a parameter to a collection using a key-value pair.

The key of the parameter

The value of the parameter

## addHeader

The addHeader method adds a header with a key-value pair to a request.

The key of the parameter

The value of the parameter

## addParams

The addParams method takes a HashMap of String keys and Object values as input and returns a generic type T.

Maps String keys to Object values

## addHeaders

The addHeaders method adds headers to a HashMap.

A HashMap containing key-value pairs of headers

## create

The create method lets you add a term to the taxonomy.

The request body to be sent in the call

## find

The find method retrieves th elist of all terms in the taxonomy.

The UID Of the taxonomy for which we need the terms.

Include the terms upto the depth specified if set to a number greater than 0, include all the terms if set to 0, default depth will be set to 1

Include count of number of children under each term

Include count of the entries where this term is referred

Include count of the documents/nodes that matched the query

Sort the given field in either ascending or descending order

Used to match the given string in all terms and return the matched result

Used to fetch only the deleted terms

Skip the number of documents/nodes

Limit the result to number of documents/nodes

## fetch

The fetch method retrieves the information about a specific term in the taxonomy.

The UID Of the term

Include count of number of children under each term

Include count of the entries where this term is referred

## descendants

The descendants method retrieves the information about the descendants of a specific term in the taxonomy.

The UID Of the term

Include the terms upto the depth specified if set to a number greater than 0, include all the terms if set to 0, default depth will be set to 1

Include count of number of children under each term

Include count of the entries where this term is referred

Include count of the documents/nodes that matched the query

Skip the number of documents/nodes

Limit the result to number of documents/nodes

## ancestors

The ancestors method retrieves the information about the ancestors of a specific term in the taxonomy.

The UID Of the term

## update

The update method lets you update the details of an existing term in the taxonomy.

The UID Of the term

The request body to be sent in the call

## search

The search method retrieves the details of different terms in the taxonomy.

The string of the UIDs/names of the terms

## VariantGroup

Variant Groups is a feature of Personalize in Contentstack. It allows you to link content types and create entry variants. This setup helps tailor content to different audiences or contexts based on specific grouping logic.

**Note:**

*   The Variants feature is currently part of our Early Access Program and may not be available in all stacks. To request access, contact our support team.
*   You cannot edit variant group details directly. They are managed through Personalize.

## Get All Variant Groups

The variantGroup.find() method retrieves all variant groups linked to your stack. This helps list available groups for content personalization.

## addParam

The addParam() methodsets a single query parameter for the request using a key-value pair..

Query parameter key

Query parameter value

## addParams

The addParams() method sets multiple query parameters for the request. Pass a HashMap of key-value pairs to customize the API response.

Maps key–value pairs for API request customization such as include\_count, limit, or content\_type.

## clearParams

The clearParams method removes a specific query parameter from the request using its key.

Removes the query parameter that matches the specified key.

## addHeader

The addHeader method sets a custom header for the request. Use this to specify a key–value pair in the request header.

The name of the header to include in the request. Common headers include authorization, authtoken, or api\_key.

The value assigned to the header. This can be a string, such as a token or API key. Appears in the final request header.

## addHeaders

The addHeaders method sets multiple headers for the request. Pass a HashMap containing key–value pairs of header names and values.

A HashMap that maps String keys to String values. Common headers include authorization, authtoken, and api\_key.

## linkContentTypes

The linkContentTypes method links one or more content types to a variant group. Use it to enable personalization by associating content types with variant logic.

Links one or more content types to a variant group. Accepts a variable number of String arguments.

## unlinkContentTypes

The unlinkContentTypes method removes one or more content types from a variant group. Use this method to detach content types previously linked for personalization.

Unlinks one or more content types to a variant group. Accepts variable-length String arguments.

## setBranches

The setBranches method defines the branches used in the request body when linking or unlinking content types from a variant group. By default, only the main branch is included.

A list of branch names to apply to the request. Accepts either a List<String> or a variable number of String arguments.