Assets
Archive Asset
An asset once created cannot be deleted, however, it can be archived.
Restore Asset
An archived asset can be restored in the future as follows
Assets
An asset once created cannot be deleted, however, it can be archived.
const res = await fetch(`https://api.packagex.io/v1/assets/ast_1tH2ofoBcDbPnyZCYmrSX3`, {
method: "DELETE",
headers: {
"PX-API-KEY": process.env.PX_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
}).then((res) => res.json());
const archived = res.data.archived; // True if successful.
An archived asset can be restored in the future as follows
const res = await fetch(`https://api.packagex.io/v1/assets/ast_1tH2ofoBcDbPnyZCYmrSX3/restore`, {
method: "POST",
headers: {
"PX-API-KEY": process.env.PX_API_KEY,
"Content-Type": "application/json",
},
body: ``
}).then((res) => res.json());
const archived = res.data.archived; // False if successful