Can I create a Debian 8 droplet via the API?

Posted June 1, 2015 2.2k views
DebianAPIControl Panels

If I create a droplet from the control panel I can choose Debian 8 x64 but if I list all the images available from the API there is no Debian 8, only Debian 7 and 6. How do I create a Debian 8 droplet via the 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.

Submit an Answer
1 answer

To create a Debian 8 Droplet via the API, you can use the slug debian-8-x64 or debian-8-x32 For example:

  • curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $DO_TOKEN" \
  • -d '{"name":"example","region":"nyc3","size":"512mb","image":"debian-8-x64"}' \
  • ""

The issue that you likely ran into was that lists returned via the API are paginated. By default, you only receive the first 25 items and need to make another call to receive the next page of results. You can request more items per page by appending ?per_page=200 to the URL in the call.