Create and Delete "General Purpose" droplet via API

Posted October 22, 2019 2.3k views
DigitalOcean API and CLI (doctl)

In DO there are four types of droplets: Standard, General Purpose, CPU Optimized, and Memory Optimized droplet.

Is it possible to create and delete “General Purpose” droplet via API?
If yes, are there samples on how to do it?

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
2 answers

Adding a bit to @alexdo’s answer, when you create a Droplet via the API, you will supply a “size slug.” Size slugs are human-readable strings used to specify the type of Droplet in certain API requests. They are comprised of the identifier for the Droplet’s class, the vCPU count, and the amount of RAM. For example, the $5 per month Standard Droplet comes with 1 vCPU and 1 GB of RAM. So its size slug is: s-1vcpu-1gb

Size slugs for General Purpose Droplets are prefixed with g- So the 8 GB RAM, 2 CPU General Purpose Droplet would be g-2vcpu-8gb

In order to get a full list of all the available Droplet sizes and their corresponding size slugs, you can: