---
title: "Asset"
description: "Asset"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/python/reference/asset"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-22"
---

# Asset

## Asset

[](/docs/administration/about-organizations)[Assets](https://www.contentstack.com/docs/headless-cms/about-assets) refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use. These files can be attached and used in multiple entries.

## create_folder

The create\_folder method creates a new asset folder and/or adds a parent folder to it in a particular stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
    >>>     "asset": {
        >>>         "name": "Demo"
    >>>     }
}
asset = client().stack(api_key='api_key').assets()
response = asset.create_folder(data)
```

The data you want to send to the server when creating a folder.

## delete_folder

The delete\_folder method removes an existing asset folder along with all the assets within that folder.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.delete(folder_uid='folder_uid')
```

The UID of the folder you want to delete

## delete

The delete method removes an existing asset from the stack.

```
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.delete("asset_uid")
```

UID of the asset

## download

The download method lets you save the specific asset in your local storage.

```
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.download()
```

UID of the asset

## fetch

The fetch method retrieves the details of a specific version of a particular asset

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.fetch("asset_uid")
```

UID of the asset

When true, includes the \_asset\_scan\_status field in the asset response (pending, clean, quarantined, or not\_scanned). Opt-in; omitted from the request by default.

## find

The find method retrieves the details of all assets in a stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.find()
```

When true, includes the \_asset\_scan\_status field in the asset response (pending, clean, quarantined, or not\_scanned). Opt-in; omitted from the request by default.

## folder

The folder method retrieves the details of a specific asset folder in the stack using the folder UID.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.folder_collection(folder_uid='folder_uid')
```

UID of the folder

## folder_by_name

The folder\_by\_name method retrieves the details of a specific asset folder in the stack using the folder name.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

query = {"is_dir": True, "name": "folder_name"}
asset = client().stack(api_key='api_key').assets()
response = asset.folder_collection(query)
```

The search query for the folder

## generate

The generate method allows you to generate a permanent asset URL for the specific asset.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
   "asset": {
       "permanent_url": "https://images.contentstack.io/v3/assets/stack_api_key/asset_UID/sample-slug.jpeg"
       }
   } 
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.generate(data)
```

The data to be sent in the request body

## get_subfolders

The get\_subfolders method retrieves the details of only the subfolder within a specific asset folder in the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

query = {"is_dir": True}
asset = client().stack(api_key='api_key').assets()
response = asset.folder_collection(folder_uid='folder_uid', query)
```

The UID of the folder

The search query for the folder

## publish

The publish method allows you to publish a specific version of the asset on the required environment either immediately or at a later time/date.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
         "asset": {
                 "locales": [
                         "en-us"
                 ],
                 "environments": [
                         "development"
                 ]
         },
         "version": 1,
         "scheduled_at": "2019-02-08T18:30:00.000Z"
}
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.publish(data)
```

The data that you want to publish.

## references

The references method retrieves the details of the entries and content types in which a specific asset is referenced.

```
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.references()
```

UID of the asset

## replace

The replace method allows you to replace an existing asset with another file in the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

file_path = ""
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.replace(file_path)
```

The path to the file that you want to replace the existing asset with.

## rte

The rte method retrieves the details of all the assets uploaded through the [Rich Text Editor](https://www.contentstack.com/docs/headless-cms/rich-text-editor) field.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.rte()
```

## specific_asset_type

The specific\_asset\_type method retrieves the assets based on the query request.

```
client = contentstack_management.Client(authtoken="authtoken")

asset_type = "images"
asset = client().stack(api_key='api_key').assets()
response = asset.specific_asset_type(asset_type)
```

The type of asset you want to retrieve

## specific_folder

The specific\_folder method retrieves the details of assets of a specific asset folder without the subfolders in the requested parent folder.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.specific_folder("folder_uid")
```

UID of the folder

## subfolder

The subfolder method retrieves the details of assets and subfolders of a specific parent folder.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets()
response = asset.subfolders("folder_uid")
```

UID of the folder

## unpublish

The unpublish method allows you to unpublish a specific version of an asset from a desired environment.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
         "asset": {
                 "locales": [
                         "en-us"
                 ],
                 "environments": [
                         "development"
                ]
         },
         "version": 1,
         "scheduled_at": "2019-02-08T18:30:00.000Z"
}
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.unpublish(data)
```

The data you want to send to server for the unpublish operation

## update

The update method allows you to make changes in the title and description of an existing asset in the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
         "asset": {
                 "title": "Title"
         }
}
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.update(data)
```

The updated information for the asset

## update_asset_revision

The update\_asset\_revision method upgrades the specified version of the asset to the latest version.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
         "asset": {
                 "title": "Title",
                 "description": "Description"
         },
         "version": 2
}
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.update_asset_revision(data)
```

The updated information for the asset

## update_or_move

The update\_or\_move method allows you to either update the details of a folder or set the folder as a parent folder if you want to move a folder under another folder.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

data = {
         "asset": {
                 "name": "Demo"
         }
}
asset = client().stack(api_key='api_key').assets()
response = asset.update_or_move(folder_uid='folder_uid', data)
```

UID of the folder

The request body

## upload

The upload method allows you to upload an asset file in the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

file_path = ""
asset = client().stack(api_key='api_key').assets()
response = asset.upload(file_path)
```

The path to the file you want to upload

## version

The version method retrieves the details of all versions of an asset.

```
client = contentstack_management.Client(authtoken="authtoken")

asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.version()
```

UID of the asset

## version_delete

The version\_delete method allows you to remove the name of a specific version of an asset and resets it to the version number.

```
client = contentstack_management.Client(authtoken="authtoken")

version_number = 1
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.version_delete(version_number)
```

The version of the asset you want to delete

## version_naming

The version\_naming method allows you to assign a name to a specific version of an asset.

```
import contentstack_management
client = contentstack_management.Client(authtoken="authtoken")

version_number = 1
data = {
         "upload": {
             "_version_name": "Version name"
         }
}
asset = client().stack(api_key='api_key').assets(asset_uid='asset_uid')
response = asset.version_naming(version_number, data)
```

The information you want to update for the specified version

The version of the asset you want to delete

## Asset | Python Management SDK | Contentstack

Asset represents media files such as images, videos, and PDFs uploaded to your repository, in the Python Management SDK.