# Importing Content with the CLI and CMA

### About this export

| Field | Value |
| --- | --- |
| **content_type** | lesson |
| **platform** | contentstack-academy |
| **source_url** | https://www.contentstack.com/academy/courses/contentstack-for-developers/importing-content-with-the-cli-and-cma |
| **course_slug** | contentstack-for-developers |
| **lesson_slug** | importing-content-with-the-cli-and-cma |
| **markdown_file_url** | /academy/md/courses/contentstack-for-developers/importing-content-with-the-cli-and-cma.md |
| **generated_at** | 2026-05-04T05:36:51.394Z |

> Part of **[Contentstack for Developers](https://www.contentstack.com/academy/courses/contentstack-for-developers)** on Contentstack Academy. **Academy MD v3** — structured for retrieval; no quiz or assessment keys.

<!-- ai_metadata: {"lesson_id":"20","type":"text","duration_minutes":1,"topics":["Importing","Content","with","the","CLI","and"]} -->

#### Lesson text

## Introduction to the Content Management API

Our Content Management API (CMA) is a powerful tool that provides a read/write API with a REST interface, as well as SDKs for JavaScript, .NET, and Java. To authenticate with the CMA, we use Tokens. In this exercise, we'll guide you through how to use the CMA with Postman, a popular tool that helps developers use APIs.

Let's get started with the exercise. We'll be using Postman, so first, make sure to download the latest Contentstack Postman collection from here: [https://www.contentstack.com/docs/developers/apis/content-management-api/#install-postman](https://www.contentstack.com/docs/developers/apis/content-management-api/#install-postman)

Also, download and use the Postman Environment Files from Github here: [https://github.com/contentstack/contentstack-postman-collections#environment-files](https://github.com/contentstack/contentstack-postman-collections#environment-files)

![CSforDev\_L20-img-1.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltf68a0bfc44851c8f/67dc7a8d5e486d622a71ac32/CSforDev_L20-img-1.png)

  

The next step is to create a Management Token to use in our Postman query. To do this, go to Settings in the Contentstack UI, then Tokens, Content Management, and create a Management Token. You can follow this guide for more detailed instructions: [https://www.contentstack.com/docs/developers/create-tokens/generate-a-management-token/](https://www.contentstack.com/docs/developers/create-tokens/generate-a-management-token/)

![CSforDev\_L20-img-2.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltc549d1dc354f62fb/67dc7aab983a655a2b3b7306/CSforDev_L20-img-2.png)

  

Now, **open Postman and add the Content Management API Postman Collection**. Select Content Management API - Contentstack, Entries, **Get a single entry**, and you're ready to go!

In Postman, select Content Management API - Contentstack, Entries, Get a single entry

  

**Update the API Key and Access Token**

There are two ways to set the values, using Postman variables like above or hard-coding the values in the Value column.  I prefer to use the Environment variables. [https://github.com/contentstack/contentstack-postman-collections#environment-files](https://github.com/contentstack/contentstack-postman-collections#environment-files)

1.  Set the Environment variable values for your Stack in Postman by selecting the icon in the top-right of Postman to open the Environment variable window.

Specify the following header values:  
\- **api\_key** - This is located in the Settings, Tokens, Management Token page.  You can also see it in the URL of the browser, after the /stack/ part of the URL, http://app.contentstack.com/#!/stack/{api\_key}

\- management\_token - Management token created in step 1

2.  Use the ‘Get a single entry’’ method and add the base\_url, content\_type\_uid (character) and entry uid to the query.  This will retrieve the JSON for the Entry using the backend CMA.  

**\*Note, we do not use this API for our frontend website applications as it is not intended for high load / performance.  Instead, the frontend web applications use the Content Delivery API which is tuned for high performance.**

3.  Run the query and see the JSON result.  
Notice that we have Create / Read / Update / Delete operations for most types.

  
**Using the JSON returned from the Get Entry method, we will create new JSON to use for the Create Entry method in the next exercise.**  
   
**Learn More:**  
Key Features of Management Tokens: [https://www.contentstack.com/docs/developers/create-tokens/key-features/](https://www.contentstack.com/docs/developers/create-tokens/key-features/)

## Creating content with the API:  Using the Content Management API

### Exercise:  Create an entry with the Postman API

In this exercise, we'll guide you through creating a new Entry in Contentstack programmatically using our Content Management API. This method is incredibly useful for quickly migrating content from external systems and avoiding manual entry.

The trickiest part of this process is creating well-formed JSON that contains all the properties and content for the Entry. But don't worry - we've got you covered. In the previous exercise, we used our CMA to retrieve the Entry JSON, and now we'll use a subset of that JSON to create our new Entry.

If you weren't able to retrieve the JSON Entry export in the previous exercise, we've included a sample below. Just make sure to update the UID of the Content Type for it to work.

To get started, let's create the Entry JSON required to make a new Entry. Below is an example JSON, but remember to replace the Content Type UID:

{
  "title": "New Entry Title",
  "url": "/new-entry-url",
  "description": "This is a new Entry created programmatically using the Content Management API.",
  "content\_type\_uid": "your-content-type-uid",
  "metadata": {
    "tags": \["tag1", "tag2"\],
    "author": "John Doe"
  },
  "body": "

This is the body of the new Entry.

" }

Now, in Postman, open the ‘Create an entry’ method and in the body tab, paste the JSON of the new Entry. Please note that the Title property of the Entry needs to be unique.

As we used Postman variables in the previous exercise, you won't need to add any additional settings here, since the api\_key and management token are already specified.

Finally, hit the Send button in Postman to create your new Entry. Head over to the Contentstack UI to confirm that it has been created successfully.

## Exporting Content from Contentstack

Contentstack stores all text content in JSON format.  This makes it very easy to import / export and update content using the Content Management API or the CLI.  In this section we will discuss the three ways to export content from Contentstack:  UI, CM API, and the CLI.

## Exporting with the UI

![CSforDev\_L20-img-3.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt3031a286be14c33e/67dc7af4a71458f9d3b9ac8d/CSforDev_L20-img-3.png)

##   

## [Exporting with Postman](https://www.contentstack.com/docs/developers/apis/postman-collections/)

![CSforDev\_L20-img-4.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltf85b2c24d02d5273/67dc7b2437e25afefd1e3cac/CSforDev_L20-img-4.png)

##   

## [Exporting with the CLI](https://www.contentstack.com/docs/developers/cli/export-content-using-the-cli/)

![CSforDev\_L20-img-5.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltdf993e1837922ae0/67dc7b8ec566ee36ce5df792/CSforDev_L20-img-5.png)

  

## Exporting Content from Contentstack

Contentstack stores all text content in JSON format.  This makes it very easy to import / export and update content using the Content Management API or the CLI.  In this section we will discuss the three ways to export content from Contentstack:  UI, CM API, and the CLI.

#### Exporting with the UI

![CSforDev\_L20-img-6.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt125b7f4295bb35a9/67dc7bbd632b932162d49860/CSforDev_L20-img-6.png)

#### [Exporting with Postman](https://www.contentstack.com/docs/developers/apis/postman-collections/)

![CSforDev\_L20-img-7.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt1b91f0972f174299/67dc7be7a714580b08b9ac9c/CSforDev_L20-img-7.png)

##   

#### [Exporting with the CLI](https://www.contentstack.com/docs/developers/cli/export-content-using-the-cli/)

![CSforDev\_L20-img-8.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt029257333658a4ea/67dc7c0d2d0b98a5affcfe07/CSforDev_L20-img-8.png)

#### Key takeaways

- Connect **Importing Content with the CLI and CMA** back to your stack configuration before moving to the next module.
- Capture one concrete artifact (screenshot, Postman call, or code snippet) that proves the step works in your environment.
- Re-read the delivery versus management boundary for anything you changed in the entry model.

## Supplement for indexing

### Content summary

Importing Content with the CLI and CMA. Introduction to the Content Management API Our Content Management API (CMA) is a powerful tool that provides a read/write API with a REST interface, as well as SDKs for JavaScript, .NET, and Java. To authenticate with the CMA, we use Tokens. In this exercise, we'll guide you through how to use the CMA with Postman, a popular tool that helps developers use APIs. Let's get started with the exercise. We'll be using Postman, so first, make sure to download the latest Contentstack Postman collection from here: https://www.contentstack.com/docs/developers/apis/content-management-api/ install-postman (https://www.contentstack.com/docs/developers/apis/content-management-api/ install-postman) Also, d

### Retrieval tags

- Importing
- Content
- with
- the
- CLI
- and
- contentstack-for-developers
- lesson 20
- Importing Content with the CLI and CMA
- contentstack-for-developers lesson

### Indexing notes

Index this lesson as a primary chunk tagged with lesson_id "20" and topics: [Importing, Content, with, the, CLI, and].
Parent course slug: contentstack-for-developers. Use asset_references URLs as thumbnail hints in search results when present.
Never surface LMS quiz content or assessment answers from this file.

### Asset references

| Label | URL |
| --- | --- |
| CSforDev\_L20-img-1.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltf68a0bfc44851c8f/67dc7a8d5e486d622a71ac32/CSforDev_L20-img-1.png` |
| CSforDev\_L20-img-2.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltc549d1dc354f62fb/67dc7aab983a655a2b3b7306/CSforDev_L20-img-2.png` |
| CSforDev\_L20-img-3.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt3031a286be14c33e/67dc7af4a71458f9d3b9ac8d/CSforDev_L20-img-3.png` |
| CSforDev\_L20-img-4.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltf85b2c24d02d5273/67dc7b2437e25afefd1e3cac/CSforDev_L20-img-4.png` |
| CSforDev\_L20-img-5.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltdf993e1837922ae0/67dc7b8ec566ee36ce5df792/CSforDev_L20-img-5.png` |
| CSforDev\_L20-img-6.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt125b7f4295bb35a9/67dc7bbd632b932162d49860/CSforDev_L20-img-6.png` |
| CSforDev\_L20-img-7.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt1b91f0972f174299/67dc7be7a714580b08b9ac9c/CSforDev_L20-img-7.png` |
| CSforDev\_L20-img-8.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt029257333658a4ea/67dc7c0d2d0b98a5affcfe07/CSforDev_L20-img-8.png` |

### External links

| Label | URL |
| --- | --- |
| Contentstack Academy home | `https://www.contentstack.com/academy/` |
| Training instance setup | `https://www.contentstack.com/academy/training-instance` |
| Academy playground (GitHub) | `https://github.com/contentstack/contentstack-academy-playground` |
| Contentstack documentation | `https://www.contentstack.com/docs/` |
| https://www.contentstack.com/docs/developers/apis/content-management-api/#install-postman | `https://www.contentstack.com/docs/developers/apis/content-management-api/#install-postman` |
| https://github.com/contentstack/contentstack-postman-collections#environment-files | `https://github.com/contentstack/contentstack-postman-collections#environment-files` |
| CSforDev\_L20-img-1.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltf68a0bfc44851c8f/67dc7a8d5e486d622a71ac32/CSforDev_L20-img-1.png` |
| https://www.contentstack.com/docs/developers/create-tokens/generate-a-management-token/ | `https://www.contentstack.com/docs/developers/create-tokens/generate-a-management-token/` |
| CSforDev\_L20-img-2.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltc549d1dc354f62fb/67dc7aab983a655a2b3b7306/CSforDev_L20-img-2.png` |
| https://www.contentstack.com/docs/developers/create-tokens/key-features/ | `https://www.contentstack.com/docs/developers/create-tokens/key-features/` |
| CSforDev\_L20-img-3.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt3031a286be14c33e/67dc7af4a71458f9d3b9ac8d/CSforDev_L20-img-3.png` |
| Exporting with Postman | `https://www.contentstack.com/docs/developers/apis/postman-collections/` |
| CSforDev\_L20-img-4.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltf85b2c24d02d5273/67dc7b2437e25afefd1e3cac/CSforDev_L20-img-4.png` |
| Exporting with the CLI | `https://www.contentstack.com/docs/developers/cli/export-content-using-the-cli/` |
| CSforDev\_L20-img-5.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/bltdf993e1837922ae0/67dc7b8ec566ee36ce5df792/CSforDev_L20-img-5.png` |
| CSforDev\_L20-img-6.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt125b7f4295bb35a9/67dc7bbd632b932162d49860/CSforDev_L20-img-6.png` |
| CSforDev\_L20-img-7.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt1b91f0972f174299/67dc7be7a714580b08b9ac9c/CSforDev_L20-img-7.png` |
| CSforDev\_L20-img-8.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt029257333658a4ea/67dc7c0d2d0b98a5affcfe07/CSforDev_L20-img-8.png` |
