Skip navigation

Import content items

This tutorial will guide you through importing a single content item by using the Management API. The Management API is a secure REST API that provides read/write access to your Kontent projects.

In a nutshell, to import content, you define a content type for the imported content if it's not created already. Then, you'll create a new content item and add content to its variants.

Table of contents

    If you haven't already, enable the Management API in your project before starting.

    Importing taxonomies, snippets, and content groups

    Import taxonomies, snippets, or content groups before importing content items. This tutorial continues without them for the sake of simplicity. In general, you'd add a reference to them when importing the content items.

    1. Define a content type for the content item

    Before importing your content, you need to define a content type for the items you want to import. The content type in this example will be named Cafe (with the codename and external ID both as cafe) and contain a couple of elements.

    At this moment, the .NET SDK doesn't support the Management API v2, which allows creating content types. If you're interested in using the Management API v2 capabilities in .NET, drop us a note to the related GitHub issueOpens in a new window.

    To create a content type, you have several other options:

    • Create the content type in the Kontent app.
    • Use direct API calls instead. Switch to cURL at the top of this page to see the tutorial for the direct calls.
    • Use JavaScript for the migration. Switch to JavaScript at the top of this page to see the tutorial for the JavaScript SDK.
    A screenshot of a Cafe content type.

    A Cafe content type in the Kontent app

    Using the Sample Project for the Cafe content type

    This example uses the Cafe content type from the Sample Project that comes with every subscription. If you don't have access to it, ask your subscription admin to generate it for you or create your own subscription. With the Sample Project available, you can continue with this example without the need of creating the Cafe content type.

    To add a content type, send a POST request with these properties:

    • The display name of the new content type.
    • (Optional) The codename of the content type. If you don't specify the codename, it will be generated from the content type's display name. However, you can change the code name later.
    • (Optional) The external ID, which can be used as a unique identifier to retrieve content from a different system. See more how to use different identifiers.
    • A collection of the elements you want to have in your content type.

    Don't forget to note your Management API key in the request's authorization header (or the ManagementClient definition when using an SDK).

    • JavaScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript // Using ES6 syntax import { ManagementClient, ElementModels } from '@kentico/kontent-management'; const client = new ManagementClient({ projectId: '<YOUR_PROJECT_ID>', apiKey: '<YOUR_MANAGEMENT_API_KEY>' }); client.addContentType() .withData( { codename: "cafe", name: "Cafe", external_id: "cafe", elements: [ { name: "Price per unit", type: "number", codename: "price_per_unit" }, { guidelines: "<h2>Keep Guidelines where the creative process happens.</h2>\n<p>These are sample guidelines that you can place for the whole content item. It’s a place where you can include your content brief, voice and tone recommendations or the URL to a wireframe, so the author will have all the relevant instructions at hand before writing a single line.</p>\n<p>Besides overview guidelines, you can include instructions for each particular content element, as you will see below.</p>", type: ElementModels.ElementType.guidelines, codename: "n2f836bce_e062_b2cd_5265_f5c3be3aa6f5" }, { name: "Street", type: ElementModels.ElementType.text, codename: "street" }, { name: "City", type: ElementModels.ElementType.text, codename: "city" }, { name: "Country", type: ElementModels.ElementType.text, codename: "country" }, { name: "State", type: ElementModels.ElementType.text, codename: "state" }, { name: "ZIP Code", type: ElementModels.ElementType.text, codename: "zip_code" }, { name: "Phone", type: ElementModels.ElementType.text, codename: "phone" }, { name: "Email", type: ElementModels.ElementType.text, codename: "email" }, { name: "Photo", type: ElementModels.ElementType.asset, codename: "photo" } ] } ) .toObservable() .subscribe((response) => { console.log(response); }, (error) => { console.log(error); });
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript // Using ES6 syntax import { ManagementClient, ElementModels } from '@kentico/kontent-management'; const client = new ManagementClient({ projectId: '<YOUR_PROJECT_ID>', apiKey: '<YOUR_MANAGEMENT_API_KEY>' }); client.addContentType() .withData( { codename: "cafe", name: "Cafe", external_id: "cafe", elements: [ { name: "Price per unit", type: "number", codename: "price_per_unit" }, { guidelines: "<h2>Keep Guidelines where the creative process happens.</h2>\n<p>These are sample guidelines that you can place for the whole content item. It’s a place where you can include your content brief, voice and tone recommendations or the URL to a wireframe, so the author will have all the relevant instructions at hand before writing a single line.</p>\n<p>Besides overview guidelines, you can include instructions for each particular content element, as you will see below.</p>", type: ElementModels.ElementType.guidelines, codename: "n2f836bce_e062_b2cd_5265_f5c3be3aa6f5" }, { name: "Street", type: ElementModels.ElementType.text, codename: "street" }, { name: "City", type: ElementModels.ElementType.text, codename: "city" }, { name: "Country", type: ElementModels.ElementType.text, codename: "country" }, { name: "State", type: ElementModels.ElementType.text, codename: "state" }, { name: "ZIP Code", type: ElementModels.ElementType.text, codename: "zip_code" }, { name: "Phone", type: ElementModels.ElementType.text, codename: "phone" }, { name: "Email", type: ElementModels.ElementType.text, codename: "email" }, { name: "Photo", type: ElementModels.ElementType.asset, codename: "photo" } ] } ) .toObservable() .subscribe((response) => { console.log(response); }, (error) => { console.log(error); });
    • cURL
    curl --request POST \ --url https://manage.kontent.ai/v2/projects/<YOUR_PROJECT_ID>/types \ --header 'Authorization: Bearer <YOUR_MANAGEMENT_API_KEY>' \ --header 'Content-type: application/json' \ --data ' { "codename": "cafe", "name": "Cafe", "external_id": "cafe", "elements": [ { "name": "Price per unit", "type": "number", "codename": "price_per_unit" }, { "guidelines": "<h2>Keep Guidelines where the creative process happens.</h2>\n<p>These are sample guidelines that you can place for the whole content item. It’s a place where you can include your content brief, voice and tone recommendations or the URL to a wireframe, so the author will have all the relevant instructions at hand before writing a single line.</p>\n<p>Besides overview guidelines, you can include instructions for each particular content element, as you will see below.</p>", "type": "guidelines", "codename": "n2f836bce_e062_b2cd_5265_f5c3be3aa6f5" }, { "name": "Street", "type": "text", "codename": "street" }, { "name": "City", "type": "text", "codename": "city" }, { "name": "Country", "type": "text", "codename": "country" }, { "name": "State", "type": "text", "codename": "state" }, { "name": "ZIP Code", "type": "text", "codename": "zip_code" }, { "name": "Phone", "type": "text", "codename": "phone" }, { "name": "Email", "type": "text", "codename": "email" }, { "name": "Photo", "type": "asset", "codename": "photo" } ] }'
    curl --request POST \ --url https://manage.kontent.ai/v2/projects/<YOUR_PROJECT_ID>/types \ --header 'Authorization: Bearer <YOUR_MANAGEMENT_API_KEY>' \ --header 'Content-type: application/json' \ --data ' { "codename": "cafe", "name": "Cafe", "external_id": "cafe", "elements": [ { "name": "Price per unit", "type": "number", "codename": "price_per_unit" }, { "guidelines": "<h2>Keep Guidelines where the creative process happens.</h2>\n<p>These are sample guidelines that you can place for the whole content item. It’s a place where you can include your content brief, voice and tone recommendations or the URL to a wireframe, so the author will have all the relevant instructions at hand before writing a single line.</p>\n<p>Besides overview guidelines, you can include instructions for each particular content element, as you will see below.</p>", "type": "guidelines", "codename": "n2f836bce_e062_b2cd_5265_f5c3be3aa6f5" }, { "name": "Street", "type": "text", "codename": "street" }, { "name": "City", "type": "text", "codename": "city" }, { "name": "Country", "type": "text", "codename": "country" }, { "name": "State", "type": "text", "codename": "state" }, { "name": "ZIP Code", "type": "text", "codename": "zip_code" }, { "name": "Phone", "type": "text", "codename": "phone" }, { "name": "Email", "type": "text", "codename": "email" }, { "name": "Photo", "type": "asset", "codename": "photo" } ] }'

    After making the request, you'll get a response like this:

    • JSON
    { "id": "f15799a1-dff0-5216-a014-e963f9ea6bbc", "codename": "cafe", "last_modified": "2019-10-08T12:47:27.4261844Z", "external_id": "cafe", "name": "Cafe", "content_groups": [], "elements": [ { "name": "Price per unit", "guidelines": null, "is_required": false, "type": "number", "id": "965cf18c-998a-456b-bee3-91defdf39782", "codename": "price_per_unit" }, { "guidelines": "<h2>Keep Guidelines where the creative process happens.</h2>\n<p>These are sample guidelines that you can place for the whole content item. It’s a place where you can include your content brief, voice and tone recommendations or the URL to a wireframe, so the author will have all the relevant instructions at hand before writing a single line.</p>\n<p>Besides overview guidelines, you can include instructions for each particular content element, as you will see below.</p>", "type": "guidelines", "id": "8816e7d0-ca5e-4cfa-88b4-c1944862ff9f", "codename": "n8e317a38_e3bc_4d98_a63d_f1e336c5a9e6" }, { "maximum_text_length": null, "name": "Street", "guidelines": null, "is_required": false, "type": "text", "id": "2b7b256c-73cc-4be0-b749-4c410209df02", "codename": "street" }, { "maximum_text_length": null, "name": "City", "guidelines": null, "is_required": false, "type": "text", "id": "fa17f73a-833c-4cf2-aa7b-3b5c4edad6b3", "codename": "city" }, { "maximum_text_length": null, "name": "Country", "guidelines": null, "is_required": false, "type": "text", "id": "2b36b05e-5f4f-4630-b502-154f5b3b90c3", "codename": "country" }, { "maximum_text_length": null, "name": "State", "guidelines": null, "is_required": false, "type": "text", "id": "3638f2cd-3fea-4a4e-a6b6-bdd39f3b9f66", "codename": "state" }, { "maximum_text_length": null, "name": "ZIP Code", "guidelines": null, "is_required": false, "type": "text", "id": "35ad677a-cfe5-4573-814d-5895e3de8396", "codename": "zip_code" }, { "maximum_text_length": null, "name": "Phone", "guidelines": null, "is_required": false, "type": "text", "id": "4ec54355-4177-4b29-9a16-b25a7c8fba26", "codename": "phone" }, { "maximum_text_length": null, "name": "Email", "guidelines": null, "is_required": false, "type": "text", "id": "9bc4b679-4353-40c7-bcfd-145110ced7d9", "codename": "email" }, { "asset_count_limit": null, "maximum_file_size": null, "allowed_file_types": "any", "image_width_limit": null, "image_height_limit": null, "name": "Photo", "guidelines": null, "is_required": false, "type": "asset", "id": "1693ecd3-fb15-4d56-975a-4b8dbdedf65b", "codename": "photo" } ] }
    { "id": "f15799a1-dff0-5216-a014-e963f9ea6bbc", "codename": "cafe", "last_modified": "2019-10-08T12:47:27.4261844Z", "external_id": "cafe", "name": "Cafe", "content_groups": [], "elements": [ { "name": "Price per unit", "guidelines": null, "is_required": false, "type": "number", "id": "965cf18c-998a-456b-bee3-91defdf39782", "codename": "price_per_unit" }, { "guidelines": "<h2>Keep Guidelines where the creative process happens.</h2>\n<p>These are sample guidelines that you can place for the whole content item. It’s a place where you can include your content brief, voice and tone recommendations or the URL to a wireframe, so the author will have all the relevant instructions at hand before writing a single line.</p>\n<p>Besides overview guidelines, you can include instructions for each particular content element, as you will see below.</p>", "type": "guidelines", "id": "8816e7d0-ca5e-4cfa-88b4-c1944862ff9f", "codename": "n8e317a38_e3bc_4d98_a63d_f1e336c5a9e6" }, { "maximum_text_length": null, "name": "Street", "guidelines": null, "is_required": false, "type": "text", "id": "2b7b256c-73cc-4be0-b749-4c410209df02", "codename": "street" }, { "maximum_text_length": null, "name": "City", "guidelines": null, "is_required": false, "type": "text", "id": "fa17f73a-833c-4cf2-aa7b-3b5c4edad6b3", "codename": "city" }, { "maximum_text_length": null, "name": "Country", "guidelines": null, "is_required": false, "type": "text", "id": "2b36b05e-5f4f-4630-b502-154f5b3b90c3", "codename": "country" }, { "maximum_text_length": null, "name": "State", "guidelines": null, "is_required": false, "type": "text", "id": "3638f2cd-3fea-4a4e-a6b6-bdd39f3b9f66", "codename": "state" }, { "maximum_text_length": null, "name": "ZIP Code", "guidelines": null, "is_required": false, "type": "text", "id": "35ad677a-cfe5-4573-814d-5895e3de8396", "codename": "zip_code" }, { "maximum_text_length": null, "name": "Phone", "guidelines": null, "is_required": false, "type": "text", "id": "4ec54355-4177-4b29-9a16-b25a7c8fba26", "codename": "phone" }, { "maximum_text_length": null, "name": "Email", "guidelines": null, "is_required": false, "type": "text", "id": "9bc4b679-4353-40c7-bcfd-145110ced7d9", "codename": "email" }, { "asset_count_limit": null, "maximum_file_size": null, "allowed_file_types": "any", "image_width_limit": null, "image_height_limit": null, "name": "Photo", "guidelines": null, "is_required": false, "type": "asset", "id": "1693ecd3-fb15-4d56-975a-4b8dbdedf65b", "codename": "photo" } ] }

    2. Import content to a content item

    Importing a content item consists of two tasks. That's because, technically, each content item is a wrapper that contains variants. Variants then hold the content. This enables content to be localized but the same approach applies to projects with one language as well.

    A model of a content item.

    What content items consist of

    2a. Create a content item

    To add a content item, send a PUT request with these properties:

    • The name, which is a string representing the display name of the new content item.
    • The codename of the content type, which is used for the content item.

    As importing a lot of content can become confusing, handling content from your original system's point of view is typically easier. Use the external ID to identify your content, which is especially suitable for migration.

    With external IDs, you can also reference items that haven't been imported yet. That's when content items link each other in rich text or linked items elements. You don't need to worry about the order in which the content items are imported.

    However, if you don't want to use external IDs, you can use other identifiers as well.

    • JavaScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript // Using ES6 syntax import { ManagementClient } from '@kentico/kontent-management'; const client = new ManagementClient({ projectId: '<YOUR_PROJECT_ID>', apiKey: '<YOUR_MANAGEMENT_API_KEY>' }); client.upsertContentItem() .byItemExternalId('ext-cafe-brno') .withData( { name: 'Brno', type: 'cafe' } ) .toObservable() .subscribe((response) => { console.log(response); }, (error) => { console.log(error); });
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript // Using ES6 syntax import { ManagementClient } from '@kentico/kontent-management'; const client = new ManagementClient({ projectId: '<YOUR_PROJECT_ID>', apiKey: '<YOUR_MANAGEMENT_API_KEY>' }); client.upsertContentItem() .byItemExternalId('ext-cafe-brno') .withData( { name: 'Brno', type: 'cafe' } ) .toObservable() .subscribe((response) => { console.log(response); }, (error) => { console.log(error); });
    • C#
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net // Using Management API v1 using Kentico.Kontent.Management; ManagementOptions options = new ManagementOptions() { ApiKey = "<YOUR_MANAGEMENT_API_KEY>", ProjectId = "<YOUR_PROJECT_ID>" }; ManagementClient client = new ManagementClient(options); ContentItemUpsertModel item = new ContentItemUpsertModel() { Name = "Brno", Type = ContentTypeIdentifier.ByCodename("cafe") }; ContentItemModel responseItem = await client.UpsertContentItemByExternalIdAsync("ext-cafe-brno", item);
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net // Using Management API v1 using Kentico.Kontent.Management; ManagementOptions options = new ManagementOptions() { ApiKey = "<YOUR_MANAGEMENT_API_KEY>", ProjectId = "<YOUR_PROJECT_ID>" }; ManagementClient client = new ManagementClient(options); ContentItemUpsertModel item = new ContentItemUpsertModel() { Name = "Brno", Type = ContentTypeIdentifier.ByCodename("cafe") }; ContentItemModel responseItem = await client.UpsertContentItemByExternalIdAsync("ext-cafe-brno", item);
    • cURL
    curl --request PUT \ --url https://manage.kontent.ai/v2/projects/<YOUR_PROJECT_ID>/items/external-id/ext-cafe-brno \ --header 'Authorization: Bearer <YOUR_MANAGEMENT_API_KEY>' \ --header 'Content-type: application/json' \ --data ' { "name": "Brno", "type": { "codename": "cafe" } }'
    curl --request PUT \ --url https://manage.kontent.ai/v2/projects/<YOUR_PROJECT_ID>/items/external-id/ext-cafe-brno \ --header 'Authorization: Bearer <YOUR_MANAGEMENT_API_KEY>' \ --header 'Content-type: application/json' \ --data ' { "name": "Brno", "type": { "codename": "cafe" } }'

    Why PUT is better than POST

    Besides the PUT request from the example, you can also use a POST request. However, using a PUT operation has its advantages and makes the import process much smoother. With PUT requests, you can:

    • Run the same request repeatedly – If the item doesn't exist, it will be created. If it does, it will be updated.
    • Reference your items with external IDs

    You can find out more about both topics in the API reference on upserting content items.

    After sending the request, Kontent generates the internal ID and codename for the content item and includes it in the response.

    • JSON
    { "id":"8ceeb2d8-9676-48ae-887d-47ccb0f54a79", "name":"Brno", "codename":"brno", "type":{ "id":"fe41ae5a-5fe2-420a-8560-f7d6d3533dc2" }, "sitemap_locations":[], "external_id": "ext-cafe-brno", "last_modified":"2017-11-09T16:51:09.041611Z" }
    { "id":"8ceeb2d8-9676-48ae-887d-47ccb0f54a79", "name":"Brno", "codename":"brno", "type":{ "id":"fe41ae5a-5fe2-420a-8560-f7d6d3533dc2" }, "sitemap_locations":[], "external_id": "ext-cafe-brno", "last_modified":"2017-11-09T16:51:09.041611Z" }

    You've just created an empty content item. To verify that the content item has been added, you have two options:

    Content-less imported content item displayed as 'Not translated'.

    The created item will show up as Not translated inside your project.

    So far, you have only specified the general attributes of the content item – its name, content type, and external ID. Now, let's add the actual (localized) content.

    2b. Add (localized) content

    The actual content is stored in the values of individual content elements in each variant. To add content there, send a PUT request with these properties:

    • The content item you're importing content to – ideally with its external ID. For example, ext-cafe-brno.
    • The language's code name – available in > Localization. For example, en-US.
    A screenshot of where you can copy a language codename in the UI.
    • Elements with content that you want to import. Omitted elements will:
      • Remain empty when creating new content
      • Remain unchanged when updating already existing content
      • Generate automatically if they're URL slugs
    • JavaScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript // Using ES6 syntax import { ManagementClient } from '@kentico/kontent-management'; const client = new ManagementClient({ projectId: '<YOUR_PROJECT_ID>', apiKey: '<YOUR_MANAGEMENT_API_KEY>' }); client.upsertLanguageVariant() .byItemExternalId('ext-cafe-brno') .byLanguageCodename('en-US') .withElements([ { element: { codename: 'street' }, value: 'Nove Sady 25' }, { element: { codename: 'city' }, value: 'Brno' }, { element: { codename: 'country' }, value: 'Czech Republic' }, { element: { codename: 'state' }, value: 'Jihomoravsky kraj' }, { element: { codename: 'zip_code' }, value: '60200' }, { element: { codename: 'phone' }, value: '+420 555 555 555' }, { element: { codename: 'email' }, value: 'brnocafe@kontent.ai' } ]) .toObservable() .subscribe((response) => { console.log(response); }, (error) => { console.log(error); });
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript // Using ES6 syntax import { ManagementClient } from '@kentico/kontent-management'; const client = new ManagementClient({ projectId: '<YOUR_PROJECT_ID>', apiKey: '<YOUR_MANAGEMENT_API_KEY>' }); client.upsertLanguageVariant() .byItemExternalId('ext-cafe-brno') .byLanguageCodename('en-US') .withElements([ { element: { codename: 'street' }, value: 'Nove Sady 25' }, { element: { codename: 'city' }, value: 'Brno' }, { element: { codename: 'country' }, value: 'Czech Republic' }, { element: { codename: 'state' }, value: 'Jihomoravsky kraj' }, { element: { codename: 'zip_code' }, value: '60200' }, { element: { codename: 'phone' }, value: '+420 555 555 555' }, { element: { codename: 'email' }, value: 'brnocafe@kontent.ai' } ]) .toObservable() .subscribe((response) => { console.log(response); }, (error) => { console.log(error); });
    • C#
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net // Using Management API v1 using Kentico.Kontent.Management; ManagementOptions options = new ManagementOptions() { ApiKey = "<YOUR_MANAGEMENT_API_KEY>", ProjectId = "<YOUR_PROJECT_ID>" }; ManagementClient client = new ManagementClient(options); // Elements to update CafeContentTypeModel stronglyTypedElements = new CafeContentTypeModel() { Street = "Nove Sady 25", City = "Brno", Country = "Czech Republic", State = "Jihomoravsky kraj", ZipCode = "60200", Phone = "+420 555 555 555", Email = "brnocafe@kontent.ai" }; ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByExternalId("ext-cafe-brno"); LanguageIdentifier languageIdentifier = LanguageIdentifier.ByCodename("en-US"); ContentItemVariantIdentifier identifier = new ContentItemVariantIdentifier(itemIdentifier, languageIdentifier); ContentItemVariantModel<CafeContentTypeModel> responseVariant = await client.UpsertContentItemVariantAsync<CafeContentTypeModel>(identifier, stronglyTypedElements);
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net // Using Management API v1 using Kentico.Kontent.Management; ManagementOptions options = new ManagementOptions() { ApiKey = "<YOUR_MANAGEMENT_API_KEY>", ProjectId = "<YOUR_PROJECT_ID>" }; ManagementClient client = new ManagementClient(options); // Elements to update CafeContentTypeModel stronglyTypedElements = new CafeContentTypeModel() { Street = "Nove Sady 25", City = "Brno", Country = "Czech Republic", State = "Jihomoravsky kraj", ZipCode = "60200", Phone = "+420 555 555 555", Email = "brnocafe@kontent.ai" }; ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByExternalId("ext-cafe-brno"); LanguageIdentifier languageIdentifier = LanguageIdentifier.ByCodename("en-US"); ContentItemVariantIdentifier identifier = new ContentItemVariantIdentifier(itemIdentifier, languageIdentifier); ContentItemVariantModel<CafeContentTypeModel> responseVariant = await client.UpsertContentItemVariantAsync<CafeContentTypeModel>(identifier, stronglyTypedElements);
    • cURL
    curl --request PUT \ --url https://manage.kontent.ai/v2/projects/<YOUR_PROJECT_ID>/items/external-id/ext-cafe-brno/variants/codename/en-US \ --header 'authorization: Bearer <YOUR_MANAGEMENT_API_KEY>' \ --header 'content-type: application/json' \ --data ' { "elements": [ { "element": { codename: "street" }, "value": "Nove Sady 25" }, { "element": { codename: "city" }, "value": "Brno" }, { "element": { codename: "country" }, "value": "Czech Republic" }, { "element": { codename: "state" }, "value": "Jihomoravsky kraj" }, { "element": { codename: "zip_code" }, "value": "60200" }, { "element": { codename: "phone" }, "value": "+420 555 555 555" }, { "element": { codename: "email" }, "value": "brnocafe@kontent.ai" } ] }'
    curl --request PUT \ --url https://manage.kontent.ai/v2/projects/<YOUR_PROJECT_ID>/items/external-id/ext-cafe-brno/variants/codename/en-US \ --header 'authorization: Bearer <YOUR_MANAGEMENT_API_KEY>' \ --header 'content-type: application/json' \ --data ' { "elements": [ { "element": { codename: "street" }, "value": "Nove Sady 25" }, { "element": { codename: "city" }, "value": "Brno" }, { "element": { codename: "country" }, "value": "Czech Republic" }, { "element": { codename: "state" }, "value": "Jihomoravsky kraj" }, { "element": { codename: "zip_code" }, "value": "60200" }, { "element": { codename: "phone" }, "value": "+420 555 555 555" }, { "element": { codename: "email" }, "value": "brnocafe@kontent.ai" } ] }'

    The response will include the updated item variant.

    • JSON
    { "item":{ "id":"8ceeb2d8-9676-48ae-887d-47ccb0f54a79" }, "elements":{ "street":"Nove Sady 25", "city":"Brno", "country":"Czech Republic", "state":"Jihomoravsky kraj", "zip_code":"60200", "phone":"+420 555 555 555", "email":"brnocafe@kontent.ai", "photo": [] }, "language":{ "id":"00000000-0000-0000-0000-000000000000" }, "last_modified":"2017-11-14T09:10:48.4469012Z" }
    { "item":{ "id":"8ceeb2d8-9676-48ae-887d-47ccb0f54a79" }, "elements":{ "street":"Nove Sady 25", "city":"Brno", "country":"Czech Republic", "state":"Jihomoravsky kraj", "zip_code":"60200", "phone":"+420 555 555 555", "email":"brnocafe@kontent.ai", "photo": [] }, "language":{ "id":"00000000-0000-0000-0000-000000000000" }, "last_modified":"2017-11-14T09:10:48.4469012Z" }

    To verify that the variant has been imported, you have two options:

    • Retrieve variants of the item using the Management API.
    • Check your content listing in Kentico Kontent.
    A screenshot of a Brno content item.

    Avoid security incidents

    After you finish importing content, consider deactivating the Management API if you don’t plan on using the API further.

    What's next?

    In this tutorial, you've imported a set of plain text content elements into a new content item. You can use the same process to import any number of more complex content items.