Programmable Media

Delete assets

Last updated: Dec-11-2024

There are a number of ways to delete assets from Cloudinary:

Programmatically:

  • Use the Destroy method of the Upload API to delete a single asset. This method requires a signature to be generated on the server side.
  • Use the Delete resources method of the Admin API to delete multiple assets. You can specify a set of assets to be deleted using delete_resources_by_prefix, delete_all_resources (optionally giving a type) or Delete resources by tag. These methods require your API key and secret, so are not suitable for use in client-side code.
  • Delete client-side uploaded assets using a delete token returned in the upload response that is valid for 10 minutes.

Via the Media Library:

When you delete assets, they are immediately and permanently removed from your cloud storage. However, assets and transformed assets already downloaded by visitors to your website, might still be accessible through cached copies on the CDN if they are not invalidated. From within the Media Library, an invalidate request is automatically included whenever you delete, rename, or overwrite media assets. If using the Destroy or Delete resources methods, you need to set the invalidate parameter to true to invalidate copies of the asset on the CDN. It usually takes between a few seconds and a few minutes for the invalidation to fully propagate through the CDN. There are also a number of other important considerations when using the invalidate functionality.

You can restore deleted assets from backup if you have enabled automatic backup for your product environment.

Delete assets video tutorial

Watch this video tutorial to learn more about deleting assets with a deep dive into the Node.js SDK methods.

✔️ Feedback sent!

Rate this page: