Question

How to restore a deleted droplet from snapshot through API?

I have a droplet, took a snapshot and deleted it. How to restore the droplet through API?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @cto3a70ae5eca1d2b3153833c5

In order to launch a new droplet based on a snapshot, you need to supply it’s ID for the image parameter:

curl -X POST -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer $TOKEN' -d \
    '{"name":"example.com","region":"nyc3","size":"512mb","image":12345}'\
    "https://api.digitalocean.com/v2/droplets"

Hope this helps!

Regards, Alex