Generate experiences with Puck AI
Read docs
CloudAPI referencecloud-clientServer APIsassets.update

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

ParamExampleTypeStatus
id"asset_123"StringRequired
params{ alt: "A red bike" }ObjectRequired
options{ auth: {} }Object-

id

The asset’s id.

params

What to change on the asset.

ParamExampleTypeStatus
titletitle: "Red bike"String | null-
altalt: "A red bike"String | null-
folderIdfolderId: "folder_123"String | null-
tagstags: ["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.