> ## 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.

# Rename assets


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](invalidate_cached_media_assets_on_the_cdn) when using the invalidate functionality.

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

```multi
|ruby
Cloudinary::Uploader.rename('old_name', 'new_name')

|php_2
$cloudinary->uploadApi()->rename('old_name', 'new_name');

|python
cloudinary.uploader.rename("old_name", "new_name")

|nodejs
cloudinary.v2.uploader
.rename('old_name', 'new_name')
.then(result=>console.log(result)); 

|java
cloudinary.uploader().rename("old_name", "new_name", 
  ObjectUtils.emptyMap());

|csharp
var renameParams = new RenameParams(){
  FromPublicId = "old_name",
  ToPublicId = "new_name"};
var renameResult = cloudinary.Rename(renameParams);

|go
resp, err := cld.Upload.Rename(ctx, uploader.RenameParams{
      FromPublicID: "old_name", 
      ToPublicID: "new_name"})

|cli
cld uploader rename "old_name" "new_name"
```

For complete details on all available options, see the [rename method](image_upload_api_reference#rename_method).

> **TIP**: [MediaFlows](https://console.cloudinary.com/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](mediaflows_block_reference#rename_media).
