Skip to content
Get started

Restore Multiple

client.assets.restoreMultiple(AssetRestoreMultipleParams { assetIds, projectId } params, RequestOptionsoptions?): AssetRestoreMultipleResponse { restoredAssetIds, skippedAssets }
POST/assets/restore

Restore assets deleted in the last 30 days. Tags and collections are not restored. Max plan and above only.

ParametersExpand Collapse
params: AssetRestoreMultipleParams { assetIds, projectId }
assetIds: Array<string>

Body param: The ids of the deleted assets to restore. (Max 100 at once)

projectId?: string

Query param: The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

ReturnsExpand Collapse
AssetRestoreMultipleResponse { restoredAssetIds, skippedAssets }
restoredAssetIds: Array<string>

The ids of the restored assets

skippedAssets: Array<SkippedAsset>

The assets that were not restored, and why

assetId: string
reason: "not-found" | "not-deleted" | "expired"

“not-found”: no asset with this id. “not-deleted”: the asset is not deleted. “expired”: deleted more than 30 days ago, or past the Free plan retention period.

One of the following:
"not-found"
"not-deleted"
"expired"

Restore Multiple

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

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.assets.restoreMultiple({ assetIds: ['string'] });

console.log(response.restoredAssetIds);
{
  "restoredAssetIds": [
    "string"
  ],
  "skippedAssets": [
    {
      "assetId": "assetId",
      "reason": "not-found"
    }
  ]
}
Returns Examples
{
  "restoredAssetIds": [
    "string"
  ],
  "skippedAssets": [
    {
      "assetId": "assetId",
      "reason": "not-found"
    }
  ]
}