Taxonomy Foundations
Content Management APIs for Taxonomy
Let's consider an example. Our stack has the following taxonomy created.
We have terms inside Superhero, as seen in the image below.

Get all taxonomies
The Get All Taxonomies request provides detailed information about every taxonomy available within your company's specific stack.
Example: Let's retrieve every taxonomy found within our stack. Take into consideration the example given in the Overview section.
Below is the curl command for the same.
curl --location 'https://api.contentstack.io/v3/taxonomies' \
--header 'api_key: **************' \
--header 'authorization: *******************' \
--header 'Content-Type: application/json' \
--data ''
View the screenshot below to view the outcome of the postman call.

Get a single taxonomy
The "Get a single taxonomy" request provides detailed information about a single taxonomy in a given stack.
Example: Consider the example given in the Overview section for this. Let's fetch superhero taxonomy.
Below is the curl command to fetch superhero taxonomy
curl --location 'https://api.contentstack.io/v3/taxonomies/superhero' \
--header 'api_key: **************' \
--header 'authorization: ****************' \
--header 'Content-Type: application/json' \
--data ''
View the screenshot below to see the outcome of the postman call.

Get a single term
The "Get a single term" request provides detailed information about a single term in a given taxonomy.
Example: Consider the following example, which is provided in the Overview section. Obtain a single term from the superhero taxonomy that refers to powers and abilities.
curl --location 'https://api.contentstack.io/v3/taxonomies/superhero/terms/powers_and_abilities' \
--header 'api_key: ***************' \
--header 'authorization: **********************' \
--header 'Content-Type: application/json' \
--data ''
View the screenshot below to see the outcome of the postman call.

Create a term
Within your stack, a term in a specific taxonomy is created via the Create a Term request.
Since terms are organized hierarchically in a taxonomy, it's important to define the order when creating new terms. For instance, when creating a term at the root level, set the parent_uid as null and specify the level as 1 or above to position it in the list. To create a child term, provide the parent_uid of the parent term where you want to add the new child term and indicate the desired position within the order parameter.
Creating a Term at the Root level
When creating terms at the parent level, the request body should look like this:
Example: We would like to make a new Term at the root level. For this, consider the example provided in the previous modules. And add the term "Films" to the "Superhero" taxonomy. Notice that the parent UID is null.
Below is the curl command to create a term.
curl --location 'https://api.contentstack.io/v3/taxonomies/superhero/terms' \
--header 'api_key:**************' \
--header 'authorization: ********************' \
--header 'Content-Type: application/json' \
--data '{
"term": {
"uid": "films",
"name": "Films",
"parent_uid": null
}
}'
View the screenshot below to see the outcome of the postman call.


Creating a Term under a parent Term
When creating terms at the child level, the request body should look like this:
curl --location 'https://api.contentstack.io/v3/taxonomies/superhero/terms' \
--header 'api_key:**************' \
--header 'authorization: ********************' \
--header 'Content-Type: application/json' \
--data '{
"term": {
"uid": "scientific_experimentation",
"name": "Scientific Experimentation",
"parent_uid": "origin"
}
}'

The result should be a new Term located under the Origin parent term:
