DigitalOcean API

All of the functionality that you find in our web control panel will be made available via the API.

Base URI

https://api.digitalocean.com
Parameters
client_id
string required

DigitalOcean client id

Example:
ewfewfwefwefew2234ewfwef
api_key
string required

DigitalOcean API key

Example:
abdcdfeqw1wqrqwe
API Methods
Droplets
GET /droplets/new1
GET /droplets/{droplet_id}
GET /droplets/{droplet_id}/reboot
GET /droplets/{droplet_id}/power_cycle
GET /droplets/{droplet_id}/shutdown
GET /droplets/{droplet_id}/power_off
GET /droplets/{droplet_id}/power_on
GET /droplets/{droplet_id}/password_reset
GET /droplets/{droplet_id}/resize
GET /droplets/{droplet_id}/snapshot
GET /droplets/{droplet_id}/restore
GET /droplets/{droplet_id}/rebuild
GET /droplets/{droplet_id}/rename
GET /droplets/{droplet_id}/destroy
Show All Active Droplets
GET /droplets

This method returns all active droplets that are currently running in your account. All available API information is presented for each droplet.

Responses

200 OK
Body
Object
status
string
Example:
OK
droplets
New Droplet
GET /droplets/new1

This method allows you to create a new droplet. See the required parameters section below for an explanation of the variables that are needed to create a new droplet.

Request parameters

name
string required

this is the name of the droplet - must be formatted by hostname rules

Example:
digital
size_id
number required

this is the id of the size with which you would like the droplet created
One of size_id or size_slug must be specified

Example:
3
size_slug
number optional

this is the slug of the size with which you would like the droplet created
One of size_id or size_slug must be specified

Example:
4000
image_id
number optional

the id of the image you would like the droplet created with
One of image_id or image_slug must be specified

Example:
1502
image_slug
string optional

the slug of the image you would like the droplet created with
One of image_id or image_slug must be specified

Example:
2000
region_id
string optional

this is the id of the region you would like your server in
One of region_id or region_slug must be specified

Example:
3300
region_slug
string optional

the slug of the region you would like your server in
One of region_id or region_slug must be specified

Example:
2002
ssh_key_ids
string optional

Numeric comma separated list of ssh_key_ids that you would like to be added to the server

Example:
12334,5006
private_networking
boolean optional

enables a private network interface if the region supports private networking

Example:
true
backups_enabled
boolean optional

enables backups for your droplet

Example:
true

Responses

200 OK
Body
Object
status
string
Example:
OK
droplet
Show Droplet
GET /droplets/{droplet_id}

This method returns full information for a specific droplet ID that is passed in the URL.

Path variables

droplet_id
string required

this is the id of your droplet

Example:
100

Responses

200 OK
Body
Object
status
string
Example:
OK
droplet
Object
id
number
Example:
100823
image_id
number
Example:
420
name
string
Example:
test222
region_id
number
Example:
1
size_id
number
Example:
33
backups_active
boolean
Example:
false
backups
unknown
snapshots
unknown
ip_address
string
Example:
127.0.0.1
private_ip_address
unknown
locked
boolean
Example:
false
status
string
Example:
active
Reboot Droplet
GET /droplets/{droplet_id}/reboot

This method allows you to reboot a droplet. This is the preferred method to use if a server is not responding.

Path variables

droplet_id
string required

the id of your droplet that you want to reboot

Example:
400022

Responses

200 OK
Body
Power Cycle Droplet
GET /droplets/{droplet_id}/power_cycle

This method allows you to power cycle a droplet. This will turn off the droplet and then turn it back on.

Path variables

droplet_id
string required

this is the id of your droplet that you want to power cycle

Example:
100

Responses

200 OK
Body
Shut Down Droplet
GET /droplets/{droplet_id}/shutdown

Path variables

droplet_id
string required

droplet id

Example:
23300

Responses

200 OK
Body
Power Off
GET /droplets/{droplet_id}/power_off

