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

# Taxonomy

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

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Taxonomy taxonomy = contentstack.taxonomy ();
taxonomy.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();
Taxonomy taxonomy = contentstack.taxonomy ();
taxonomy.addHeader("key", "value");
```

The key of the header

The value of the header

## addHeaders

The addHeaders method adds a headers to a HashMap.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Taxonomy taxonomy = contentstack.taxonomy ();
taxonomy.addHeaders("headers");
```

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.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Taxonomy taxonomy = contentstack.taxonomy ();
taxonomy.addParams("params");
```

The parameters to be added

## find

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

```
Response<ResponseBody> response = taxonomy.find().execute();
```

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.

```
Response<ResponseBody> response = taxonomy.fetch("taxonomyId").execute();
```

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.

```
JSONObject body = new JSONObject
     Response<ResponseBody> response = taxonomy.create(body).execute();
```

The request body to sent in the call.

## update

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

```
JSONObject body = new JSONObject();
     JSONObject bodyContent = new JSONObject();
     bodyContent.put("name", "Taxonomy 1");
     bodyContent.put("description", "Description updated for Taxonomy 1);
     body.put("taxonomy", bodyContent);
     Response<ResponseBody> response = taxonomy.update("taxonomyId", body).execute();
```

UID of the taxonomy

## delete

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

```
Response<ResponseBody> response = taxonomy.delete("taxonomyId").execute();
```

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.

```
import contentstack; 
Taxonomy taxonomy = new Contentstack.Builder()
       .setAuthtoken(TestClient.AUTHTOKEN)
       .setHost("api.contentstack.io")
       .build()
       .stack("apiKey")
       .taxonomy();
JSONObject query = new JSONObject();
query.put("taxonomies.taxonomy_uid", "{"$in" : ["term_uid1" , "term_uid2" ] }");
Response response = taxonomy.query(query).execute();
if (response.isSuccessful()){
   System.out.println("Response :"+response.body().toString());
}else {
   System.out.println("Failed response :"+response.errorBody().toString());
}
```

The query of type JSONObject.

## terms

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

```
Term terms = stack("authtoken").taxonomy("taxonomyId").term();
```

UID of the taxonomy

## Taxonomy | Java Management SDK | Contentstack

Taxonomy lets you categorize stack content into hierarchical structures for easier navigation, search, and retrieval across your web properties.