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

# Asset

## Asset

Creates an instance of Assets. Use a UID to fetch a specific asset, or use the AssetLibrary class to retrieve all assets.

## SetHeader

To set headers for Contentstack rest calls.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").SetHeader("custom_key", "custom_value").Fetch();
```

header name.

header value against given header name.

## RemoveHeader

Remove header key.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").RemoveHeader("header_to_remove").Fetch();
```

key to be remove from header

## GetCreateAt

Get created at time.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").Fetch();
DateTime date = asset.GetCreateAt();
```

## GetCreatedBy

Get created by user uid

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").Fetch();
string createBy = asset.GetCreatedBy();
```

## GetUpdateAt

Get updated at time.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").Fetch();
DateTime date = asset.GetUpdateAt();
```

## GetUpdatedBy

Get Update by user uid

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").Fetch();
string createBy = asset.GetUpdatedBy();
```

## GetDeleteAt

Get deleted at time.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").Fetch();
DateTime date = asset.GetDeleteAt();
```

## GetDeletedBy

Get Deleted by user uid

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").fetch();
string createBy = asset.GetDeletedBy();
```

## IncludeBranch

Include branch for publish content.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").IncludeBranch().Fetch();
```

## IncludeFallback

Include fallback locale publish content, if specified locale content is not publish.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").IncludeFallback().Fetch();
```

## IncludeMetadata

The includeMetadata method will add the meta information to the response.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").IncludeMetadata().Fetch();
```

## Fetch

fetches the latest version of a specific asset of a particular stack.

```
using Contentstack.Core; 
using Contentstack.Core.Models;
ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
Asset asset = await stack.Asset("asset_uid").Fetch();
```

## AssetFields

The assetFields method specifies which asset-related fields are included in the API response when fetching an entry or querying entries.

**Note:** The assetFields method is currently supported only in the North America (NA) region.

```
Returns the current instance to enable method chaining.
Request behavior: No request is made until Fetch() (single asset) or FetchAll() (multiple assets) is called.Query parameter: When the request runs, the specified asset fields are sent to the CDA as the asset_fields[] query parameter.Field Behavior
Determines which asset-related metadata the CDA returns.Used with stack.Asset(uid).AssetFields(...).Fetch() or stack.AssetLibrary().AssetFields(...).FetchAll().When provided, the SDK sends the selected fields as the asset_fields[] query parameter. Only the requested asset metadata is returned.Supported Values
user_defined_fieldsembedded_metadataai_generated_metadatavisual_markupsFetch a single asset with specific fields
using Contentstack.Core;
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Microsoft.Extensions.Options;
var options = new ContentstackOptions
{
    ApiKey = "<API_KEY>",
    DeliveryToken = "<DELIVERY_TOKEN>",
    Environment = "<ENVIRONMENT>"
};
var stack = new ContentstackClient(new OptionsWrapper<ContentstackOptions>(options));
var assetResponse = await stack
    .Asset("asset_uid")
    .AssetFields(
        "user_defined_fields",
        "embedded_metadata",
        "ai_generated_metadata",
        "visual_markups"
    )
    .Fetch();
Query multiple assets with asset fields
using Contentstack.Core;
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Microsoft.Extensions.Options;
var options = new ContentstackOptions
{
    ApiKey = "<API_KEY>",
    DeliveryToken = "<DELIVERY_TOKEN>",
    Environment = "<ENVIRONMENT>"
};
var stack = new ContentstackClient(new OptionsWrapper<ContentstackOptions>(options));
var result = await stack
    .AssetLibrary()
    .AssetFields("ai_generated_metadata", "visual_markups")
    .FetchAll();
```

Asset field names to include in the response.

## setLocale

The setLocale method sets the locale for fetching a single asset. The API returns the asset with localized metadata (for example, title and description), along with the locale and publish\_details.locale fields in the response.

```
Field Behavior
Specifies which locale’s metadata the API returns for the asset.Used with stack.Asset(uid).SetLocale(...).Fetch().When provided, the locale is sent as the locale query parameter.Response Impact
The response includes localized fields (for example, title and description) along with locale and publish_details.locale.
Fetch a single asset in a locale
using Contentstack.Core;
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Microsoft.Extensions.Options;

var options = new ContentstackOptions
{
    ApiKey = "<API_KEY>",
    DeliveryToken = "<DELIVERY_TOKEN>",
    Environment = "<ENVIRONMENT>"
};
var stack = new ContentstackClient(new OptionsWrapper<ContentstackOptions>(options));
var asset = await stack
    .Asset("asset_uid")
    .SetLocale("en-us")
    .Fetch();
// Access localized fields from the response
var title = asset.Title;           // Localized title
var locale = asset.Get("locale");  // e.g. "en-us"Fetch a single asset in a locale with a fallback
using Contentstack.Core;
using Contentstack.Core.Configuration;
using Contentstack.Core.Models;
using Microsoft.Extensions.Options;
var options = new ContentstackOptions
{
    ApiKey = "<API_KEY>",
    DeliveryToken = "<DELIVERY_TOKEN>",
    Environment = "<ENVIRONMENT>"
};
var stack = new ContentstackClient(new OptionsWrapper<ContentstackOptions>(options));
var asset = await stack
    .Asset("asset_uid")
    .SetLocale("en-us")
    .IncludeFallback()
    .Fetch();Note:
IncludeFallback() returns content from the fallback locale if the requested locale is not published for the single asset.SetLocale can be chained with IncludeFallback(), IncludeMetadata(), AssetFields(), and AddParam() when fetching a single asset.
```

Locale code used to fetch the asset.

## Asset

Asset uid

Asset URL

File Name for asset

File size for asset

Tags assign to asset

Asset uid

Asset URL

Asset Description

File name for Asset

File size of asset

Tags assign to asset

## Asset | .NET Delivery SDK | Contentstack

Asset creates an asset instance in the .NET Delivery SDK, letting you fetch a specific media file by UID or retrieve all assets via AssetLibrary.