This method allows you to poweroff a running droplet. The droplet will remain in your account.

Path variables

droplet_id
string required

this is the id of your droplet that you want to power off

Example:
100

Responses

200 OK
Body
Power On
GET /droplets/{droplet_id}/power_on

This method allows you to poweron a powered off droplet.

Path variables

droplet_id
string required

droplet_id

Responses

200 OK
Body
Reset Root Password
GET /droplets/{droplet_id}/password_reset

This method will reset the root password for a droplet. Please be aware that this will reboot the droplet to allow resetting the password

Path variables

droplet_id
string required

the id of your droplet that you want to reset password on

Example:
300

Responses

200 OK
Body
Resize Droplet
GET /droplets/{droplet_id}/resize

This method allows you to resize a specific droplet to a different size. This will affect the number of processors and memory allocated to the droplet.

Path variables

droplet_id
string required

the id of your droplet that you want to resize

Example:
300

Request parameters

size_id
number required

this is the id of the size with which you would like the droplet created
One of size_id or size_slug must be specified

Example:
3
size_slug
number optional

this is the slug of the size with which you would like the droplet created
One of size_id or size_slug must be specified

Example:
4000

Responses

200 OK
Body
Take a Snapshot
GET /droplets/{droplet_id}/snapshot

This method allows you to take a snapshot of the droplet once it has been powered off, which can later be restored or used to create a new droplet from the same image. Please be aware this may cause a reboot.

Path variables

droplet_id
string required

the id of your droplet that you want to resize

Example:
300

Request parameters

name
string optional

the name of the new snapshot you want to create. If not set, the snapshot name will default to date/time

Example:
My snapshot

Responses

200 OK
Body
Restore Droplet
GET /droplets/{droplet_id}/restore

This method allows you to restore a droplet with a previous image or snapshot. This will be a mirror copy of the image or snapshot to your droplet. Be sure you have backed up any necessary information prior to restore.

Path variables

droplet_id
string required

the id of your droplet that you want to restore

Example:
300

Request parameters

image_id
number required

this is the id of the image you would like to use to restore your droplet with

Example:
23233

Responses

200 OK
Body
Rebuild Droplet
GET /droplets/{droplet_id}/rebuild

This method allows you to reinstall a droplet with a default image. This is useful if you want to start again but retain the same IP address for your droplet.

Path variables

droplet_id
string required

the id of your droplet that you want to rebuild

Example:
300

Request parameters

image_id
number required

this is the id of the image you would like to use to restore your droplet with

Example:
23233

Responses

200 OK
Body
Rename Droplet
GET /droplets/{droplet_id}/rename

This method renames the droplet to the specified name.

Path variables

droplet_id
string required

the id of your droplet that you want to resize

Example:
300

Request parameters

name
string required

new name of the droplet

Example:
My new snapshot

Responses

200 OK
Body
Destroy Droplet
GET /droplets/{droplet_id}/destroy

This method destroys one of your droplets - this is irreversible.

Path variables

droplet_id
string required

the id of your droplet that you want to resize

Example:
300

Request parameters

scrub_data
boolean optional

this will strictly write 0s to your prior partition to ensure that all data is completely erased.

Example:
true

Responses

200 OK
Body
Regions
GET /regions
All Regions
GET /regions

This method will return all the available regions within the DigitalOcean cloud.

Responses

200 OK
Body
Object
status
string
Example:
OK
regions
Images
GET /images
GET /images/{image_id_or_slug}
GET /images/{image_id_or_slug}/destroy
GET /images/{image_id_or_slug}/transfer
All Images
GET /images

This method returns all the available images that can be accessed by your client ID. You will have access to all public images by default, and any snapshots or backups that you have created in your own account.

Request parameters

filter
string optional

either my_images or global

Example:
global

Responses

200 OK
Body
Object
status
string
Example:
OK
images
Show Image
GET /images/{image_id_or_slug}

