---
title: "Label"
description: "Label"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/java/reference/label"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-20"
---

# Label

## 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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
response = label.addParam("key", value);
```

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
label.addHeader("key", value);
```

Header key for the request.

Header value for the request.

## addBranch

Enter your branch's unique ID.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
response = label.addBranch(value);
```

Branch's unique ID.

## removeParam

Set header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
label.removeParam("key");
```

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

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
Call<ResponseBody> response = label.delete().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## 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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
Call<ResponseBody> response = label.update(requestBody).execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
Call<ResponseBody> response = label.find().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## fetch

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

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
Call<ResponseBody> response = label.fetch().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## 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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Label label = contentstack.stack().label();
Call<ResponseBody> response = label.create(body).execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The request body.

## Label | Java Management SDK | Contentstack

Label lets you group a collection of content and related content types that need to work together within a stack in the Java Management SDK.