Documentation Index

Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt

Use this file to discover all available pages before exploring further.

Image & Video APIs

Rename assets

Last updated: Jun-29-2026

The public ID of a renamed media asset is immediately and permanently updated in your cloud storage with the rename method of the API. Any existing URLs of renamed assets and their associated derived assets are no longer valid, but assets and transformed assets already downloaded by visitors of your website might still be accessible for a certain period of time through cached copies on the CDN.

You can set the invalidate parameter to true while renaming an asset in order to also invalidate the cached 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.

For example, renaming an image with the public ID of old_name to new_name:

For complete details on all available options, see the rename method.

Tip
MediaFlows, Cloudinary’s drag-and-drop workflow builder for image and video, enables users to easily rename media at scale in a low-code implementation. See MediaFlow’s documentation on renaming media here.

Bulk rename existing assets

Caution
Renaming an asset changes its public ID and delivery URL immediately and permanently. Any hardcoded URLs or references to the old public ID in your application, CMS, or CDN configurations will break.

To rename a large set of existing assets, combine the Admin API to list assets with the rename method called on each one in a loop.

Note
The Admin API is rate-limited (500 requests/hour on the free plan; 2000+ on paid plans). Factor this in when deciding how many assets you list per request and how quickly you paginate. The rename method itself uses the Upload API, which is rate-unlimited.

The examples below retrieve all assets with a given tag, strip a _upload suffix from each public ID, and rename them. The loop handles pagination automatically using next_cursor.

To list assets by folder prefix instead of tag, replace the resources_by_tag call with resources and pass a prefix parameter:

Note
This recipe applies to both fixed folder mode (where the public ID includes the folder path) and dynamic folder mode (where the public ID is independent of the asset folder). In either mode, the rename method updates the public ID, which changes the asset’s delivery URL. Use invalidate: true if you need to clear cached CDN copies of the old URLs.

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars