---
title: "Assets"
description: "<p>Upload, retrieve, update, delete, move, trash, and restore digital assets.</p>"
url: "https://www.contentstack.com/docs/developers/apis/assets-api/assets"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-08-21"
---

# Assets

Upload, retrieve, update, delete, move, trash, and restore digital assets.

## Upload an asset

### Upload an asset

**POST** `/api/spaces/{space_uid}/assets`

The Upload an asset request adds a new asset to the specified space. Send the request as multipart/form-data with the binary file in the asset\[upload\] part and any metadata in the accompanying fields. The maximum file size is 5 GB.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string",
  "asset": {
    "_id": "string",
    "uid": "string",
    "object_type": "string",
    "title": "string",
    "description": "string",
    "file_name": "string",
    "parent_uid": "string",
    "path": [
      {
        "uid": "string",
        "title": "string"
      }
    ],
    "owner_uid": "string",
    "co_owners": [
      {
        "uid": "string",
        "name": "string"
      }
    ],
    "permanent_url": "string",
    "permanent_url_slug": "string",
    "content_type": "string",
    "asset_type_uid": "string",
    "file_size": 0,
    "tags": [
      "string"
    ],
    "is_dir": true,
    "asset_id": "string",
    "url": "string",
    "locale": "string",
    "dimensions": {
      "height": 0,
      "width": 0
    },
    "status": "IN_PROGRESS",
    "version": 0,
    "org_uid": "string",
    "space_uid": "string",
    "user_defined_fields": {},
    "visual_markups": [
      {
        "type": "Hotspot",
        "title": "string",
        "description": "string",
        "url": "http://example.com",
        "coordinates": {
          "x": 0,
          "y": 0,
          "width": 0,
          "height": 0
        }
      }
    ],
    "publish_details": [
      {
        "locale": "string",
        "environment": "string",
        "time": "2019-08-24T14:15:22Z",
        "user": "string",
        "version": 0,
        "action": "string",
        "job_id": "string",
        "scheduled_at": "2019-08-24T14:15:22Z",
        "workspace_uid": "string",
        "origin": "string"
      }
    ],
    "_version_name": {
      "title": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "updated_by": "string"
    },
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "is_deleted": true
  }
}
```

## Get all assets

### Get all assets

**GET** `/api/spaces/{space_uid}/assets`

The Get all assets request fetches a paginated list of all assets in the specified space. Use the query parameters to filter, sort, paginate, and control what each asset returns.

Pass locale to read the assets in a specific language. Where an asset has not been localized into that language, fallback\_locales decides what comes back: each asset falls back through the languages you list, in the order you list them, so a partly localized library still returns a complete set of results rather than gaps.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **skip** (optional)
  The skip parameter skips a specific number of items in the output. For example, if there are 20 items and you want to skip the first 2 to get only the last 18 in the response body, specify 2 here.
- **limit** (optional)
  The limit parameter returns a specific number of items (between 0 and 100) in your response based on the value you provide.
- **sort** (optional)
  Enter the field name to sort the results by, such as created\_at or title.
- **order** (optional)
  Enter the sort order of the results. Accepted values are asc for ascending and desc for descending.
- **search_text** (optional)
  Enter the text to search for across the assets in the space.
- **search_field** (optional)
  Enter the field name to restrict the search\_text lookup to a single field, such as title or file\_name.
- **locale** (optional)
  Enter the locale code, such as en-us, to fetch the assets in a specific locale. Defaults to the master locale of the space.
- **fallback_locales** (optional)
  Enter one or more locale codes to use as fallbacks when an asset is not localized in the requested locale.
- **parent_uid** (optional)
  Enter the uid of the parent folder to fetch only the assets within that folder.
- **workspace** (optional)
  Enter the uid of the workspace to scope the results to a single workspace.
- **asset_fields** (optional)
  Enter the names of the asset fields to include in the response. Limits the payload to only the fields you specify.
- **exclude_uids** (optional)
  Enter the uid values of the assets to exclude from the response.
- **include_space** (optional)
  Set to true to include the parent space details in the response. Default is false.
- **include_acl** (optional)
  Set to true to include the access control list (ACL) of each asset in the response. Default is false.
- **include_asset_type_schema** (optional)
  Set to true to include the schema of the asset type associated with each asset. Default is false.
- **include_publish_details** (optional)
  Set to true to include the publish details of each asset in the response. Default is false.
- **deleted** (optional)
  Set to true to include soft-deleted assets in the response. Default is false.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "count": 0,
  "relation": "string",
  "assets": [
    {
      "_id": "string",
      "uid": "string",
      "object_type": "string",
      "title": "string",
      "description": "string",
      "file_name": "string",
      "parent_uid": "string",
      "path": [
        {
          "uid": "string",
          "title": "string"
        }
      ],
      "owner_uid": "string",
      "co_owners": [
        {
          "uid": "string",
          "name": "string"
        }
      ],
      "permanent_url": "string",
      "permanent_url_slug": "string",
      "content_type": "string",
      "asset_type_uid": "string",
      "file_size": 0,
      "tags": [
        "string"
      ],
      "is_dir": true,
      "asset_id": "string",
      "url": "string",
      "locale": "string",
      "dimensions": {
        "height": 0,
        "width": 0
      },
      "status": "IN_PROGRESS",
      "version": 0,
      "org_uid": "string",
      "space_uid": "string",
      "user_defined_fields": {},
      "visual_markups": [
        {
          "type": "Hotspot",
          "title": "string",
          "description": "string",
          "url": "http://example.com",
          "coordinates": {
            "x": 0,
            "y": 0,
            "width": 0,
            "height": 0
          }
        }
      ],
      "publish_details": [
        {
          "locale": "string",
          "environment": "string",
          "time": "2019-08-24T14:15:22Z",
          "user": "string",
          "version": 0,
          "action": "string",
          "job_id": "string",
          "scheduled_at": "2019-08-24T14:15:22Z",
          "workspace_uid": "string",
          "origin": "string"
        }
      ],
      "_version_name": {
        "title": "string",
        "updated_at": "2019-08-24T14:15:22Z",
        "updated_by": "string"
      },
      "created_by": "string",
      "updated_by": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "is_deleted": true
    }
  ]
}
```

## Bulk move assets

### Bulk move assets

**POST** `/api/spaces/{space_uid}/assets/bulk-move`

The Bulk move assets request moves multiple assets to a target folder in a single operation.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string"
}
```

## Bulk delete assets

### Bulk delete assets

**POST** `/api/spaces/{space_uid}/assets/bulk/delete`

The Bulk delete assets request starts an asynchronous job to delete multiple assets. The response returns a job\_id immediately, and the deletion runs in the background. Use the job\_id to track the status of the job. The operation supports partial success, so some assets in the request may fail while others succeed.  
  

##### Delete assets in specific locales:

```
{
  "assets": [
    {
      "locale": "en-us",
      "uid": "blt1234567890abcdef"
    },
    {
      "locale": "fr-fr",
      "uid": "blt2345678901bcdefg"
    }
  ]
}
```

undefined

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "Your bulk delete request is in progress. Please check bulk task queue for more details.",
  "job_id": "cs-a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

## Get trashed assets

### Get trashed assets

**POST** `/api/spaces/{space_uid}/assets/trash`

The Get trashed assets request fetches the assets currently in the trash, also known as the bin. Pass a query payload in the request body to filter, sort, and paginate the results.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "assets": [
    {
      "_id": "string",
      "uid": "string",
      "object_type": "string",
      "title": "string",
      "description": "string",
      "file_name": "string",
      "parent_uid": "string",
      "path": [
        {
          "uid": "string",
          "title": "string"
        }
      ],
      "owner_uid": "string",
      "co_owners": [
        {
          "uid": "string",
          "name": "string"
        }
      ],
      "permanent_url": "string",
      "permanent_url_slug": "string",
      "content_type": "string",
      "asset_type_uid": "string",
      "file_size": 0,
      "tags": [
        "string"
      ],
      "is_dir": true,
      "asset_id": "string",
      "url": "string",
      "locale": "string",
      "dimensions": {
        "height": 0,
        "width": 0
      },
      "status": "IN_PROGRESS",
      "version": 0,
      "org_uid": "string",
      "space_uid": "string",
      "user_defined_fields": {},
      "visual_markups": [
        {
          "type": "Hotspot",
          "title": "string",
          "description": "string",
          "url": "http://example.com",
          "coordinates": {
            "x": 0,
            "y": 0,
            "width": 0,
            "height": 0
          }
        }
      ],
      "publish_details": [
        {
          "locale": "string",
          "environment": "string",
          "time": "2019-08-24T14:15:22Z",
          "user": "string",
          "version": 0,
          "action": "string",
          "job_id": "string",
          "scheduled_at": "2019-08-24T14:15:22Z",
          "workspace_uid": "string",
          "origin": "string"
        }
      ],
      "_version_name": {
        "title": "string",
        "updated_at": "2019-08-24T14:15:22Z",
        "updated_by": "string"
      },
      "created_by": "string",
      "updated_by": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "is_deleted": true
    }
  ],
  "count": 0,
  "relation": "eq"
}
```

