This support forum is no longer in use. Please use the Cloudinary Community at to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

Nodejs: How can I check if public_id exists on Cloudinary?



  • Avatar
    Sam Brace

    Gabriel - One technique is to try and get details for the specific asset by declaring its Public ID. If the asset doesn't exist in your system, it will return an error.

    Here's a code sample, using Node.js, to try and retrieve a file with a Public ID of "kitten". 

    const cloudinary = require('cloudinary').v2;

    .then(result => console.log(result))
    .catch(error => console.error(error));

    I would try this and see if it works for you. More details about this Admin API method can be found here:

    Yours Truly,


    Comment actions Permalink
  • Avatar
    Gabriel Martinez

    Hi Sam,

    Thank you very much for your quick reply. I will check this method right away.

    Comment actions Permalink

Post is closed for comments.