This method displays the attributes of an image.

Path variables

image_id_or_slug
string required

the id of the image you would like to use to rebuild your droplet with

Example:
1003

Responses

200 OK
Body
Object
status
string
Example:
OK
image
Object
id
number
Example:
2
name
string
Example:
Automated Backup
distribution
string
Example:
Ubuntu
Destroy Image
GET /images/{image_id_or_slug}/destroy

This method allows you to destroy an image. There is no way to restore a deleted image so be careful and ensure your data is properly backed up.

Path variables

image_id_or_slug
string required

this is the id of the image you would like to destroy

Example:
1003

Responses

200 OK
Body
Object
status
string
Example:
OK
Transfer Image
GET /images/{image_id_or_slug}/transfer

This method allows you to transfer an image to a specified region.

Path variables

image_id_or_slug
string required

this is the id of the image you would like to transfer

Example:
1003

Responses

200 OK
Body
SSH Keys
GET /ssh_keys
GET /ssh_keys/new
GET /ssh_keys/{ssh_key_id}
GET /ssh_keys/{ssh_key_id}/edit
GET /ssh_keys/{ssh_key_id}/destroy
All SSH Keys
GET /ssh_keys

This method lists all the available public SSH keys in your account that can be added to a droplet.

Responses

200 OK
Body
Object
status
string
Example:
OK
ssh_keys
Add SSH Key
GET /ssh_keys/new

This method allows you to add a new public SSH key to your account.

Request parameters

name
string required

the name you want to give this SSH key.

Example:
mykey
ssh_pub_key
string required

the actual public SSH key

Example:
mqwdqwdmlkwqmdklqwmkqwd

Responses

200 OK
Body
Object
status
string
Example:
OK
ssh_key
Object
id
number
Example:
47
name
string
Example:
my_key
ssh_pub_key
string
Example:
ssh-dss AAAAB3NzaC1kc3MAAACBAK5uLwicCrFEpaVKBzkWxC7RQn+smg5ZQb5keh9RQKo8AszFTol5npgUAr0JWmqKIHv7nof0HndO86x9iIqNjq3vrz9CIVcFfZM7poKBJZ27Hv3v0fmSKfAc6eGdx8eM9UkZe1gzcLXK8UP2HaeY1Y4LlaHXS5tPi/dXooFVgiA7AAAAFQCQl6LZo/VYB9VgPEZzOmsmQevnswAAAIBCNKGsVP5eZ+IJklXheUyzyuL75i04OOtEGW6MO5TymKMwTZlU9r4ukuwxty+T9Ot2LqlNRnLSPQUjb0vplasZ8Ix45JOpRbuSvPovryn7rvS7//klu9hIkFAAQ/AZfGTw+696EjFBg4F5tN6MGMA6KrTQVLXeuYcZeRXwE5t5lwAAAIEAl2xYh098bozJUANQ82DiZznjHc5FW76Xm1apEqsZtVRFuh3V9nc7QNcBekhmHp5Z0sHthXCm1XqnFbkRCdFlX02NpgtNs7OcKpaJP47N8C+C/Yrf8qK/Wt3fExrL2ZLX5XD2tiotugSkwZJMW5Bv0mtjrNt0Q7P45rZjNNTag2c= user@host
Show SSH Key
GET /ssh_keys/{ssh_key_id}

This method shows a specific public SSH key in your account that can be added to a droplet.

Path variables

ssh_key_id
string required

Responses