## Restore a deleted asset

### Restore a deleted asset

**PUT** `/api/spaces/{space_uid}/assets/{asset_uid}/restore`

The Restore a deleted asset request restores a soft-deleted asset from the trash, also known as the bin, back to the space.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **asset_uid** (required)
  Enter the uid of the asset that you want to retrieve.

#### Query Parameters

- **locale** (optional)
  Enter the locale code, such as en-us, of the asset you want to restore. Defaults to the master locale of the space.
- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string",
  "asset": {
    "_id": "string",
    "uid": "string",
    "object_type": "string",
    "title": "string",
    "description": "string",
    "file_name": "string",
    "parent_uid": "string",
    "path": [
      {
        "uid": "string",
        "title": "string"
      }
    ],
    "owner_uid": "string",
    "co_owners": [
      {
        "uid": "string",
        "name": "string"
      }
    ],
    "permanent_url": "string",
    "permanent_url_slug": "string",
    "content_type": "string",
    "asset_type_uid": "string",
    "file_size": 0,
    "tags": [
      "string"
    ],
    "is_dir": true,
    "asset_id": "string",
    "url": "string",
    "locale": "string",
    "dimensions": {
      "height": 0,
      "width": 0
    },
    "status": "IN_PROGRESS",
    "version": 0,
    "org_uid": "string",
    "space_uid": "string",
    "user_defined_fields": {},
    "visual_markups": [
      {
        "type": "Hotspot",
        "title": "string",
        "description": "string",
        "url": "http://example.com",
        "coordinates": {
          "x": 0,
          "y": 0,
          "width": 0,
          "height": 0
        }
      }
    ],
    "publish_details": [
      {
        "locale": "string",
        "environment": "string",
        "time": "2019-08-24T14:15:22Z",
        "user": "string",
        "version": 0,
        "action": "string",
        "job_id": "string",
        "scheduled_at": "2019-08-24T14:15:22Z",
        "workspace_uid": "string",
        "origin": "string"
      }
    ],
    "_version_name": {
      "title": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "updated_by": "string"
    },
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "is_deleted": true
  }
}
```

## Update an asset

### Update an asset

**PUT** `/api/spaces/{space_uid}/assets/{asset_uid}`

The Update an asset request updates an existing asset. Send multipart/form-data to replace the file, or a JSON body to change metadata only.

Rename an asset with title and description, and move it into another folder with parent\_uid.

Classify it with tags, which replaces the whole tag list rather than appending to it, and with user\_defined\_fields, which carries the values for the custom fields defined on the asset type.

Change how the asset is presented with transformations, which applies image transformations, and visual\_markups, which carries annotation data.

Pass version to guard against overwriting a concurrent change. The request fails with 409 if the asset moved on since you read it. Omit it only when a last-write-wins update is acceptable.

Pass locale to work in a specific language. Updating an asset in a language it has not been localized into yet creates a localized variant: from that point the variant keeps its own title, description, tags, user-defined fields, and file, and it stops inheriting changes made to the default language. Omit locale to work in the default language of the space.  
  

##### Move into another folder:

```
{
  "parent_uid": "amf1c92a9269cfda09"
}
```

undefined  
  

##### Replace the tag list:

```
{
  "tags": [
    "campaign",
    "q4",
    "approved"
  ]
}
```

undefined  
  

##### Set custom metadata field values:

```
{
  "user_defined_fields": {
    "expires_on": "2027-01-31",
    "photographer": "A. Kumar",
    "usage_rights": "web-only"
  }
}
```

undefined  
  

##### Guard against a concurrent change:

```
{
  "title": "Q4 hero banner v2",
  "version": 7
}
```

undefined

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **asset_uid** (required)
  Enter the uid of the asset that you want to retrieve.

#### Query Parameters

- **locale** (optional)
  Enter the locale code, such as en-us, of the asset you want to update. Defaults to the master locale of the space.
- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string",
  "asset": {
    "_id": "string",
    "uid": "string",
    "object_type": "string",
    "title": "string",
    "description": "string",
    "file_name": "string",
    "parent_uid": "string",
    "path": [
      {
        "uid": "string",
        "title": "string"
      }
    ],
    "owner_uid": "string",
    "co_owners": [
      {
        "uid": "string",
        "name": "string"
      }
    ],
    "permanent_url": "string",
    "permanent_url_slug": "string",
    "content_type": "string",
    "asset_type_uid": "string",
    "file_size": 0,
    "tags": [
      "string"
    ],
    "is_dir": true,
    "asset_id": "string",
    "url": "string",
    "locale": "string",
    "dimensions": {
      "height": 0,
      "width": 0
    },
    "status": "IN_PROGRESS",
    "version": 0,
    "org_uid": "string",
    "space_uid": "string",
    "user_defined_fields": {},
    "visual_markups": [
      {
        "type": "Hotspot",
        "title": "string",
        "description": "string",
        "url": "http://example.com",
        "coordinates": {
          "x": 0,
          "y": 0,
          "width": 0,
          "height": 0
        }
      }
    ],
    "publish_details": [
      {
        "locale": "string",
        "environment": "string",
        "time": "2019-08-24T14:15:22Z",
        "user": "string",
        "version": 0,
        "action": "string",
        "job_id": "string",
        "scheduled_at": "2019-08-24T14:15:22Z",
        "workspace_uid": "string",
        "origin": "string"
      }
    ],
    "_version_name": {
      "title": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "updated_by": "string"
    },
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "is_deleted": true
  }
}
```

