cs-icon.svg

Import a Taxonomy

You can easily import a taxonomy from a CSV or JSON file into your stack in easy steps.

Consider, you have a Regions taxonomy in one of your stacks structured as follows:

Regions Taxonomy.png

Now, you want to import this taxonomy into another stack. To achieve this, you will first need to export the Regions taxonomy in JSON format. Here's an example of what the JSON file might look like:

{
   "taxonomy":{
      "uid":"regions",
      "name":"Regions",
      "description":"A Taxonomy which focuses on the categorization of various regions and its sub regions."
   },
   "terms":[
      {
         "uid":"amer",
         "name":"AMER",
         "parent_uid":null
      },
      {
         "uid":"emea",
         "name":"EMEA",
         "parent_uid":null
      },
      {
         "uid":"apac",
         "name":"APAC",
         "parent_uid":null
      },
      {
         "uid":"asia",
         "name":"Asia",
         "parent_uid":"apac"
      },
      {
         "uid":"europe",
         "name":"Europe",
         "parent_uid":"emea"
      },
      {
         "uid":"north_america",
         "name":"North America",
         "parent_uid":"amer"
      },
      {
         "uid":"central_america",
         "name":"Central America",
         "parent_uid":"amer"
      },
      {
         "uid":"middle_east",
         "name":"Middle East",
         "parent_uid":"emea"
      },
      {
         "uid":"pacific",
         "name":"Pacific",
         "parent_uid":"apac"
      },
      {
         "uid":"africa",
         "name":"Africa",
         "parent_uid":"emea"
      },
      {
         "uid":"south_america",
         "name":"South America",
         "parent_uid":"amer"
      },
      {
         "uid":"caribbean",
         "name":"Caribbean",
         "parent_uid":"amer"
      },
      {
         "uid":"northeastern_asia",
         "name":"Northeastern Asia",
         "parent_uid":"asia"
      },
      {
         "uid":"central_and_south_asia",
         "name":"Central and South Asia",
         "parent_uid":"asia"
      },
      {
         "uid":"southeastern_asia",
         "name":"Southeastern Asia",
         "parent_uid":"asia"
      },
      {
         "uid":"central_asia",
         "name":"Central Asia",
         "parent_uid":"central_and_south_asia"
      },
      {
         "uid":"south_asia",
         "name":"South Asia",
         "parent_uid":"central_and_south_asia"
      },
      {
         "uid":"india",
         "name":"India",
         "parent_uid":"south_asia"
      },
      {
         "uid":"maharashtra",
         "name":"Maharashtra",
         "parent_uid":"india"
      },
      {
         "uid":"mumbai",
         "name":"Mumbai",
         "parent_uid":"maharashtra"
      }
   ]
}

Additional Resource: To import your taxonomy in the CSV format, refer to our template.

To import a taxonomy, log in to your Contentstack account, and perform the following steps:

  1. Go to your stack where you want to import a taxonomy, navigate to the “Settings” icon (press “S”) in the left navigation panel, and select Taxonomy.
  2. Click the Create New Taxonomy button, then select Import from the drop-down menu.

    Import_Taxonomy_Button.png
  3. In the Import Taxonomy modal, either drag and drop your CSV or JSON file or click Choose a file to browse for it.
  4. To display your imported taxonomy at the top of the list, tick the box that says Display this taxonomy at the top of the list.
  5. Finally, click Done to add your taxonomy.Import_Taxonomy_Modal.png

After successfully importing the taxonomy, you can start adding terms to it and associating it with content types.

API Reference

To import a taxonomy via API, refer to the Import a Taxonomy request.

Was this article helpful?
^