Assets

Delete resources by public ID

DELETE
/v1_1/{cloud_name}/resources/{resource_type}/{type}

Deletes assets uploaded to your product environment, identified by their public IDs.

Authorization

AuthorizationBasic <token>

Basic authentication using Cloudinary API Key and API Secret.

In: header

Path Parameters

cloud_name*string

The cloud name of your product environment.

resource_type*string

The type of resource (image, video, or raw).

Value in

  • "image"
  • "video"
  • "raw"
type*|||||

The delivery type of the asset.

Request Body

application/json

The public IDs and options for the resources to delete.

The delete request specifying which resources to delete.

The delete request specifying which resources to delete.

public_ids*array<string>

A list of public IDs of the resources to delete.

prefix?string

Delete all assets, including derived assets, where the public ID starts with the specified prefix (up to a maximum of 1000 original resources).

all?boolean

Delete all assets (of the relevant resource_type and type), including derived assets (up to a maximum of 1000 original resources).

resource_type?string

The type of asset. Relevant as a parameter only when using the SDKs (the resource_type is included in the endpoint URL when using the REST API). Note: use video for all video and audio assets, such as .mp3. Default: image.

Default"image"

Value in

  • "image"
  • "video"
  • "raw"
keep_original?boolean

Whether to delete only the derived assets. Default: false.

Defaultfalse
invalidate?boolean

Whether to also invalidate the copies of the resource on the CDN. It usually takes between a few seconds and a few minutes for the invalidation to fully propagate through the CDN. Default: false.

Defaultfalse
next_cursor?string

(Only when deleting by prefix or all) When a deletion request has more than 1000 resources to delete, the response includes the partial boolean parameter set to true, as well as a next_cursor value. You can then specify this returned next_cursor value as a parameter of the following deletion request.

transformations?string

Only the derived assets matching this hash of transformation parameters will be deleted. You can include multiple transformations separated by a pipe character (|).

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1_1/my_cloud/resources/image/upload" \  -H "Content-Type: application/json" \  -d '{}'
{  "deleted": {    "image1": "deleted",    "image2": "deleted"  },  "partial": false}