Programmable Media

Update assets

Last updated: Dec-12-2023

The explicit API method is used to apply actions on already uploaded 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). To generate these transformations, the explicit method uses the eager parameter to define the list of transformations to create for the uploaded asset of a specified Public ID (see the Transformation URL API 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 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 cached copies of a media asset on the CDN.
  • Applying one of Cloudinary's add-ons to the image (e.g., removing the background).

Tip
You can also use the 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 are not suitable for use in client-side code. They are also rate-limited, so should only be used in server-side code where you are managing bulk assets.

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.

✔️ Feedback sent!

Rate this page: