Go asset administration

Last updated: Nov-14-2022

While using Cloudinary, all your images, videos, and other raw files are uploaded to Cloudinary. You can use our Media Library web interface to browse through and manage your uploaded media assets and generated transformations. In addition, you can use methods from the Upload and Admin APIs, which offer methods for managing, organizing, and creating media assets.

  • Upload API methods can be used as needed.
  • Admin API methods are rate-limited.
    You can view the number of hourly Admin API requests allowed by your Cloudinary plan in the Account page of your Console Settings.

Upload API

In addition to the upload method, this API includes methods for:

Admin API

A secure API with methods for managing and organizing your media assets, including:

Upload API example - delete a single asset

The following Go example uses the Upload API Destroy method to delete the video with public ID sample from your Cloudinary product environment:

Copy to clipboard
resp, err := cld.Upload.Destroy(ctx, uploader.DestroyParams{
      PublicID: "sample", 
      ResourceType: "video"})

Sample output:

Copy to clipboard
&{
  result:ok
 }

Tip
To delete multiple assets use the Admin API DeleteAssets method.

For more Upload API examples in Go, select the Go tab in the Upload API reference.

Admin API example - get details of a single asset

The following Go example uses the Admin API Asset method to return details of the image with public ID sample:

Copy to clipboard
resp, err := cld.Admin.Asset(ctx, admin.AssetParams{
        PublicID:   "sample",
    })

The API call returns a struct with content similar to the following:

Copy to clipboard
&{
  AssetID:d5daa51b467c7fc9f290c4d89a47049e 
  PublicID:sample
  Format:jpg
  Version:1589893927
  ResourceType:image
  Type:upload
  CreatedAt:2020-05-19 13:12:07 +0000 UTC
  Bytes:2495692
  Width:4480 
  Height:6720 
  Backup:false 
  AccessMode:public
  URL:http://res.cloudinary.com/demo/image/upload/v1589893927/sample.jpg
  SecureURL:https://res.cloudinary.com/demo/image/upload/v1589893927/sample.jpg
  Metadata:map[]
  Tags:[] NextCursor:2d09d1437a131d64ea76456d86e4a0397834817fdb1260ba13f523f3af1387e6
  Derived:[map]
  Etag: 
  ImageMetadata:map[] 
  Coordinates:{} 
  Exif:{} 
  Faces:[] 
  IllustrationScore:0 
  SemiTransparent:false 
  Grayscale:false 
  Colors:[] 
  QualityScore:0
  AccessibilityAnalysis:{ColorblindAccessibilityAnalysis:{DistinctEdges:0 DistinctColors:0 MostIndistinctPair:[]} ColorblindAccessibilityScore:0}
  Pages:0 
  CinemagraphAnalysis:{CinemagraphScore:0} 
  Usage:{} 
  OriginalFilename: 
  Error:{Message:}}

For more Admin API examples in .NET, select the Go tab in the Admin API reference.

✔️ Feedback sent!

Rate this page: