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

# Terms

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

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Terms terms = contentstack.terms();
terms.addParam("key", "value");
```

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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Terms terms = contentstack.terms();
terms.addHeader("key", "value");
```

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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Terms terms = contentstack.terms();
terms.addParams("params");
```

Maps String keys to Object values

## addHeaders

The addHeaders method adds headers to a HashMap.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Terms terms = contentstack.terms();
terms.addHeaders("headers");
```

A HashMap containing key-value pairs of headers

## create

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

```
Stack stack = new Contentstack.Builder().build().stack(headers);
     JSONObject body = new JSONObject();
     Term term = stack.taxonomy("taxonomyId").terms().create(body);
```

The request body to be sent in the call

## find

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

```
Stack stack = new Contentstack.Builder().build().stack(headers);
     Term term = stack.taxonomy("taxonomyId").terms().addParam("limit", 2).find();
```

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.

```
Stack stack = new Contentstack.Builder().build().stack(headers);
     Term term = stack.taxonomy("taxonomyId").terms().find();
```

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.

```
Stack stack = new Contentstack.Builder().build().stack(headers);
      Term term = stack.taxonomy("taxonomyId").terms().descendants("termId");
```

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.

```
Stack stack = new Contentstack.Builder().build().stack(headers);
      Term term = stack.taxonomy("taxonomyId").terms().ancestors("termId");
```

The UID Of the term

## update

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

```
body = new RequestBody{
   "term": {
     "name": "Term 1",
     "description": "Term 1 Description updated for Taxonomy 1"
   }
 }

 Stack stack = new Contentstack.Builder().build().stack(headers);
 Term term = stack.taxonomy("taxonomyId").terms().update(body);
```

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.

```
Stack stack = new Contentstack.Builder().build().stack(headers);
 Term term = stack.taxonomy("taxonomyId").terms().search("search anything");
```

The string of the UIDs/names of the terms

## Terms | Java Management SDK | Contentstack

Terms are the core building blocks of a taxonomy, forming hierarchies and attaching to entries to classify and categorize content systematically.