200 OK
Body
Object
status
string
Example:
OK
ssh_key
Object
id
number
Example:
47
name
string
Example:
my_key
ssh_pub_key
string
Example:
ssh-dss AAAAB3NzaC1kc3MAAACBAK5uLwicCrFEpaVKBzkWxC7RQn+smg5ZQb5keh9RQKo8AszFTol5npgUAr0JWmqKIHv7nof0HndO86x9iIqNjq3vrz9CIVcFfZM7poKBJZ27Hv3v0fmSKfAc6eGdx8eM9UkZe1gzcLXK8UP2HaeY1Y4LlaHXS5tPi/dXooFVgiA7AAAAFQCQl6LZo/VYB9VgPEZzOmsmQevnswAAAIBCNKGsVP5eZ+IJklXheUyzyuL75i04OOtEGW6MO5TymKMwTZlU9r4ukuwxty+T9Ot2LqlNRnLSPQUjb0vplasZ8Ix45JOpRbuSvPovryn7rvS7//klu9hIkFAAQ/AZfGTw+696EjFBg4F5tN6MGMA6KrTQVLXeuYcZeRXwE5t5lwAAAIEAl2xYh098bozJUANQ82DiZznjHc5FW76Xm1apEqsZtVRFuh3V9nc7QNcBekhmHp5Z0sHthXCm1XqnFbkRCdFlX02NpgtNs7OcKpaJP47N8C+C/Yrf8qK/Wt3fExrL2ZLX5XD2tiotugSkwZJMW5Bv0mtjrNt0Q7P45rZjNNTag2c= user@host
Edit SSH Key
GET /ssh_keys/{ssh_key_id}/edit

Path variables

ssh_key_id
string required

This method allows you to modify an existing public SSH key in your account.

Example:
30

Request parameters

ssh_pub_key
string optional

the new public SSH key.

Example:
efwefwefewf

Responses

200 OK
Body
Object
status
string
Example:
OK
ssh_key
Object
id
number
Example:
47
name
string
Example:
My new SSH key
ssh_pub_key
string
Example:
ssh-dss AAAAB3NzaC1kc3MAAACBAK5uLwicCrFEpaVKBzkWxC7RQn+smg5ZQb5keh9RQKo8AszFTol5npgUAr0JWmqKIHv7nof0HndO86x9iIqNjq3vrz9CIVcFfZM7poKBJZ27Hv3v0fmSKfAc6eGdx8eM9UkZe1gzcLXK8UP2HaeY1Y4LlaHXS5tPi/dXooFVgiA7AAAAFQCQl6LZo/VYB9VgPEZzOmsmQevnswAAAIBCNKGsVP5eZ+IJklXheUyzyuL75i04OOtEGW6MO5TymKMwTZlU9r4ukuwxty+T9Ot2LqlNRnLSPQUjb0vplasZ8Ix45JOpRbuSvPovryn7rvS7//klu9hIkFAAQ/AZfGTw+696EjFBg4F5tN6MGMA6KrTQVLXeuYcZeRXwE5t5lwAAAIEAl2xYh098bozJUANQ82DiZznjHc5FW76Xm1apEqsZtVRFuh3V9nc7QNcBekhmHp5Z0sHthXCm1XqnFbkRCdFlX02NpgtNs7OcKpaJP47N8C+C/Yrf8qK/Wt3fExrL2ZLX5XD2tiotugSkwZJMW5Bv0mtjrNt0Q7P45rZjNNTag2c= user@host
Destroy SSH Key
GET /ssh_keys/{ssh_key_id}/destroy

This method will delete the SSH key from your account.

Path variables

ssh_key_id
string required

ssh key id

Responses

200 OK
Body
Object
status
string
Example:
OK
Sizes
GET /sizes
All Sizes
GET /sizes

This method returns all the available sizes that can be used to create a droplet.

Responses

200 OK
Body
Object
status
string
Example:
OK
sizes
Object
id
number
Example:
33
name
string
Example:
512MB
slug
string
Example:
512mb
Domains
GET /domains
GET /domains/new
GET /domains/{domain_id}
GET /domains/{domain_id}/destroy
GET /domains/{domain_id}/records
GET /domains/{domain_id}/records/new
GET /domains/{domain_id}/records/{record_id}
GET /domains/{domain_id}/records/{record_id}
GET /domains/{domain_id}/records/{record_id}/destroy
All Domains
GET /domains

