Question

How to restore a deleted droplet from snapshot through API?

Posted April 20, 2020 101 views
DigitalOcean API and CLI (doctl)

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

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.

×
1 answer

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

Submit an Answer