• Cheat sheets
  • Documentation
  • API reference
  • Product updates
  • Sign in
Kontent.ai Learn
  • Try Kontent.ai
  • Plan
  • Set up
  • Model
  • Develop
  • Create
Management API v2
API Reference
    • About Management API
    • Postman collection
    • SDKs
    • Authentication
    • API keys
    • API limitations
    • Guidelines on handling changes
      • Introduction
      • Asset folders object
        Schema
      • Retrieve asset folders
        GET
      • Add asset folders
        POST
      • Modify asset folders
        PATCH

Asset folders

Asset folders organize the assets in Kontent.ai just like folders in real life or folders on your devices.

Asset folders object

Defines all asset folders within a Kontent.ai environment.
folders[]
required · array
All folders within a Kontent.ai environment.
Show child attributes
last_modified
required · string · read-only · date-time
ISO-8601 formatted date/time of the last change to the folder. 
JSON
{
  "folders": [
    {
      "id": "958001d8-2228-4373-b966-5262b5b96f71",
      "name": "Downloads",
      "codename": "downloads",
      "external_id": "folder-with-downloadable-assets",
      "folders": [
        {
          "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
          "name": "Archives",
          "codename": "archives",
          "external_id": "folder-with-downloadable-archives",
          "folders": []
        }
      ]
    },
    {
      "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
      "name": "Legal documents",
      "codename": "legal_documents",
      "external_id": "folder-documents",
      "folders": []
    }
  ],
  "last_modified": "2019-08-08T08:16:24.3620957Z"
}

Retrieve asset folders

Retrieve an array of all asset folders.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/folders

Request

Path parameters

environment_id
required · string
Identifies your environment.

Request samples

TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client.listAssetFolders().toPromise();

Response

Status (200)
All asset folders in the environment.
folders[]
required · array
All folders within a Kontent.ai environment.
Show child attributes
last_modified
required · string · read-only · date-time
ISO-8601 formatted date/time of the last change to the folder. 

Example responses

200
{
  "folders": [
    {
      "id": "958001d8-2228-4373-b966-5262b5b96f71",
      "name": "Downloads",
      "codename": "downloads",
      "external_id": "folder-with-downloadable-assets",
      "folders": [
        {
          "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
          "name": "Archives",
          "codename": "archives",
          "external_id": "folder-with-downloadable-archives",
          "folders": []
        }
      ]
    },
    {
      "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
      "name": "Legal documents",
      "codename": "legal_documents",
      "external_id": "folder-documents",
      "folders": []
    }
  ],
  "last_modified": "2019-08-08T08:16:24.3620957Z"
}

Add asset folders

Add one or more asset folders. If your environment already has folders, use modify asset folders instead.
POST
https://manage.kontent.ai/v2/projects/{environment_id}/folders

Request

Path parameters

environment_id
required · string
Identifies your environment.

Body schema

Application/json

The asset folders to add.

folders[]
required · array
All folders within a Kontent.ai environment.
Hide child attributes
external_id
string
The folder's external ID. Only present if specified via API when adding folders or modifying the folders array to add new folders.
folders[]
array
Any folders contained within the given folder.
name
required · string · 1-200 chars
The folder's name.
codename
string · nullable · 1-60 chars
The folder's codename. The codename is always returned when retrieving asset folders. If the codename is not specified when adding an asset folder, it will be generated automatically. Using the asset folder's codename is optional when you add or modify an asset folder.

Request samples

TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client
  .addAssetFolders()
  .withData({
    folders: [
      {
        id: '958001d8-2228-4373-b966-5262b5b96f71',
        name: 'Downloads',
        codename: 'downloads',
        external_id: 'folder-with-downloadable-assets',
        folders: [
          {
            id: '9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0',
            name: 'Archives',
            codename: 'archives',
            external_id: 'folder-with-downloadable-archives',
          },
        ],
      },
      {
        id: '9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0',
        name: 'Legal documents',
        external_id: 'folder-documents',
      },
    ],
  })
  .toPromise();

Response

Status (201)
The created asset folders object.
folders[]
required · array
All folders within a Kontent.ai environment.
Show child attributes
last_modified
required · string · read-only · date-time
ISO-8601 formatted date/time of the last change to the folder. 

Example responses

201
400
{
  "folders": [
    {
      "id": "958001d8-2228-4373-b966-5262b5b96f71",
      "name": "Downloads",
      "codename": "downloads",
      "external_id": "folder-with-downloadable-assets",
      "folders": [
        {
          "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
          "name": "Archives",
          "codename": "archives",
          "external_id": "folder-with-downloadable-archives",
          "folders": []
        }
      ]
    },
    {
      "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
      "name": "Legal documents",
      "codename": "legal_documents",
      "external_id": "folder-documents",
      "folders": []
    }
  ],
  "last_modified": "2019-08-08T08:16:24.3620957Z"
}

Modify asset folders

Add, rename, or remove asset folders.
PATCH
https://manage.kontent.ai/v2/projects/{environment_id}/folders

Request

Path parameters

environment_id
required · string
Identifies your environment.

Body schema

Application/json

The operations you want to perform on the folders.

array · unique items


Any of:
FolderOperationAddInto
FolderOperationRemove
FolderOperationRename
FolderOperationAddInto
op
required · string · write-only
Specifies the operation to perform.
  • addInto to add new folders
  • remove to delete folders
  • rename to rename folders
reference
object
Reference to a specific object in the environment.
The API uses internal IDs for referencing objects. This means that the reference objects in the API responses will always use internal IDs.
Show child attributes
value
required · object

Show child attributes
after
object
Reference to a specific object in the environment.
The API uses internal IDs for referencing objects. This means that the reference objects in the API responses will always use internal IDs.
Show child attributes
before
object
Reference to a specific object in the environment.
The API uses internal IDs for referencing objects. This means that the reference objects in the API responses will always use internal IDs.
Show child attributes

Request samples

Payload
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';

const client = new ManagementClient({
  environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
  apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});

const response = await client
  .modifyAssetFolders()
  .withData([
    {
      op: 'addinto',
      value: {
        external_id: 'folder-with-shared-assets',
        codename: 'shared_assets',
        name: 'Shared assets',
      },
      before: {
        external_id: 'folder-with-downloadable-assets',
      },
    },
    {
      op: 'remove',
      reference: {
        external_id: 'folder-with-downloadable-archives',
      },
    },
    {
      op: 'rename',
      value: 'Legal documents',
      reference: {
        codename: 'folder_documents',
      },
    },
  ])
  .toPromise();

Response

Status (200)
The modified asset folders.
folders[]
required · array
All folders within a Kontent.ai environment.
Show child attributes
last_modified
required · string · read-only · date-time
ISO-8601 formatted date/time of the last change to the folder. 

Example responses

200
400
{
  "folders": [
    {
      "id": "59aaaa55-1049-44bc-8785-0e327b271453",
      "name": "Shared assets",
      "external_id": "folder-with-shared-assets",
      "folders": []
    },
    {
      "id": "958001d8-2228-4373-b966-5262b5b96f71",
      "name": "Downloads",
      "external_id": "folder-with-downloadable-assets",
      "folders": [
        {
          "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
          "name": "Archives",
          "external_id": "folder-with-downloadable-archives",
          "folders": []
        }
      ]
    },
    {
      "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0",
      "name": "Legal documents",
      "external_id": "folder-documents",
      "folders": []
    }
  ],
  "last_modified": "2022-03-27T13:21:11.38Z"
}
Copyright © 2025 Kontent.ai. All rights reserved.
  • Web
  • Privacy policy
  • Cookies policy
  • Consent settings
  • Security
  • GDPR