This method returns all of your current domains.

Responses

200 OK
Body
Object
status
string
Example:
OK
domains
Object
id
number
Example:
100
name
string
Example:
example.com
ttl
number
Example:
1800
live_zone_file
string
Example:
$TTL\t600\n@\t\tIN\tSOA\tNS1.DIGITALOCEAN.COM.\thostmaster.example.com. (\n\t\t\t1369261882 ; last update: 2013-05-22 22:31:22 UTC\n\t\t\t3600 ; refresh\n\t\t\t900 ; retry\n\t\t\t1209600 ; expire\n\t\t\t10800 ; 3 hours ttl\n\t\t\t)\n IN NS NS1.DIGITALOCEAN.COM.\n @\tIN A\t8.8.8.8\n
error
unknown
zone_file_with_error
unknown
New Domain
GET /domains/new

This method creates a new domain name with an A record for the specified [ip_address].

Request parameters

name
string required

name of the domain

Example:
newdomain.com
ip_address
string required

ip address for the domain`s initial a record.

Example:
10.0.0.1

Responses

200 OK
Body
Object
status
string
Example:
OK
domain
Object
id
number
Example:
101
name
string
Example:
newdomain.com
Domain Show
GET /domains/{domain_id}

This method returns the specified domain.

Path variables

domain_id
string required

Domain Name (e.g. domain.com), specifies the domain to display.

Example:
domain.com

Responses

200 OK
Body
Object
status
string
Example:
OK
domain
Object
id
number
Example:
100
name
string
Example:
example.com
ttl
number
Example:
1800
live_zone_file
string
Example:
$TTL\t600\n@\t\tIN\tSOA\tNS1.DIGITALOCEAN.COM.\thostmaster.example.com. (\n\t\t\t1369261882 ; last update: 2013-05-22 22:31:22 UTC\n\t\t\t3600 ; refresh\n\t\t\t900 ; retry\n\t\t\t1209600 ; expire\n\t\t\t10800 ; 3 hours ttl\n\t\t\t)\n IN NS NS1.DIGITALOCEAN.COM.\n @\tIN A\t8.8.8.8\n
error
unknown
zone_file_with_error
unknown
Destroy Domain
GET /domains/{domain_id}/destroy

This method deletes the specified domain.

Path variables

domain_id
string required

Integer or Domain Name (e.g. domain.com), specifies the domain to destroy.

Example:
1003

Responses

200 OK
Body
Object
status
string
Example:
OK
All Domain Records
GET /domains/{domain_id}/records

This method returns all of your current domain records.

Path variables

domain_id
string required

Integer or Domain Name (e.g. domain.com), specifies the domain for which to retrieve records.

Example:
22

Responses

200 OK
Body
Object
status
string
Example:
OK
records
Object
id
number
Example:
49
domain_id
string
Example:
100
record_type
string
Example:
A
name
string
Example:
example.com
data
string
Example:
8.8.8.8
priority
unknown
port
unknown
weight
unknown
New Domain Record
GET /domains/{domain_id}/records/new

//TODO error in original doc - This method creates a new domain name with an A record for the specified [ip_address].

Path variables

domain_id
string required

Integer or Domain Name (e.g. domain.com), specifies the domain for which to create a record.

Example:
2233

Request parameters

record_type
string required

the type of record you would like to create. ‘A’, ‘CNAME’, ‘NS’, ‘TXT’, ‘MX’ or ‘SRV’

Example:
A
data
string required

this is the value of the record

Example:
@
name
string optional

required for ‘A’, ‘CNAME’, ‘TXT’ and ‘SRV’ records

Example:
subdomain
priority
string optional

required for ‘SRV’ and ‘MX’ records

port
string optional

required for ‘SRV’ records

weight
string optional

required for ‘SRV’ records

Responses

200 OK
Body
Object
status
string
Example:
OK
domain_record
Object
id
number
Example:
51
domain_id
string
Example:
100
record_type
string
Example:
CNAME
name
string
Example:
subdomain
data
string
Example:
@
priority
unknown
port
unknown
weight
unknown
Edit Domain Record
GET /domains/{domain_id}/records/{record_id}

This method edits an existing domain record.

Path variables

domain_id
string required

Integer or Domain Name (e.g. domain.com), specifies the domain for which to create a record.

Example:
2233
record_id
string required

Integer, specifies the record to update.

Example:
506

Request parameters

record_type
string required

the type of record you would like to create. ‘A’, ‘CNAME’, ‘NS’, ‘TXT’, ‘MX’ or ‘SRV’

Example:
A
data
string required

this is the value of the record

Example:
@
name
string optional

required for ‘A’, ‘CNAME’, ‘TXT’ and ‘SRV’ records

Example:
subdomain
priority
string optional

required for ‘SRV’ and ‘MX’ records

port
string optional

required for ‘SRV’ records

weight
string optional

required for ‘SRV’ records

Responses

200 OK
Body
Object
status
string
Example:
OK
domain_record
Object
id
number
Example:
51
domain_id
string
Example:
100
record_type
string
Example:
CNAME
name
string
Example:
subdomain
data
string
Example:
@
priority
unknown
port
unknown
weight
unknown
Show Domain Record
GET /domains/{domain_id}/records/{record_id}

This method returns the specified domain record.

Path variables

domain_id
string required

Integer or Domain Name (e.g. domain.com), specifies the domain for which to retrieve a record

Example:
2223
record_id
string required

Integer, specifies the record_id to retrieve

Example:
200

Responses

200 OK
Body
Object
status
string
Example:
OK
record
Object
id
number
Example:
50
domain_id
string
Example:
100
record_type
string
Example:
CNAME
name
string
Example:
www
data
string
Example:
@
priority
unknown
port
unknown
weight
unknown
Destroy Domain Record
GET /domains/{domain_id}/records/{record_id}/destroy

This method edits an existing domain record.

Path variables

domain_id
string required

Integer or Domain Name (e.g. domain.com), specifies the domain for which to create a record.

Example:
2233
record_id
string required

Integer, specifies the record to update.

Example:
506

Responses

200 OK
Body
Object
status
string
Example:
OK
Events
GET /events/{event_id}
Show Event
GET /events/{event_id}

This method is primarily used to report on the progress of an event by providing the percentage of completion.

Path variables

event_id
string required

this is the id of the event you would like more information about.

Example:
233

Responses

200 OK
Body
Object
status
string
Example:
OK
event
Object
id
number
Example:
7499
action_status
string
Example:
done
droplet_id
number
Example:
100824
event_type_id
number
Example:
1
percentage
string
Example:
100
Data Reference
Droplet
Object
id
number
Example:
100823
name
string
Example:
test222
image_id
number
Example:
420
size_id
number
Example:
33
region_id
number
Example:
1
backups_active
boolean
Example:
false
ip_address
string
Example:
127.0.0.1
private_ip_address
unknown
locked
boolean
Example:
false
status
string
Example:
active
created_at
string
Example:
2013-01-01T09:30:00Z
DropletMini

Mini version of droplet object

Object
id
number
Example:
100824
name
string
Example:
test
image_id
number
Example:
419
size_id
number
Example:
32
event_id
number
Example:
7499
Methods: New Droplet
Region
Object
id
number
Example:
1
name
string
Example:
New York 1
slug
string
Example:
nyc1
Methods: All Regions
Image
Object
id
number
Example:
1
name
string
Example:
My first snapshot
distribution
string
Example:
Ubuntu
slug
string
Example:
ubuntu-12.10-x32
public
boolean
Example:
true
Methods: All Images
SshKey
Object
id
number
Example:
10
name
string
Example:
office-imac
Methods: All SSH Keys