---
title: Assets | Scenario Docs
description: API reference for enhanced asset methods.
---

The `assets` resource is enhanced so that `retrieve()` and `update()` return responses where `response.asset` has a `.download()` method. All other asset methods (`list`, `deleteMultiple`, `duplicate`, `getBulk`, `listSnapshots`, `lock`, `unlock`, `updateTags`, `upload` and the `download` sub-resource) are inherited unchanged.

---

## `client.assets.retrieve(assetID)`

Get an asset by ID. Returns an enhanced response where `response.asset` has `.download()`.

**Signature**

```
client.assets.retrieve(
  assetID: string,
  query?: AssetRetrieveParams | null,
  options?: RequestOptions,
): APIPromise<WithAsset<AssetRetrieveResponse>>
```

**Parameters**

| Name      | Type                          | Description                |
| --------- | ----------------------------- | -------------------------- |
| `assetID` | `string`                      | The asset ID to retrieve.  |
| `query?`  | `AssetRetrieveParams \| null` | Optional query parameters. |

**Returns**

`APIPromise<WithAsset<AssetRetrieveResponse>>` — the standard retrieve response with `asset` enhanced:

| Property | Type                                         | Description                                   |
| -------- | -------------------------------------------- | --------------------------------------------- |
| `asset`  | `AssetRetrieveResponse.Asset & AssetMethods` | All original asset fields plus `.download()`. |

**Example**

```
import Scenario from '@scenario-labs/sdk';


const client = new Scenario({ apiKey: '...', apiSecret: '...' });


const { asset } = await client.assets.retrieve('asset_...');
console.log(asset.id);  // original field
console.log(asset.url); // original field
```

---

## `client.assets.update(assetID, params)`

Update an asset. Returns an enhanced response where `response.asset` has `.download()`.

**Signature**

```
client.assets.update(
  assetID: string,
  params: AssetUpdateParams,
  options?: RequestOptions,
): APIPromise<WithAsset<AssetUpdateResponse>>
```

**Parameters**

| Name      | Type                | Description                           |
| --------- | ------------------- | ------------------------------------- |
| `assetID` | `string`            | The asset ID to update.               |
| `params`  | `AssetUpdateParams` | Fields to update (see API Reference). |

**Returns**

`APIPromise<WithAsset<AssetUpdateResponse>>` — the update response with `asset` enhanced.

---

## `asset.download()`

Available on `response.asset` after calling `client.assets.retrieve()` or `client.assets.update()`. Fetches the asset’s content as bytes using the signed `url` field on the asset. Works in Node.js and in browsers with no extra setup.

**Signature**

```
asset.download(): Promise<Uint8Array>
```

**Parameters**

None.

**Returns**

`Promise<Uint8Array>` — the raw bytes of the asset.

**Errors**

Throws `Error` if the HTTP response is not OK (e.g. `Failed to download asset asset_...: 403 Forbidden`).

**Example**

```
import Scenario from '@scenario-labs/sdk';
import fs from 'node:fs/promises';


const client = new Scenario({ apiKey: '...', apiSecret: '...' });


const { asset } = await client.assets.retrieve('asset_...');
const bytes = await asset.download();
await fs.writeFile('out.png', bytes);
```

Note

`asset.download()` is a thin wrapper around `fetch(asset.url)`, using the global `fetch` rather than the client’s `fetch` option. Use `asset.url` directly if you need streaming or a `Response` object.
