Can I create a Debian 8 droplet via the API?

June 1, 2015 350 views
API Control Panels Debian

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?

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.

Have another answer? Share your knowledge.