## Get an asset

### Get an asset

**GET** `/api/spaces/{space_uid}/assets/{asset_uid}`

The Get an asset request fetches the details of a specific asset using its uid. Use the query parameters to request a specific locale or version and to control the additional details the response includes.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **asset_uid** (required)
  Enter the uid of the asset that you want to retrieve.

#### Query Parameters

- **locale** (optional)
  Enter the locale code, such as en-us, to fetch the asset in a specific locale. Defaults to the master locale of the space.
- **version** (optional)
  Enter the version number to fetch a specific version of the asset. Defaults to the latest version.
- **include_publish_details** (optional)
  Set to true to include the publish details of the asset in the response. Default is false.
- **include_acl** (optional)
  Set to true to include the access control list (ACL) of the asset in the response. Default is false.
- **deleted** (optional)
  Set to true to fetch the asset even if it is soft-deleted. Default is false.
- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "asset": {
    "_id": "string",
    "uid": "string",
    "object_type": "string",
    "title": "string",
    "description": "string",
    "file_name": "string",
    "parent_uid": "string",
    "path": [
      {
        "uid": "string",
        "title": "string"
      }
    ],
    "owner_uid": "string",
    "co_owners": [
      {
        "uid": "string",
        "name": "string"
      }
    ],
    "permanent_url": "string",
    "permanent_url_slug": "string",
    "content_type": "string",
    "asset_type_uid": "string",
    "file_size": 0,
    "tags": [
      "string"
    ],
    "is_dir": true,
    "asset_id": "string",
    "url": "string",
    "locale": "string",
    "dimensions": {
      "height": 0,
      "width": 0
    },
    "status": "IN_PROGRESS",
    "version": 0,
    "org_uid": "string",
    "space_uid": "string",
    "user_defined_fields": {},
    "visual_markups": [
      {
        "type": "Hotspot",
        "title": "string",
        "description": "string",
        "url": "http://example.com",
        "coordinates": {
          "x": 0,
          "y": 0,
          "width": 0,
          "height": 0
        }
      }
    ],
    "publish_details": [
      {
        "locale": "string",
        "environment": "string",
        "time": "2019-08-24T14:15:22Z",
        "user": "string",
        "version": 0,
        "action": "string",
        "job_id": "string",
        "scheduled_at": "2019-08-24T14:15:22Z",
        "workspace_uid": "string",
        "origin": "string"
      }
    ],
    "_version_name": {
      "title": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "updated_by": "string"
    },
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "is_deleted": true
  }
}
```

## Delete an asset

### Delete an asset

**DELETE** `/api/spaces/{space_uid}/assets/{asset_uid}`

The Delete an asset request soft-deletes a specific asset using its uid.

Scope the request with locale or locales to act on specific languages rather than on the asset as a whole. Deleting an asset in a language removes the localized values for that language, which then inherits from the default language again, exactly as it did before it was localized. The localized metadata and file are discarded, and the language stays available to localize into again later.

Omit both parameters to act on the default language of the space. A soft-deleted asset goes to the bin, so it can be restored rather than being lost outright.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **asset_uid** (required)
  Enter the uid of the asset that you want to retrieve.

#### Query Parameters

- **locale** (optional)
  Enter the locale code, such as en-us, of the asset you want to delete. Defaults to the master locale of the space.
- **locales** (optional)
  Enter one or more locale codes to delete the asset in multiple locales at once.
- **workspace** (optional)
  Enter the uid of the workspace that contains the asset.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string",
  "uid": "string",
  "deleted_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "updated_by": "string"
}
```

