How to delete an image from the client-side?




  • Avatar

    I can't get the delete_token! :'(

    I upload the image this way :

    $scope.uploadImages = function() {
    var folder = '/va/bikes/'+$;
    folder: folder,
    cloud_name: 'www-despertaweb-cat',
    upload_preset: 'bikes_preset',
    theme: 'minimal',
    thumbnails: 'img-responsive',
    return_delete_token: true
    function(error, result) {
    console.log('\n\n Result', result);
    for(var i in result){


  • Avatar
    Nadav Ofir

    Hi, it seems that you didn't set the "Return delete token" field to True on your "bikes_preset" upload preset. Could you please verify that?

  • Avatar
    Bryan Byrne

    In case it's useful to a future reader, I was personally finding it difficult to find the API endpoint that would allow me to delete using a delete_token, I found it helpful to reference this code in cloudinary jquery library,

    In the end it's a POST to '' + cloud_name + '/delete_by_token', with parameters of `public_id` and `token`.

  • Avatar

    not work any more

    Return in the header....

    X-Cld-Error:Return delete token parameter is not allowed when using unsigned upload. Only upload_preset,callback,public_id,folder,tags,context,face_coordinates,custom_coordinates upload parameters are allowed.


  • Avatar
    Aditi Madan

    Hi Accion,

    I could delete the image with the unsigned upload preset "return delete token" set to "true" in Upload Preset on my account.


    Could you please verify the unsigned upload preset you are using has "return delete token" set to "true" in media library settings page.

    You can raise a support ticket here - if it still doesn't work and I can take a deeper look at the code.

Please sign in to leave a comment.