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

# Terms

## Terms

Terms are the foundational elements of a taxonomy. They define hierarchical structure and help organize content systematically within a stack.

Terms support localization, allowing you to manage translated or region-specific versions across multiple locales. This ensures each term accurately reflects language and regional variations.

**Note:** In the JavaScript Management SDK, term-related operations are accessed using .terms() (plural). This differs from the Delivery SDK, which uses .term() (singular) for term-level methods.

## create

The create method lets you add a new term to your taxonomy.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
const term = {
	uid: 'termUid',
	name: 'term name',
	parent_uid: 'parent_uid',
	order: 2
}
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid')
terms().create(term)
.then((term) => console.log(term))
```

## fetch

The fetch() method retrieves details of a specific term along with organization metadata.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key' }).taxonomy('taxonomyUid').terms('termUid').fetch().then((term) => console.log(term));
```

Specifies the locale used to fetch the term. Defaults to master if not provided.

Specifies the branch whose fallback locale hierarchy is followed when include\_fallback is enabled.

Follows the fallback locale hierarchy of the specified branch or main when the taxonomy term isn’t available in the selected locale.

Specifies the fallback locale if the term isn’t available in the given locale. If both fallback\_locale and include\_fallback are provided, include\_fallback takes precedence.

Includes the count of children under the term.

Includes the count of entries where the term is referenced.

Includes the count of entries where descendant terms are referenced.

Fetches only the terms that are marked as deleted.

Specifies the UID of the taxonomy for which term data is required.

Specifies the UID of the deleted term. Required when deleted is set to true.

## query

The query method fetches all taxonomies or returns filtered results based on the provided query parameters.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').terms().query().find().then((terms) => console.log(terms))
```

Specifies the locale used to fetch the terms. Defaults to master if not provided.

Specifies the branch whose fallback locale hierarchy is followed when include\_fallback is enabled.

Enables terms to follow the fallback locale hierarchy (of the given branch or main) if not found in the specified locale.

Specifies the fallback locale if the taxonomy term isn’t available in the given locale. If both fallback\_locale and include\_fallback are specified, the system uses include\_fallback.

Includes terms from the root up to the specified depth. If set to 0, includes all terms.

Includes the count of children under each term.

Includes the count of entries where the term is referenced.

Includes the count of all documents or nodes that match the query.

Includes the order of the terms relative to their siblings.

Sorts the specified field in ascending (asc) or descending (desc) order.

Defines a custom query string. Currently restricted to querying by uid.

Matches the given string across all terms and returns the matching results.

Fetches only the terms that are marked as deleted.

Specifies the number of documents or nodes to skip.

Limits the result set to a specified number of documents or nodes.

Specifies the UUID of the taxonomy for which term data is required.

## update

The update method is used to update the details of an exisiting term in the taxonomy.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').terms('termUid').fetch().then((term) => {
	term.name = 'taxonomy name'
	return term.update()
})
.then((term) => console.log(term))
```

## delete

The delete method lets you remove an existing term from a taxonomy.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').term('termUid').delete()
.then((response) => console.log(response.notice))
```

Setting this to true will force delete the taxonomy and all its child terms. By default it is set to false.

UID of the term

## ancestors

The ancestors method is used to retrieves the list of all the ancestors of an existing term

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').term('termUid').ancestors()
.then((terms) => console.log(terms))
```

UID of the term

Include count of number of children under each term

Include count of the entries where atleast 1 term of this taxonomy is referred

Include count of the terms that matched the query

Skip the number of terms

Limit the result to number of terms

## descendants

The descendants method is used to retrieves the list of all the descendants of an existing term.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').term('termUid').descendants()
.then((terms) => console.log(terms))
```

UID of the term

Include the terms from the current term’s depth, upto the depth specified if set to a number greater than 0, include all the terms from the current term’s depth if set to 0, default depth will be set to 1, which will be to include the immediate terms from the current term’s depth

Include count of number of children under each term

Include count of the entries where atleast 1 term of this taxonomy is referred

Include count of the terms that matched the query

Include order of the terms relative to their siblings

Skip the number of terms

Limit the result to number of terms

## move

The move method lets you move an existing term or change the parent UID of the term.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
const term = {
	parent_uid: 'parent_uid',
	order: 2
}
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').terms('termUid').move({term})
.then((term) => console.log(term))
```

UID of the term

Setting this to true will force delete the taxonomy and all its child terms. By default it is set to false.

## search

The search method lets you search an existing term in the taxonomy.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).taxonomy('taxonomyUid').terms().search('termString').then((term) => console.log(term))
```

UID of the term

Include count of number of children under each term

Include count of the entries where atleast 1 term of this taxonomy is referred

Include count of the terms that matched the query

Used to give a custom query in a string format, currently restricted to only query on taxonomy\_uid & term\_uid

Used to match the given string in all terms & return the matched result, should either match with term uid or term name

Skip the number of terms

Limit the result to number of terms

## locales

The locales() method retrieves all locales in which a term is localized.

```
const termLocales = await client.stack({ api_key: 'your_api_key' })
  .taxonomy('taxonomy_uid')
  .terms('term_uid')
  .locales()
```

## localize

The localize() method creates a localized version of a term.

```
const localizedTerm = await client.stack({ api_key: 'your_api_key' })
  .taxonomy('taxonomy_uid')
  .terms('term_uid')
  .localize(
    { term: { name: 'Localized Term Name' } },
    { locale: 'hi-in' }
  )
```

Returns localized term properties such as name or description.

Target locale code (e.g., 'hi-in', 'fr-fr').

## Terms | JavaScript Management SDK | Contentstack

Terms are the building blocks of a taxonomy, used to create hierarchies and classify entries, in the JavaScript Management SDK.