## Get AI suggested metadata

### Get AI suggested metadata

**GET** `/api/spaces/{space_uid}/assets/{asset_uid}/ai-suggested`

The Get AI suggested metadata request returns metadata that Contentstack generates for an image: a descriptive alt text, classification tags, detected objects, faces, celebrities, text, dominant and background colors, image properties, and content safety flags.

Use it to enrich assets programmatically. The response is a suggestion, not a stored value: nothing is written to the asset. Read what you need, decide what to keep, and write it back with the Update an asset request.

The first call for an image that has not been analyzed yet analyzes it on demand, so that call can take several seconds and consumes AI credits. Later calls for the same binary read the stored result, return immediately, and consume no credits. The status field reports ready when the metadata is available and not\_ingested when it is not.

Pass locale to read the metadata for a specific localized binary. Omit it to read the master locale. The locale must be configured on the workspace, otherwise the request fails with 422.

Pass workspace when the asset exists in more than one workspace. An asset copied into another workspace keeps its uid but holds a different binary there, so omitting workspace returns the metadata for the space's default workspace, which may not be the image you meant.

Confidence values run from 0 to 1. Bounding boxes are in pixels, measured from the top left corner of the image, which makes objects\[\].bounding\_box usable for focal point cropping. Alt text carries no confidence value because it is generated rather than classified.

This request works with an authtoken and with an OAuth access token, and behaves identically for both. An OAuth app additionally needs the assets read scope. The request requires read access to the asset: a caller denied access receives 403 and no analysis is performed, so a forbidden request never consumes credits.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **asset_uid** (required)
  Enter the uid of the asset that you want to retrieve.

