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

# Update assets


There are a number of ways to update your media assets:

* Use the [Explicit](image_upload_api_reference#explicit_method) method of the Upload API to update a single asset. This method is not rate-limited and requires a signature to be generated on the server side.
* Use the [Update resources](admin_api#update_resources) method of the Admin API. This method is rate-limited and requires your API key and secret, so is not suitable for use in client-side code.
* Use the [Media Library](https://console.cloudinary.com/console/media_library/search) interface. 

## The explicit method

The `explicit` method of the [Upload API](image_upload_api_reference) is used to update existing assets. The most common usage of this method is to pre-generate transformations for assets that have already been uploaded. This is particularly useful when **Strict Transformations** are enabled for your product environment and you cannot create transformed assets on the fly (for more information, see [Control access to assets](control_access_to_media)). To generate these transformations, the `explicit` method uses the [`eager` parameter](eager_and_incoming_transformations#eager_transformations) to define the list of transformations to create for the uploaded asset of a specified public ID (see the [Transformation URL API Reference](transformation_reference) for more details on possible transformation values). The eager parameter accepts either a single transformation or an array of transformations, where each transformation is represented by a hash of parameters to create for the uploaded resource.

The `explicit` method can also be used in client-side code, but it requires a signature to be generated on the server-side. See the [Explicit](image_upload_api_reference#explicit_method) method in the reference guide for all available parameters.

> **NOTE**: When you perform an eager transformation using `explicit`, the transformation is processed upon request (and counted in your transformation quota) even if an identical derived image already exists.

Examples of other uses for the `explicit` method include:

* Updating the meta data parameters stored with the image, such as `custom_coordinates`, `face_coordinates`, `tags`, etc.
* [Invalidating](#invalidating_cached_media_assets_on_the_cdn) cached copies of a media asset on the CDN.
* Applying one of Cloudinary's add-ons to the image (e.g., [removing the background](remove_the_background_image_editing_addon)).

The `explicit` API method also requires specifying the `type` of the resource: `upload`, `private` or `authenticated`. For example, the following method will explicitly generate two transformations for the already uploaded JPG `private` image named `sample3`: 

1. Scale to a width of 200 pixels.
2. Crop to a width of 360 pixels and a height of 200 pixels with north gravity. 

```multi
|ruby  
Cloudinary::Uploader.explicit("sample3", 
  type: "private",
  eager: [
    {width: 200, crop: "scale"}, 
    {width: 360, height: 200, 
       crop: "crop", gravity: "north "}])
 
|php_2
$cloudinary->uploadApi()->explicit("sample3", [
    "type" => "private", 
    "eager" => [
      ["width" => 200, "crop" => "scale"],
      ["width" => 360, "height" => 200, 
        "crop" => "crop", "gravity" => "north"]]]);

|python
cloudinary.uploader.explicit("sample3", 
  type = "private", 
  eager = [
    {"width": 200, "crop": "scale"},
    {"width": 360, "height": 200, 
       "crop": "crop", "gravity": "north"}])


|nodejs
cloudinary.v2.uploader
.explicit("sample3", 
  { type: "private",
    eager: [
      { width: 200, crop: "scale" }, 
      { width: 360, height: 200, 
          crop: "crop", gravity: "north"} ] })
.then(result=>console.log(result)); 
  
|java
cloudinary.uploader().explicit("sample3", ObjectUtils.asMap(
  "type", "private",
  "eager", Arrays.asList(
    new EagerTransformation().width(200).crop("scale"),
    new EagerTransformation().width(360).height(200)
      .crop("crop").gravity("north"))));

|csharp
var explicitParams = new ExplicitParams("sample3"){
  Type = "private",
  EagerTransforms = new List<Transformation>(){
   new EagerTransformation().Width(200).crop("scale"),
   new EagerTransformation().Width(360).Height(200)
     .Crop("crop").Gravity("north")}};
var explicitResult = cloudinary.Explicit(explicitParams); 

|go
resp, err := cld.Upload.Explicit(ctx, uploader.ExplicitParams{
    PublicID: "sample3", 
    Type: "private", 
    Eager: "c_scale,w_200|c_crop,g_north,h_200,w_360"})

|cli
cld uploader explicit "sample3" type="private" eager='[{"width": 200, "crop": "scale"},{"width": 360, "height": 200,"crop": "crop", "gravity": "north"}]'
```
> **INFO**: The default resource type for most API requests is `image`. When working with videos, remember to explicitly set the `resource_type` to `video`.
## The update method

The [Update details of an existing resource](admin_api#update_details_of_an_existing_resource) method of the Admin API to update uploaded assets. Admin API methods require your API key and secret, so they shouldn't be used in client-side code. This method is rate-limited.

For example, to update the tags and moderation status of an uploaded image with the public ID of 'table':

```multi
|curl
curl \
 -d "tags=important&moderation_status=approved" \
 -X POST \
 https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload/table
        
|ruby
result = Cloudinary::Api
.update("table",
  tags: "important",
  moderation_status: "approved")

|php_2
$result = $api
->update("table", [
    "tags" => "important", 
    "moderation_status" => "approved"]);

|python
result = cloudinary.api\
.update("table",
  tags = "important",
  moderation_status = "approved")

|nodejs
cloudinary.v2.api
.update("table", 
  { tags: "important", 
    moderation_status: "approved"})
.then(result=>console.log(result)); 

|java
result = cloudinary.api()
.update("table",
  ObjectUtils.asMap(
    "tags", "important",
    "moderation_status", "approved"));

|csharp
var updateParams = new UpdateParams("table"){
  Tags = "important",
  ModerationStatus = "approved"};
var updateResult = cloudinary.UpdateResource(updateParams); 

|go
	resp, err := cld.Admin.UpdateAsset(ctx, admin.UpdateAssetParams{
		PublicID:         "table",
		Tags:     		   []string{"important"},
		ModerationStatus: "approved"})

|cli
cld admin update table tags="important" moderation_status="approved"
```