assets.update
Puck Assets is in early access. Request access.
Update an asset by id.
await puck.assets.update("asset_123", { alt: "A red bike" });Returns the updated Asset.
Args
| Param | Example | Type | Status |
|---|---|---|---|
id | "asset_123" | String | Required |
params | { alt: "A red bike" } | Object | Required |
options | { auth: {} } | Object | - |
id
The asset’s id.
params
What to change on the asset.
| Param | Example | Type | Status |
|---|---|---|---|
title | title: "Red bike" | String | null | - |
alt | alt: "A red bike" | String | null | - |
folderId | folderId: "folder_123" | String | null | - |
tags | tags: ["Brand"] | String[] | - |
Optional params
title
The asset’s new title. Use null to remove the title.
alt
The asset’s new alt text. Use null to remove the alt text.
folderId
The id of the folder to move the asset to. Use null to remove the asset from its folder.
tags
The asset’s new tags, up to 50. They replace the asset’s current tags. A tag can’t contain a comma.
const asset = await puck.assets.update("asset_123", {
tags: ["Brand", "Summer"],
});options
Set the request options for this call.