#### Query Parameters

- **locale** (optional)
  The locale whose binary you want the metadata for. Defaults to the master locale of the space. The locale must be configured on the workspace, otherwise the request fails with 422.
- **workspace** (optional)
  The workspace the asset resolves within. Defaults to the default workspace of the space. An asset copied into another workspace keeps its uid but holds a different binary there, so pass this when the asset exists in more than one workspace.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
[object Object],[object Object]
```

## List duplicate sets

### List duplicate sets

**GET** `/api/spaces/{space_uid}/assets/duplicates`

The List duplicate sets request returns the groups of identical images found in a workspace. Two assets belong to the same set when their file contents are identical, whatever their file name, folder, or upload date.

Detection runs automatically in the background whenever an asset is uploaded, replaced, deleted, or restored, so no request is needed to start it. Only images are grouped, and only exact matches: a resized or re-exported copy is a different file and forms no set.

Sets are returned most recently changed first. Use skip and limit to page through them.

Read count on each set as the number of copies visible in the workspace, and distinct\_binary\_count as the number of distinct binaries behind them. A set appears only while at least two distinct binaries remain, so a set drops out of this list once it has been cleaned up.

To see the individual assets in a set, pass its uid to the List assets in a duplicate set request.

Duplicate Management can be turned off for a workspace, in which case detection pauses and no new sets are formed. Sets already detected are kept.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **skip** (optional)
  The number of sets to skip before the first one returned. Use it with limit to page through the list.
- **limit** (optional)
  The maximum number of sets to return in one response.
- **include_count** (optional)
  Set to true to include the total number of sets alongside the page of results.
- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
[object Object],[object Object]
```

## List assets in a duplicate set

### List assets in a duplicate set

**GET** `/api/spaces/{space_uid}/assets/duplicates/{uid}`

The List assets in a duplicate set request returns the individual assets grouped into one set of identical images. Take the set uid from the List duplicate sets request.

Each localized version of an asset is returned as its own row, so a set holding one asset localized into three languages returns three rows.

Every row carries an ACL object reporting what you may do with that asset. Use ACL.delete to decide whether to offer a delete action rather than letting the delete fail.

Assets you do not have permission to read are left out of the response. count reports the rows you can see, while distinct\_binary\_count counts every distinct binary in the set regardless of your permissions, so a lower count means copies exist that you cannot access.

No copy in a set is marked as the original. To clean up a set, choose which asset to keep and delete the rest with the Delete an asset or Delete assets in bulk request. Deleted assets move to the bin and can be restored. Once fewer than two distinct binaries remain, the set no longer appears in List duplicate sets.

An unknown set uid, a set outside your workspace, and a set that has already been cleaned up are all answered with 404.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **uid** (required)
  Enter the uid of the duplicate set, as returned by the List duplicate sets request.

#### Query Parameters

- **skip** (optional)
  The number of assets to skip before the first one returned. Use it with limit to page through a large set.
- **limit** (optional)
  The maximum number of assets to return in one response.
- **include_count** (optional)
  Set to true to include the total number of assets alongside the page of results.
- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
[object Object],[object Object]
```

## Get asset locales

### Get asset locales

**GET** `/api/spaces/{space_uid}/assets/{asset_uid}/locales`

The Get asset locales request fetches the localization status of a specific asset across all locales of the space.

Use it to see which languages hold a localized variant of the asset and which are still inheriting from the default language. This is the check to make before you localize or unlocalize, because it tells you whether a language carries its own values or is falling back.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **asset_uid** (required)
  Enter the uid of the asset that you want to retrieve.

#### Query Parameters

- **workspace** (optional)
  The workspace to work in. Defaults to the space’s default workspace, so a request that omits this parameter cannot see an asset held in any other workspace and fails with 404. Pass the workspace uid whenever you work outside the default, for example when a workspace is linked to a branch other than main.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "locales": [
    {
      "code": "string",
      "localized": true,
      "deleted": true
    }
  ]
}
```