Hack to change bootdevice

As i was trying to automate some filesystem changes on multiple hosts, i need to send droplets into recovery state, connect via ssh into recovery image and make changes to original droplets FS and than boot back into normal mode.

However, there is no way to do this action via API v2 request, only through the web panel, which is frustrating, because i need to go for recovery panel for every single droplet and manually change boot mode to recovery, and than change it back.

So, to free myself from manual labor, i hoped to “Hack around and find out”. I inspected requests that browser send when you press “Boot from recovery ISO” button, and found this request (i cut out all unnecessary info)

curl '****/set_boot_device' \
  -H 'authority:' \
  -H 'accept: application/json' \
  -H 'referer:****/recovery?i=05ae82' \
  -H 'cookie: ***********************************\
  --data-raw '{"local_disk":false}' \

As you can see, the old API v1 is used here, which btw has no documentation left

I tried to send request to old v1 api endpoint with same parameters as for new one

do_change_bootorder() {
    local do_token="$1"
    local do_droplet_id="$2"

    curl -X POST \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $do_token" \
        -d '{"local_disk":false}' \

But it does not seem to be working

{"id":"api_error","message":"Looks like something went wrong. If this continues, please open a support ticket so we can help you out. ","request_id":"0fd23148-02f8-495a-******"}

I also tried to send same request to v2 API but got another error

{"id":"not_found","message":"route not found"}

I hope someone here can help me solve this problem.

P.s. I don’t wanna solve this problem via:

  • “copy request as curl with all cookies and ‘foreach’ for all droplets”
  • “automate login and obtaining cookies via beautifulsoup4 python”
  • “automate via selenium”
  • “automate via mouse programming to click on buttons”

I want simple API request and i wonder why it’s still not implemented after all these years ?

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


The API that you are referring to is the internal DigitalOcean API used by their frontend. The public API does not seem to have this functionality in place.

But this sounds like a great idea, sounds like it’d be super useful!

The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

Hope that helps! - Bobby.