Digital Ocean API v2

NOT OFFICIAL replica of Digital Ocean API v2. For demo purposes only.

Base URI

https://api.digitalocean.com/v2
Demo
DEMO ONLY

This is not official version of Digital Ocean REST API.
Link to Official documentation

Documentation
Introduction

Welcome to the DigitalOcean API documentation

The DigitalOcean API allows you to manage Droplets and resources within the DigitalOcean cloud in a simple, programmatic way using conventional HTTP requests. The endpoints are intuitive and powerful, allowing you to easily make calls to retrieve information or to execute actions.

All of the functionality that you are familiar with in the DigitalOcean control panel is also available through the API, allowing you to script the complex actions that your situation requires.

The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints.

Requests

Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.

Method Usage
GET For simple retrieval of information about your account, Droplets, or environment, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.
DELETE To destroy a resource and remove it from your account and environment, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource’s availability prior to issuing a delete command, the final state will be the same regardless of its existence.
PUT To update the information about a resource in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object.
POST To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.
HEAD Finally, to retrieve metadata information, you should use the HEAD method to get the headers. This returns only the header of what would be returned with an associated GET request. Response headers contain some useful information about your API access and the results that are available for your request. For instance, the headers contain your current rate-limit value and the amount of time available until the limit resets. It also contains metrics about the total number of objects found, pagination information, and the total content length.
HTTP Statuses

Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.

In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.

In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered.

Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed.

If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently.

EXAMPLE ERROR RESPONSE

HTTP/1.1 403 Forbidden
{
    "id": "forbidden",
    "message":  "You do not have access for the attempted action."
}
Responses

When a request is successful, a response body will typically be sent back in the form of a JSON object. An exception to this is when a DELETE request is processed, which will result in a successful HTTP 204 status and an empty response body.

Inside of this JSON object, the resource root that was the target of the request will be set as the key. This will be the singular form of the word if the request operated on a single object, and the plural form of the word if a collection was processed.

For example, if you send a GET request to /v2/droplets/$DROPLET_ID you will get back an object with a key called “droplet”. However, if you send the GET request to the general collection at /v2/droplets, you will get back an object with a key called “droplets”.

The value of these keys will generally be a JSON object for a request on a single object and an array of objects for a request on a collection of objects.

RESPONSE FOR A SINGLE OBJECT

{
    "droplet": {
        "name": "example.com"
        . . .
    }
} 

RESPONSE FOR AN OBJECT COLLECTION

{
    "droplets": [
        {
            "name": "example.com"
            . . .
        },
        {
            "name": "second.com"
            . . .
        }
    ]
}
Meta

In addition to the main resource root, the response may also contain a meta object. This object contains information about the response itself.

The meta object contains a total key that is set to the total number of objects returned by the request. This has implications on the links object and pagination.

The meta object will only be displayed when it has a value. Currently, the meta object will have a value when a request is made on a collection (like droplets or domains).

SAMPLE META OBJECT

{
    . . .
    "meta": {
        "total": 43
     }
     . . .
}

The links object is returned as part of the response body when pagination is enabled. By default, 25 objects are returned per page. If the response contains 25 objects or fewer, no links object will be returned. If the response contains more than 25 objects, the first 25 will be returned along with the links object.

You can request a different pagination limit or force pagination by appending ?per_page= to the request with the number of items you would like per page. For instance, to show only two results per page, you could add ?per_page=2 to the end of your query.

The links object contains a pages object. The pages object, in turn, contains keys indicating the relationship of additional pages. The values of these are the URLs of the associated pages. The keys will be one of the following:

  • first: The URI of the first page of results.
  • prev: The URI of the previous sequential page of results.
  • next: The URI of the next sequential page of results.
  • last: The URI of the last page of results.

The pages object will only include the links that make sense. So for the first page of results, no first or prev links will ever be set. This convention holds true in other situations where a link would not make sense.

SAMPLE LINKS OBJECT

{
     . . .
    "links": {
        "pages": {
            "last": "https://api.digitalocean.com/v2/images?page=2",
            "next": "https://api.digitalocean.com/v2/images?page=2"
         }
    }
    . . .
}
Rate Limit

The number of requests that can be made through the API is currently limited to 5,000 per hour per OAuth token.

The rate limiting information is contained within the response headers of each request. The relevant headers are:

  • RateLimit-Limit: The number of requests that can be made per hour.
  • RateLimit-Remaining: The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.
  • RateLimit-Reset: This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

As long as the RateLimit-Remaining count is above zero, you will be able to make additional requests.

The way that a request expires and is removed from the current limit count is important to understand. Rather than counting all of the requests for an hour and resetting the RateLimit-Remaining value at the end of the hour, each request instead has its own timer.

This means that each request contributes toward the RateLimit-Remaining count for one complete hour after the request is made. When that request’s timer runs out, it is no longer counted towards the request limit.

This has implications on the meaning of the RateLimit-Reset header as well. Because the entire rate limit is not reset at one time, the value of this header is set to the time when the oldest request will expire.

Keep this in mind if you see your RateLimit-Reset value change, but not move an entire hour into the future.

If the RateLimit-Remaining reaches zero, subsequent requests will receive a 429 error code until the request reset has been reached. You can see the format of the response in the examples.

SAMPLE RATE LIMIT HEADERS

. . .
RateLimit-Limit: 1200
RateLimit-Remaining: 1193
RateLimit-Reset: 1402425459
. . . 

SAMPLE RATE EXCEEDED RESPONSE

429 Too Many Requests
 {
         id: "too_many_requests",
         message: "API Rate limit exceeded."
 }
Curl Examples

Throughout this document, some example API requests will be given using the curl command. This will allow us to demonstrate the various endpoints in a simple, textual format.

The names of account-specific references (like Droplet IDs, for instance) will be represented by variables. For instance, a Droplet ID may be represented by a variable called $DROPLET_ID. You can set the associated variables in your environment if you wish to use the examples without modification.

The first variable that you should set to get started is your OAuth authorization token. The next section will go over the details of this, but you can set an environmental variable for it now.

Generate a token by going to the Apps & API section of the DigitalOcean control panel. Use an existing token if you have saved one, or generate a new token with the “Generate new token” button. Copy the generated token and use it to set and export the TOKEN variable in your environment as the example shows.

You may also wish to set some other variables now or as you go along. For example, you may wish to set the DROPLET_ID variable to one of your droplet IDs since this will be used frequently in the API.

If you are following along, make sure you use a Droplet ID that you control for so that your commands will execute correctly.

If you need access to the headers of a response through curl, you can pass the -i flag to display the header information along with the body. If you are only interested in the header, you can instead pass the -I flag, which will exclude the response body entirely.

SET AND EXPORT YOUR OAUTH TOKEN

export TOKEN=your_token_here 

SET AND EXPORT A VARIABLE

export DROPLET_ID=1111111
OAuth Authentication

In order to interact with the DigitalOcean API, you or your application must authenticate.

The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account in full or in read-only mode.

You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.

An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.

Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.

How to Authenticate with OAuth

There are two separate ways to authenticate using OAuth.

The first option is to send a bearer authorization header with your request. This is the preferred method of authenticating because it completes the authorization request in the header portion, away from the actual request.

You can also authenticate using basic authentication. The normal way to do this with a tool like curl is to use the -u flag which is used for passing authentication information.

You then send the username and password combination delimited by a colon character. We only have an OAuth token, so use the OAuth token as the username and leave the password field blank (make sure to include the colon character though).

This is effectively the same as embedding the authentication information within the URI itself.

AUTHENTICATE WITH A BEARER AUTHORIZATION HEADER

curl -X $HTTP_METHOD -H "Authorization: Bearer $TOKEN" "https://api.digitalocean.com/v2/$OBJECT" 

AUTHENTICATE WITH BASIC AUTHENTICATION

curl -X $HTTP_METHOD -u "$TOKEN:" "https://api.digitalocean.com/v2/$OBJECT"
Parameters

There are two different ways to pass parameters in a request with the API.

The best way to pass parameters is as a JSON object containing the appropriate attribute names and values as key-value pairs. When you use this format, you should specify that you are sending a JSON object in the header.

This is done by setting the Content-Type header to application/json. This ensures that your request is interpreted correctly.

Another way of passing parameters is using standard query attributes.

Using this format, you would pass the attributes within the URI itself. Tools like curl can take parameters and value as arguments to create the appropriate URI.

With curl this is done using the -F flag and then passing the key and value as an argument. The argument should take the form of a quoted string with the attribute being set to a value with an equal sign.

You could also use a standard query string if that would be easier in our application. In this case, the parameters would be embedded into the URI itself by appending a ? to the end of the URI and then setting each attribute with an equal sign. Attributes can be separated with a &.

PASS PARAMETERS AS A JSON OBJECT

curl -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"name": "example.com", "ip_address": "127.0.0.1"}' \
     -X POST "https://api.digitalocean.com/v2/domains" 

PASS PARAMETERS AS URI COMPONENTS

curl -H "Authorization: Bearer $TOKEN" \
     -F "name=example.com" -F "ip_address=127.0.0.1" \
     -X POST "https://api.digitalocean.com/v2/domains" 

PASS PARAMETERS AS A QUERY STRING

curl -H "Authorization: Bearer $TOKEN" \
     -X POST \
     "https://api.digitalocean.com/v2/domains?name=example.com&ip_address=127.0.0.1"
Cross Origin Resource Sharing
CORS

In order to make requests to the API from other domains, the API implements Cross Origin Resource Sharing (CORS) support.

CORS support is generally used to create AJAX requests outside of the domain that the request originated from. This is necessary to implement projects like control panels utilizing the API. This tells the browser that it can send requests to an outside domain.

The procedure that the browser initiates in order to perform these actions (other than GET requests) begins by sending a “preflight” request. This sets the Origin header and uses the OPTIONS method. The server will reply back with the methods it allows and some of the limits it imposes. The client then sends the actual request if it falls within the allowed constraints.

This process is usually done in the background by the browser, but you can use curl to emulate this process using the example provided. The headers that will be set to show the constraints are:

  • Access-Control-Allow-Origin: This is the domain that is sent by the client or browser as the origin of the request. It is set through an Origin header.

  • Access-Control-Allow-Methods: This specifies the allowed options for requests from that domain. This will generally be all available methods.

  • Access-Control-Expose-Headers: This will contain the headers that will be available to requests from the origin domain.

  • Access-Control-Max-Age: This is the length of time that the access is considered valid. After this expires, a new preflight should be sent.

  • Access-Control-Allow-Credentials: This will be set to true. It basically allows you to send your OAuth token for authentication.

You should not need to be concerned with the details of these headers, because the browser will typically do all of the work for you.

EXAMPLE PREFLIGHT REQUEST

curl -I -H "Origin: https://example.com" -X OPTIONS "https://api.digitalocean.com/v2/droplets" 

EXAMPLE PREFLIGHT RESPONSE

. . .
Access-Control-Allow-Origin: https://example.com
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Expose-Headers: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, Total, Link
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
. . .
API Methods
Account
GET /account
Get User Information
Tags Testing
GET /account

Get User Information.

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
content-type
string required
Default:
Example:
application/json; charset=utf-8
Body
Object
Account
Object
droplet_limit
number

The total number of droplets the user may have

email
string

The email the user has registered for Digital Ocean with

uuid
string

The universal identifier for this user

email_verified
boolean

If true, the user has verified their account via email. False otherwise.

CURL
Example 1
curl -X GET -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582' \
     "https://api.digitalocean.com/v2/account"
GET https://api.digitalocean.com/v2/account HTTP/1.1 

Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582
Content-Type: application/json

HTTP/1.1 200 OK 

Content-Type: application/json

{
  "account": {
    "droplet_limit": 25,
    "email": "web@digitalocean.com",
    "uuid": "b6fc48dbf6d9906cace5f3c78dc9851e757381ef",
    "email_verified": true
  }
}
Actions

Actions are records of events that have occurred on the resources in your account. These can be things like rebooting a Droplet, or transferring an image to a new region.

An action object is created every time one of these actions is initiated. The action object contains information about the current status of the action, start and complete timestamps, and the associated resource type and ID.

Every action that creates an action object is available through this endpoint. Completed actions are not removed from this list and are always available for querying.

GET /actions
GET /actions/{ACTION_ID}
List all Actions
GET /actions

To list all of the actions that have been executed on the current account, send a GET request to /v2/actions.

This will be the entire list of actions taken on your account, so it will be quite large. As with any large collection returned by the API, the results will be paginated with only 25 on each page by default.

The results will be returned as a JSON object with an actions key. This will be set to an array filled with action objects containing the standard action attributes:

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/actions?page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "actions": [
    {
      "id": 36804636,
      "status": "completed",
      "type": "create",
      "started_at": "2014-11-14T16:29:21Z",
      "completed_at": "2014-11-14T16:30:06Z",
      "resource_id": 3164444,
      "resource_type": "droplet",
      "region": "nyc3",
      "region_slug": "nyc3"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/actions?page=159&per_page=1",
      "next": "https://api.digitalocean.com/v2/actions?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 159
  }
}
Retrieve an existing Action
GET /actions/{ACTION_ID}

To retrieve a specific action object, send a GET request to /actions/{ACTION_ID}. The result will be a JSON object with an action key. This will be set to an action object containing the standard action attributes

Path variables

ACTION_ID
string required
Example:
36804636

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
action
404 Not Found
Example 1
GET https://api.digitalocean.com/v2/actions/36804636 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1123
ratelimit-reset: 1415984218

{
    "action": {
        "id": "36804636",
        "status": "completed",
        "type": "create",
        "started_at": "2014-11-14T16:29:21Z",
        "completed_at": "2014-11-14T16:30:06Z",
        "resource_id": "3164444",
        "resource_type": "droplet",
        "region": "nyc3",
        "region_slug": "nyc3"
    }
}
Domains

Domain resources are domain names that you have purchased from a domain name registrar that you are managing through the DigitalOcean DNS interface.

This resource establishes top-level control over each domain. Actions that affect individual domain records should be taken on the [Domain Records] resource.

GET /domains
POST /domains
GET /domains/{DOMAIN_NAME}
DELETE /domains/{DOMAIN_NAME}
List all Domains
GET /domains

To retrieve a list of all of the domains in your account, send a GET request to /domains.

The response will be a JSON object with a key called domains. The value of this will be an array of Domain objects, each of which contain the standard domain attributes

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/domains HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "domains": [
    {
      "name": "digitaloceanisthebombdiggity.com",
      "ttl": 1800,
      "zone_file": "$ORIGIN digitaloceanisthebombdiggity.com.\n$TTL 1800\ndigitaloceanisthebombdiggity.com. IN SOA ns1.digitalocean.com. hostmaster.digitaloceanisthebombdiggity.com. 1415982609 10800 3600 604800 1800\ndigitaloceanisthebombdiggity.com. 1800 IN NS ns1.digitalocean.com.\ndigitaloceanisthebombdiggity.com. 1800 IN NS ns2.digitalocean.com.\ndigitaloceanisthebombdiggity.com. 1800 IN NS ns3.digitalocean.com.\ndigitaloceanisthebombdiggity.com. 1800 IN A 1.2.3.4\n"
    }
  ],
  "links": {
  },
  "meta": {
    "total": 1
  }
}
Create a new Domain
POST /domains

To create a new domain, send a POST request to /domains. Set the “name” attribute to the domain name you are adding. Set the “ip_address” attribute to the IP address you want to point the domain to. Keep in mind that, upon creation, the zone_file field will have a value of null until a zone file is generated and propagated through an automatic process on the DigitalOcean servers.

Request parameters

To create a new domain, send a POST request to /domains. Set the “name” attribute to the domain name you are adding. Set the “ip_address” attribute to the IP address you want to point the domain to.

Request headers

To create a new domain, send a POST request to /domains. Set the “name” attribute to the domain name you are adding. Set the “ip_address” attribute to the IP address you want to point the domain to.

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
name
string

The domain name to add to the DigitalOcean DNS management interface. The name must be unique in DigitalOcean’s DNS system. The request will fail if the name has already been taken.

Example:
digitaloceanisthebombdiggity.com
ip_address
string

This attribute contains the IP address you want the domain to point to.

Example:
1.2.3.4

Responses

201 Created

The response will be a JSON object with a key called domain. The value of this will be an object that contains the standard attributes associated with a domain

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
domain
CURL
HTTP
curl -X POST "https://api.digitalocean.com/v2/domains"  \
 -H "Content-Type: application/json"  \
 -H "Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582"  \
 -d '{
    "name": "digitaloceanisthebombdiggity.com",
    "ip_address": "1.2.3.4"
}'
POST https://api.digitalocean.com/v2/domains HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
  "name": "digitaloceanisthebombdiggity.com",
  "ip_address": "1.2.3.4"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "domain": {
    "name": "digitaloceanisthebombdiggity.com",
    "ttl": 1800,
    "zone_file": null
  }
}
Retrieve an existing Domain
GET /domains/{DOMAIN_NAME}

To get details about a specific domain, send a GET request to /domains/{DOMAIN_NAME}. The response will be a JSON object with a key called domain. The value of this will be an object that contains the standard attributes defined for a domain

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
domain
404 Not Found
Example 1
GET https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "domain": {
    "name": "digitaloceanisthebombdiggity.com",
    "ttl": 1800,
    "zone_file": "$ORIGIN digitaloceanisthebombdiggity.com.\n$TTL 1800\ndigitaloceanisthebombdiggity.com. IN SOA ns1.digitalocean.com. hostmaster.digitaloceanisthebombdiggity.com. 1415982611 10800 3600 604800 1800\ndigitaloceanisthebombdiggity.com. 1800 IN NS ns1.digitalocean.com.\ndigitaloceanisthebombdiggity.com. 1800 IN NS ns2.digitalocean.com.\ndigitaloceanisthebombdiggity.com. 1800 IN NS ns3.digitalocean.com.\ndigitaloceanisthebombdiggity.com. 1800 IN A 1.2.3.4\n"
  }
}
Delete a Domain
DELETE /domains/{DOMAIN_NAME}

To delete a domain, send a DELETE request to /domains/{DOMAIN_NAME}.

The domain will be removed from your account and a response status of 204 will be returned. This indicates a successful request with no response body.

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

204 No Content
Example 1
DELETE https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 204 No Content 
Domain Records

Domain record resources are used to set or retrieve information about the individual DNS records configured for a domain. This allows you to build and manage DNS zone files by adding and modifying individual records for a domain.

The DigitalOcean DNS management interface allows you to configure the following DNS records:

There is also an additional field called id that is auto-assigned for each record and used as a unique identifier for requests. Each record contains all of these attribute types. For record types that do not utilize all fields, a value of null will be set for that record.

GET /domains/{DOMAIN_NAME}/records
POST /domains/{DOMAIN_NAME}/records
GET /domains/{DOMAIN_NAME}/records/{RECORD_ID}
PUT /domains/{DOMAIN_NAME}/records/{RECORD_ID}
DELETE /domains/{DOMAIN_NAME}/records/{RECORD_ID}
List all Domain Records
GET /domains/{DOMAIN_NAME}/records

To get a listing of all records configured for a domain, send a GET request to /domains/{DOMAIN_NAME}/records.

The response will be a JSON object with a key called domain_records. The value of this will be an array of domain record objects, each of which contains the standard domain record attributes

For attributes that are not used by a specific record type, a value of null will be returned. For instance, all records other than SRV will have null for the weight and port attributes.

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
domain_records
Example 1
GET https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com/records HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "domain_records": [
    {
      "id": 3352892,
      "type": "NS",
      "name": "@",
      "data": "ns1.digitalocean.com",
      "priority": null,
      "port": null,
      "weight": null
    },
    {
      "id": 3352893,
      "type": "NS",
      "name": "@",
      "data": "ns2.digitalocean.com",
      "priority": null,
      "port": null,
      "weight": null
    },
    {
      "id": 3352894,
      "type": "NS",
      "name": "@",
      "data": "ns3.digitalocean.com",
      "priority": null,
      "port": null,
      "weight": null
    },
    {
      "id": 3352895,
      "type": "A",
      "name": "@",
      "data": "1.2.3.4",
      "priority": null,
      "port": null,
      "weight": null
    }
  ],
  "links": {
  },
  "meta": {
    "total": 4
  }
}
Create a new Domain Record
POST /domains/{DOMAIN_NAME}/records

To create a new record to a domain, send a POST request to /domains/{DOMAIN_NAME}/records.

The request must include all of the required fields for the domain record type being added. The required attributes per domain record type.

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Responses

201 Created

The response body will be a JSON object with a key called domain_record. The value of this will be an object representing the new record. Attributes that are not applicable for the record type will be set to null. An id attribute is generated for each record as part of the object.

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
domain_record
Example 1
POST https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com/records HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
  "type": "A",
  "name": "customdomainrecord.com",
  "data": "162.10.66.0",
  "priority": null,
  "port": null,
  "weight": null
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1120
ratelimit-reset: 1415984218

{
  "domain_record": {
    "id": 3352896,
    "type": "A",
    "name": "customdomainrecord.com",
    "data": "162.10.66.0",
    "priority": null,
    "port": null,
    "weight": null
  }
}
Retrieve an existing Domain Record
GET /domains/{DOMAIN_NAME}/records/{RECORD_ID}

To retrieve a specific domain record, send a GET request to /domains/{DOMAIN_NAME}/records/{RECORD_ID}.

The response will be a JSON object with a key called domain_record. The value of this will be an object that contains all of the standard domain record attributes

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com
RECORD_ID
string required
Example:
3352896

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
domain_record
404 Not Found
Example 1
GET https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com/records/3352896 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "domain_record": {
    "id": 3352896,
    "type": "A",
    "name": "customdomainrecord.com",
    "data": "162.10.66.0",
    "priority": null,
    "port": null,
    "weight": null
  }
}
Update a Domain Record
PUT /domains/{DOMAIN_NAME}/records/{RECORD_ID}

To update an existing record, send a PUT request to /domains/{DOMAIN_NAME}/records/{RECORD_ID}. Any attribute valid for the record type can be set to a new value for the record.

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com
RECORD_ID
string required
Example:
3352896

Request headers

Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582
Content-Type
string required
Example:
application/json

Request body

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
domain_record
Example 1
PUT https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com/records/3352896 HTTP/1.1 

Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582
Content-Type: application/json

{
 "name": "updated-record-name.com"
}

HTTP/1.1 200 OK 

content-type: content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1118
ratelimit-reset: 1415984218

{
  "domain_record": {
    "id": 3352896,
    "type": "A",
    "name": "updated-record-name.com",
    "data": "162.10.66.0",
    "priority": null,
    "port": null,
    "weight": null
  }
}
Delete a Domain Record
DELETE /domains/{DOMAIN_NAME}/records/{RECORD_ID}

To delete a record for a domain, send a DELETE request to /domains/{DOMAIN_NAME}/records/{RECORD_ID}.

The record will be deleted and the response status will be a 204. This indicates a successful request with no body returned.

Path variables

DOMAIN_NAME
string required
Example:
digitaloceanisthebombdiggity.com
RECORD_ID
string required
Example:
3352896

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

204 No Content
Example 1
DELETE https://api.digitalocean.com/v2/domains/digitaloceanisthebombdiggity.com/records/3352896 HTTP/1.1 

HTTP/1.1 204 No Content 
Droplets

A Droplet is a DigitalOcean virtual machine. By sending requests to the Droplet endpoint, you can list, create, or delete Droplets.

Some of the attributes will have an object value. The region and image objects will all contain the standard attributes of their associated types. Find more information about each of these objects in their respective sections.

POST /droplets
GET /droplets/{DROPLET_ID}
GET /droplets
GET /droplets/{DROPLET_ID}/kernels
GET /droplets/{DROPLET_ID}/snapshots
GET /droplets/{DROPLET_ID}/backups
GET /droplets/{DROPLET_ID}/actions
DELETE /droplets/{DROPLET_ID}
GET /droplets/{id}/neighbors
GET /reports/droplet_neighbors
GET /droplet_upgrades
Create a new Droplet
POST /droplets

To create a new Droplet, send a POST request to /droplets.

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
name
string

The human-readable string you wish to use when displaying the Droplet name. The name, if set to a domain name managed in the DigitalOcean DNS management system, will configure a PTR record for the Droplet. The name set during creation will also determine the hostname for the Droplet in its internal configuration.

region
string

The unique slug identifier for the region that you wish to deploy in.

size
string

The unique slug identifier for the size that you wish to select for this Droplet.

image
number

The image ID of a public or private image, or the unique slug identifier for a public image. This image will be the base image for your Droplet.

ssh_keys
string

An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet’s root account upon creation.

backups
boolean

A boolean indicating whether automated backups should be enabled for the Droplet. Automated backups can only be enabled when the Droplet is created.

ipv6
boolean

A boolean indicating whether IPv6 is enabled on the Droplet.

private_networking
boolean

A boolean indicating whether private networking is enabled for the Droplet. Private networking is currently only available in certain regions.

user_data
string

A string of the desired User Data for the Droplet. User Data is currently only available in regions with metadata listed in their features.

Responses

201 Created

A Droplet will be created using the provided information. The response body will contain a JSON object with a key called droplet. The value will be an object containing the standard attributes for your new Droplet

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
droplet
Example 1
POST https://api.digitalocean.com/v2/droplets HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
  "name": "example.com",
  "region": "nyc3",
  "size": "512mb",
  "image": "ubuntu-14-04-x64",
  "ssh_keys": null,
  "backups": false,
  "ipv6": true,
  "user_data": null,
  "private_networking": null
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 965
ratelimit-reset: 1415984218

{
  "droplet": {
    "id": 3164494,
    "name": "example.com",
    "memory": 512,
    "vcpus": 1,
    "disk": 20,
    "locked": true,
    "status": "new",
    "kernel": {
      "id": 2233,
      "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
      "version": "3.13.0-37-generic"
    },
    "created_at": "2014-11-14T16:36:31Z",
    "features": [
      "virtio"
    ],
    "backup_ids": [

    ],
    "snapshot_ids": [

    ],
    "image": {
    },
    "size": {
    },
    "size_slug": "512mb",
    "networks": {
    },
    "region": {
    }
  },
  "links": {
    "actions": [
      {
        "id": 36805096,
        "rel": "create",
        "href": "https://api.digitalocean.com/v2/actions/36805096"
      }
    ]
  }
}
Retrieve an existing Droplet by id
GET /droplets/{DROPLET_ID}

To show an individual droplet, send a GET request to /droplets/$DROPLET_ID.

The response will be a JSON object with a key called droplet. This will be set to a JSON object that contains the Droplet’s attributes

Path variables

DROPLET_ID
string required
Example:
3164494

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
droplet
404 Not Found
Example 1
GET https://api.digitalocean.com/v2/droplets/3164494 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 902
ratelimit-reset: 1415984218

{
  "droplet": {
    "id": 3164494,
    "name": "example.com",
    "memory": 512,
    "vcpus": 1,
    "disk": 20,
    "locked": false,
    "status": "active",
    "kernel": {
      "id": 2233,
      "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
      "version": "3.13.0-37-generic"
    },
    "created_at": "2014-11-14T16:36:31Z",
    "features": [
      "ipv6",
      "virtio"
    ],
    "backup_ids": [

    ],
    "snapshot_ids": [
      7938206
    ],
    "image": {
      "id": 6918990,
      "name": "14.04 x64",
      "distribution": "Ubuntu",
      "slug": "ubuntu-14-04-x64",
      "public": true,
      "regions": [
        "nyc1",
        "ams1",
        "sfo1",
        "nyc2",
        "ams2",
        "sgp1",
        "lon1",
        "nyc3",
        "ams3",
        "nyc3"
      ],
      "created_at": "2014-10-17T20:24:33Z",
      "type": "snapshot",
      "min_disk_size": 20
    },
    "size": {
    },
    "size_slug": "512mb",
    "networks": {
      "v4": [
        {
          "ip_address": "104.131.186.241",
          "netmask": "255.255.240.0",
          "gateway": "104.131.176.1",
          "type": "public"
        }
      ],
      "v6": [
        {
          "ip_address": "2604:A880:0800:0010:0000:0000:031D:2001",
          "netmask": 64,
          "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
          "type": "public"
        }
      ]
    },
    "region": {
      "name": "New York 3",
      "slug": "nyc3",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups",
        "ipv6",
        "metadata"
      ],
      "available": true
    }
  }
}
List All Droplets
GET /droplets

To list all Droplets in your account, send a GET request to /droplets.

The response body will be a JSON object with a key of droplets. This will be set to an array containing objects representing each Droplet. These will contain the standard Droplet attributes

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/droplets?page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "droplets": [
    {
      "id": 3164444,
      "name": "example.com",
      "memory": 512,
      "vcpus": 1,
      "disk": 20,
      "locked": false,
      "status": "active",
      "kernel": {
        "id": 2233,
        "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
        "version": "3.13.0-37-generic"
      },
      "created_at": "2014-11-14T16:29:21Z",
      "features": [
        "backups",
        "ipv6",
        "virtio"
      ],
      "backup_ids": [
        7938002
      ],
      "snapshot_ids": [

      ],
      "image": {
        "id": 6918990,
        "name": "14.04 x64",
        "distribution": "Ubuntu",
        "slug": "ubuntu-14-04-x64",
        "public": true,
        "regions": [
          "nyc1",
          "ams1",
          "sfo1",
          "nyc2",
          "ams2",
          "sgp1",
          "lon1",
          "nyc3",
          "ams3",
          "nyc3"
        ],
        "created_at": "2014-10-17T20:24:33Z",
        "type": "snapshot",
        "min_disk_size": 20
      },
      "size": {
      },
      "size_slug": "512mb",
      "networks": {
        "v4": [
          {
            "ip_address": "104.236.32.182",
            "netmask": "255.255.192.0",
            "gateway": "104.236.0.1",
            "type": "public"
          }
        ],
        "v6": [
          {
            "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001",
            "netmask": 64,
            "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
            "type": "public"
          }
        ]
      },
      "region": {
        "name": "New York 3",
        "slug": "nyc3",
        "sizes": [

        ],
        "features": [
          "virtio",
          "private_networking",
          "backups",
          "ipv6",
          "metadata"
        ],
        "available": null
      }
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/droplets?page=3&per_page=1",
      "next": "https://api.digitalocean.com/v2/droplets?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 3
  }
}
List all available Kernels for a Droplet
GET /droplets/{DROPLET_ID}/kernels

To retrieve a list of all kernels available to a Dropet, send a GET request to /droplets/$DROPLET_ID/kernels.

The response will be a JSON object that has a key called kernels. This will be set to an array of kernel objects, each of which contain the standard kernel attributes

Path variables

DROPLET_ID
string required
Example:
3164494

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/droplets/3164494/kernels HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 946
ratelimit-reset: 1415984218

{
  "kernels": [
    {
      "id": 231,
      "name": "DO-recovery-static-fsck",
      "version": "3.8.0-25-generic"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/droplets/3164494/kernels?page=124&per_page=1",
      "next": "https://api.digitalocean.com/v2/droplets/3164494/kernels?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 124
  }
}
List snapshots for a Droplet
GET /droplets/{DROPLET_ID}/snapshots

To retrieve the snapshots that have been created from a Droplet, sent a GET request to /droplets/{DROPLET_ID}/snapshots.

You will get back a JSON object that has a snapshots key. This will be set to an array of snapshot objects, each of which contain the standard image attributes

Path variables

DROPLET_ID
string required
Example:
3164494

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/droplets/3164494/snapshots HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "snapshots": [
    {
      "id": 7938206,
      "name": "nginx-fresh",
      "distribution": "Ubuntu",
      "slug": null,
      "public": false,
      "regions": [
        "nyc3",
        "nyc3"
      ],
      "created_at": "2014-11-14T16:37:34Z",
      "type": "snapshot",
      "min_disk_size": 20
    }
  ],
  "links": {
  },
  "meta": {
    "total": 1
  }
}
List backups for a Droplet
GET /droplets/{DROPLET_ID}/backups

To retrieve any backups associated with a Droplet, sent a GET request to /droplets/{DROPLET_ID}/backups.

You will get back a JSON object that has a backups key. This will be set to an array of backup objects, each of which contain the standard image attributes.

Path variables

DROPLET_ID
string required
Example:
3067509

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
backups

“Type” in snapshot object will be “backup”

Example 1
GET https://api.digitalocean.com/v2/droplets/3067509/backups HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "backups": [
    {
      "id": 7622989,
      "name": "example.com 2014-11-14",
      "distribution": "Ubuntu",
      "slug": null,
      "public": false,
      "regions": [
        "nyc3"
      ],
      "created_at": "2014-11-14T16:07:38Z",
      "type": "snapshot",
      "min_disk_size": 20
    }
  ],
  "meta": {
    "total": 1
  }
}
List actions for a Droplet
GET /droplets/{DROPLET_ID}/actions

To retrieve all actions that have been executed on a Droplet, send a GET request to /droplets/{DROPLET_ID}/actions.

The results will be returned as a JSON object with an actions key. This will be set to an array filled with action objects containing the standard action attribute

Path variables

DROPLET_ID
string required
Example:
3164494

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/droplets/3164494/actions?page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "actions": [
    {
      "id": 36805187,
      "status": "completed",
      "type": "snapshot",
      "started_at": "2014-11-14T16:37:34Z",
      "completed_at": "2014-11-14T16:39:32Z",
      "resource_id": 3164494,
      "resource_type": "droplet",
      "region": "nyc3",
      "region_slug": "nyc3"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/droplets/3164494/actions?page=3&per_page=1",
      "next": "https://api.digitalocean.com/v2/droplets/3164494/actions?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 3
  }
}
Delete a Droplet
DELETE /droplets/{DROPLET_ID}

To delete a Droplet, send a DELETE request to /droplets/{DROPLET_ID}.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Path variables

DROPLET_ID
string required

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

204 No Content
Example 1
DELETE https://api.digitalocean.com/v2/droplets/3164494 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 204 No Content 
List Neighbors for a Droplet
GET /droplets/{id}/neighbors

To retrieve a list of droplets that are running on the same physical server, send a GET request to /droplets/{id}/neighbors

The results will be returned as a JSON array containing any other droplets that share the samp physical hardware.

Path variables

id
string required

3164494

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
droplets
Example 1
GET https://api.digitalocean.com/v2/droplets/3164444/neighbors HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 903
ratelimit-reset: 1415984218

{
  "droplets": [
    {
      "id": 3164444,
      "name": "example.com",
      "memory": 512,
      "vcpus": 1,
      "disk": 20,
      "locked": false,
      "status": "active",
      "kernel": {
        "id": 2233,
        "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
        "version": "3.13.0-37-generic"
      },
      "created_at": "2014-11-14T16:29:21Z",
      "features": [
        "backups",
        "ipv6",
        "virtio"
      ],
      "backup_ids": [
        7938002
      ],
      "snapshot_ids": [

      ],
      "image": {
        "id": 6918990,
        "name": "14.04 x64",
        "distribution": "Ubuntu",
        "slug": "ubuntu-14-04-x64",
        "public": true,
        "regions": [
          "nyc1",
          "ams1",
          "sfo1",
          "nyc2",
          "ams2",
          "sgp1",
          "lon1",
          "nyc3",
          "ams3",
          "nyc3"
        ],
        "created_at": "2014-10-17T20:24:33Z",
        "type": "snapshot",
        "min_disk_size": 20
      },
      "size": {
      },
      "size_slug": "512mb",
      "networks": {
        "v4": [
          {
            "ip_address": "104.236.32.182",
            "netmask": "255.255.192.0",
            "gateway": "104.236.0.1",
            "type": "public"
          }
        ],
        "v6": [
          {
            "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001",
            "netmask": 64,
            "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
            "type": "public"
          }
        ]
      },
      "region": {
        "name": "New York 3",
        "slug": "nyc3",
        "sizes": [

        ],
        "features": [
          "virtio",
          "private_networking",
          "backups",
          "ipv6",
          "metadata"
        ],
        "available": null
      }
    }
  ]
}
List all Droplet Neighbors
GET /reports/droplet_neighbors

To retrieve a list of any droplets that are running on the same physical hardware, send a GET request to /reports/droplet_neighbors

The results will be returned as a JSON array containing more arrays, one for each set of droplets that share a physical server.

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
content-type
string required
Default:
Example:
application/json; charset=utf-8
Body
Array
Object
neighbors
Example 1
GET https://api.digitalocean.com/v2/reports/droplet_neighbors HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218
content-type: application/json

[
  {
    "neighbors": [
      [
        {
          "id": 3164444,
          "name": "example.com",
          "memory": 512,
          "vcpus": 1,
          "disk": 20,
          "locked": false,
          "status": "active",
          "kernel": {
            "id": 2233,
            "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
            "version": "3.13.0-37-generic"
          },
          "created_at": "2014-11-14T16:29:21Z",
          "features": [
            "backups",
            "ipv6",
            "virtio"
          ],
          "backup_ids": [
            7938002
          ],
          "snapshot_ids": [

          ],
          "image": {
            "id": 6918990,
            "name": "14.04 x64",
            "distribution": "Ubuntu",
            "slug": "ubuntu-14-04-x64",
            "public": true,
            "regions": [
              "nyc1",
              "ams1",
              "sfo1",
              "nyc2",
              "ams2",
              "sgp1",
              "lon1",
              "nyc3",
              "ams3",
              "nyc3"
            ],
            "created_at": "2014-10-17T20:24:33Z",
            "type": "snapshot",
            "min_disk_size": 20
          },
          "size": {
          },
          "size_slug": "512mb",
          "networks": {
            "v4": [
              {
                "ip_address": "104.236.32.182",
                "netmask": "255.255.192.0",
                "gateway": "104.236.0.1",
                "type": "public"
              }
            ],
            "v6": [
              {
                "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001",
                "netmask": 64,
                "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
                "type": "public"
              }
            ]
          },
          "region": {
            "name": "New York 3",
            "slug": "nyc3",
            "sizes": [

            ],
            "features": [
              "virtio",
              "private_networking",
              "backups",
              "ipv6",
              "metadata"
            ],
            "available": null
          }
        }
      ]
    ]
  }
]
List Droplet Upgrades
GET /droplet_upgrades

To retrieve a list of droplets that are scheduled to be upgraded, send a GET request to /droplet_upgrades

The results will be returned as a JSON array containing details about the schedule and droplet id.

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Array
Object
droplet_id
number

The affected droplet’s ID

Example:
1
date_of_migration
string

A time value given in ISO8601 combined date and time format that represents when the migration will occur for the droplet.

url
string

A URL pointing to the Droplet’s API endpoint. This is the endpoint to be used if you want to retrieve information about the droplet.

Example 1
GET https://api.digitalocean.com/v2/droplet_upgrades HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

[
  {
    "droplet_id": 123,
    "date_of_migration": "2014-12-01T12:00:00Z",
    "url": "https://api.digitalocean.com/v2/droplets/123"
  }
]
Droplet Actions

Droplet actions are tasks that can be executed on a Droplet. These can be things like rebooting, resizing, snapshotting, etc.

Droplet action requests are generally targeted at one of the “actions” endpoints for a specific Droplet. The specific actions are usually initiated by sending a POST request with the action and arguments as parameters.

Droplet action requests create a Droplet actions object, which can be used to get information about the status of an action. Creating a Droplet action is asynchronous: the HTTP call will return the action object before the action has finished processing on the Droplet. The current status of an action can be retrieved from either the Droplet actions endpoint or the global actions endpoint. If a Droplet action is uncompleted it may block the creation of a subsequent action for that Droplet, the locked attribute of the Droplet will be true and attempts to create a Droplet action will fail with a status of 422.

POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
POST /droplets/{DROPLET_ID}/actions
GET /droplets/{DROPLET_ID}/actions/{ACTION_ID}
Disable Backups
POST /droplets/{DROPLET_ID}/actions

To disable backups on an existing Droplet send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to disable_backups.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be disable_backups

Example:
disable_backups

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
action
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "disable_backups"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804745,
    "status": "in-progress",
    "type": "disable_backups",
    "started_at": "2014-11-14T16:30:56Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Reboot a Droplet
POST /droplets/{DROPLET_ID}/actions

To reboot a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to reboot.

A reboot action is an attempt to reboot the Droplet in a graceful way, similar to using the reboot command from the console.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be reboot

Example:
reboot

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582
Content-Type: application/json

{
    "type": "reboot"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1097
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804748,
    "status": "in-progress",
    "type": "reboot",
    "started_at": "2014-11-14T16:31:00Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Power Cycle a Droplet
POST /droplets/{DROPLET_ID}/actions

To power cycle a Droplet (power off and then back on), send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to power_cycle.

A powercycle action is similar to pushing the reset button on a physical machine, it’s similar to booting from scratch.

Path variables

DROPLET_ID
string required

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be power_cycle

Example:
power_cycle

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "power_cycle"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804749,
    "status": "in-progress",
    "type": "power_cycle",
    "started_at": "2014-11-14T16:31:03Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Shutdown A Droplet
POST /droplets/{DROPLET_ID}/actions

To shutdown a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to shutdown.

A shutdown action is an attempt to shutdown the Droplet in a graceful way, similar to using the shutdown command from the console. This is the preferred way to turn off a Droplet.

Path variables

DROPLET_ID
string required
Example:
3067649

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be shutdown

Example:
shutdown

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3067649/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "shutdown"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36077293,
    "status": "in-progress",
    "type": "shutdown",
    "started_at": "2014-11-04T17:08:03Z",
    "completed_at": null,
    "resource_id": 3067649,
    "resource_type": "droplet",
    "region": "nyc2",
    "region_slug": "nyc2"
  }
}
Power Off a Droplet
POST /droplets/{DROPLET_ID}/actions

To power off a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to power_off.

A power_off event is a hard shutdown and should only be used if the shutdown action is not successful. It is similar to cutting the power on a server and could lead to complications.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be power_off

Example:
power_off

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object.

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "power_off"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1095
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804751,
    "status": "in-progress",
    "type": "power_off",
    "started_at": "2014-11-14T16:31:07Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Power On a Droplet
POST /droplets/{DROPLET_ID}/actions

To power on a Droplet, send a POST request to /droplets/$DROPLET_ID/actions. Set the “type” attribute to power_on.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be power_on

Example:
power_on

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object.

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "power_on"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1088
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804758,
    "status": "in-progress",
    "type": "power_on",
    "started_at": "2014-11-14T16:31:19Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Restore a Droplet
POST /droplets/{DROPLET_ID}/actions

To restore a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to restore and the “image” attribute to an image ID.

A Droplet restoration will rebuild an image using a backup image. The image ID that is passed in must be a backup of the current Droplet instance. The operation will leave any embedded SSH keys intact.

Path variables

DROPLET_ID
string required
Example:
3067649

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be restore

Example:
restore
image
string

An image slug or ID. This represents the image that the Droplet will use as a base.

Example:
12389723

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3067649/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "restore",
    "image": "12389723"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1088
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36077293,
    "status": "in-progress",
    "type": "restore",
    "started_at": "2014-11-04T17:08:03Z",
    "completed_at": null,
    "resource_id": 3067649,
    "resource_type": "droplet",
    "region": "nyc2",
    "region_slug": "nyc2"
  }
}
Password Reset a Droplet
POST /droplets/{DROPLET_ID}/actions

To reset the password for a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to password_reset.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be password_reset

Example:
password_reset

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
  "type": "password_reset"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804760,
    "status": "in-progress",
    "type": "password_reset",
    "started_at": "2014-11-14T16:31:25Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Resize a Droplet
POST /droplets/{DROPLET_ID}/actions

To resize a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to resize and the “size” attribute to a sizes slug. If a permanent resize, with disk changes included, is desired, set the “disk” attribute to true.

The Droplet must be powered off prior to resizing.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be resize

Example:
resuze
disk
boolean nullable

Whether to increase disk size

Example:
true
size
string

The size slug that you want to resize to.

Example:
1gb

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "resuze",
    "disk": "true",
    "size": "1gb"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1046
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804888,
    "status": "in-progress",
    "type": "resize",
    "started_at": "2014-11-14T16:33:17Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Rebuild a Droplet
POST /droplets/{DROPLET_ID}/actions

To rebuild a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to rebuild and the “image” attribute to an image ID or slug.

A rebuild action functions just like a new create.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be rebuild

Example:
rebuild
image
string

An image slug or ID. This represents the image that the Droplet will use as a base.

Example:
ubuntu-14-04-x64

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "rebuild",
    "image": "ubuntu-14-04-x64"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804899,
    "status": "in-progress",
    "type": "rebuild",
    "started_at": "2014-11-14T16:33:23Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Rename a Droplet
POST /droplets/{DROPLET_ID}/actions

To rename a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to rename and the “name” attribute to the new name for the droplet.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be rename

Example:
rename
name
string

The new name for the Droplet.

Example:
nifty-new-name

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "rename",
    "name": "nifty-new-name"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1025
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804946,
    "status": "in-progress",
    "type": "rename",
    "started_at": "2014-11-14T16:34:16Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Change the Kernel
POST /droplets/{DROPLET_ID}/actions

To change the kernel of a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to change_kernel and the “kernel” attribute to the new kernel’s ID.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be change_kernel

Example:
change_kernel
kernel
number

A unique number used to identify and reference a specific kernel.

Example:
991

Responses

201 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "change_kernel",
    "kernel": 991
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804951,
    "status": "in-progress",
    "type": "change_kernel",
    "started_at": "2014-11-14T16:34:20Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Enable IPv6
POST /droplets/{DROPLET_ID}/actions

To enable IPv6 networking on an existing Droplet (within a region that has IPv6 available), send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to enable_ipv6.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be enable_ipv6

Example:
enable_ipv6

Responses

201 Created

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "enable_ipv6"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804954,
    "status": "in-progress",
    "type": "enable_ipv6",
    "started_at": "2014-11-14T16:34:24Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Enable Private Networking
POST /droplets/{DROPLET_ID}/actions

o enable private networking on an existing Droplet (within a region that has private networking available), send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to enable_private_networking.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be enable_private_networking

Example:
enable_private_networking

Responses

201 Created

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "enable_private_networking"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36805001,
    "status": "in-progress",
    "type": "enable_private_networking",
    "started_at": "2014-11-14T16:34:36Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Snapshot a Droplet
POST /droplets/{DROPLET_ID}/actions

To snapshot a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to snapshot and the “name” attribute to the name you would like to give the created image.

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be snapshot

Example:
snapshot
name
string
Example:
Nifty New Snapshot

Responses

201 Created

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "snapshot",
    "name": "Nifty New Snapshot"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36805022,
    "status": "in-progress",
    "type": "snapshot",
    "started_at": "2014-11-14T16:34:39Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Upgrade A Droplet
POST /droplets/{DROPLET_ID}/actions

To upgrade a Droplet, send a POST request to /droplets/{DROPLET_ID}/actions. Set the “type” attribute to upgrade

Path variables

DROPLET_ID
string required
Example:
3164450

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be upgrade

Example:
upgrade

Responses

201 Created

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Example 1
POST https://api.digitalocean.com/v2/droplets/3164450/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "upgrade"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36805022,
    "status": "in-progress",
    "type": "upgrade",
    "started_at": "2014-11-14T16:34:39Z",
    "completed_at": null,
    "resource_id": 3164450,
    "resource_type": "droplet",
    "region": "nyc1",
    "region_slug": "nyc1"
  }
}
Retrieve a Droplet Action
GET /droplets/{DROPLET_ID}/actions/{ACTION_ID}

To retrieve a Droplet action, send a GET request to /droplets/{DROPLET_ID}/actions/{ACTION_ID}.

Path variables

DROPLET_ID
string required
Example:
3164444
ACTION_ID
string required
Example:
36804807

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object

The response will be a JSON object with a key called action. The value will be a Droplet actions object

Example 1
GET https://api.digitalocean.com/v2/droplets/3164444/actions/36804807 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36804807,
    "status": "completed",
    "type": "backup",
    "started_at": "2014-11-14T16:32:24Z",
    "completed_at": "2014-11-14T16:34:15Z",
    "resource_id": 3164444,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Images

Images in DigitalOcean may refer to one of a few different kinds of objects.

An image may refer to a snapshot that has been taken of a Droplet instance. It may also mean an image representing an automatic backup of a Droplet. The third category that it can represent is a public Linux distribution or application image that is used as a base to create Droplets.

GET /images
GET /images/{IMAGE_ID}/actions
GET /images/{IMAGE_ID}
GET /images/{IMAGE_SLUG}
PUT /images/{IMAGE_ID}
DELETE /images/{IMAGE_ID}
List all Images
GET /images

To list all of the images available on your account, send a GET request to /images

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called images. This will be set to an array of image objects, each of which will contain the standard image attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Array
Object
Example 1
GET https://api.digitalocean.com/v2/images?page=1&per_page=1 HTTP/1.1 

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "images": [
    {
      "id": 7555620,
      "name": "Nifty New Snapshot",
      "distribution": "Ubuntu",
      "slug": null,
      "public": false,
      "regions": [
        "nyc2",
        "nyc2"
      ],
      "created_at": "2014-11-04T22:23:02Z",
      "type": "snapshot",
      "min_disk_size": 20
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=56&per_page=1",
      "next": "https://api.digitalocean.com/v2/images?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 56
  }
}
List all Distribution Images
GET /images

To retrieve only distribution images, include the type query paramter set to distribution, /images?type=distribution.

Request parameters

type
string required

Must be distribution

Example:
distribution
page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/images?type=distribution&page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "images": [
    {
      "id": 6370882,
      "name": "20 x64",
      "distribution": "Fedora",
      "slug": "fedora-20-x64",
      "public": true,
      "regions": [
        "nyc1",
        "ams1",
        "sfo1",
        "nyc2",
        "ams2",
        "sgp1",
        "lon1",
        "nyc3",
        "ams3",
        "nyc3"
      ],
      "created_at": "2014-09-26T15:29:01Z",
      "min_disk_size": 20
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=24&per_page=1&type=distribution",
      "next": "https://api.digitalocean.com/v2/images?page=2&per_page=1&type=distribution"
    }
  },
  "meta": {
    "total": 24
  }
}
List all Application Images
GET /images

To retrieve only application images, include the type query paramter set to application, /images?type=application.

Request parameters

type
string required

Must be application

Example:
application
page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/images?type=application&page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "images": [
    {
      "id": 6376601,
      "name": "Ruby on Rails on 14.04 (Nginx + Unicorn)",
      "distribution": "Ubuntu",
      "slug": "ruby-on-rails",
      "public": true,
      "regions": [
        "nyc1",
        "ams1",
        "sfo1",
        "nyc2",
        "ams2",
        "sgp1",
        "lon1",
        "nyc3",
        "ams3",
        "nyc1"
      ],
      "created_at": "2014-09-26T20:20:24Z",
      "min_disk_size": 20
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=14&per_page=1&type=application",
      "next": "https://api.digitalocean.com/v2/images?page=2&per_page=1&type=application"
    }
  },
  "meta": {
    "total": 14
  }
}
List a User's Images
GET /images

To retrieve only the private images of a user, include the private query paramter set to true, /images?private=true.

Request parameters

private
boolean required

Must be true

Example:
true
page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/images?private=true&page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "images": [
    {
      "id": 6376601,
      "name": "My application image",
      "distribution": "Ubuntu",
      "public": false,
      "regions": [
        "nyc1",
        "ams1",
        "sfo1",
        "nyc2",
        "ams2",
        "sgp1"
      ],
      "created_at": "2014-09-26T20:20:24Z",
      "min_disk_size": 20
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=14&per_page=1&private=true",
      "next": "https://api.digitalocean.com/v2/images?page=2&per_page=1&private=true"
    }
  },
  "meta": {
    "total": 14
  }
}
List all actions for an image
GET /images/{IMAGE_ID}/actions

To retrieve all actions that have been executed on an image, send a GET request to /images/{IMAGE_ID}/actions.

Path variables

IMAGE_ID
number required
Example:
7555620

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
actions

The results will be returned as a JSON object with an actions key. This will be set to an array filled with action objects containing the standard action attributes

Example 1
GET https://api.digitalocean.com/v2/images/7555620/actions?page=1&per_page=1 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "actions": [
    {
      "id": 29410565,
      "status": "completed",
      "type": "transfer",
      "started_at": "2014-07-25T15:04:21Z",
      "completed_at": "2014-07-25T15:10:20Z",
      "resource_id": 7555620,
      "resource_type": "image",
      "region": "nyc2",
      "region_slug": "nyc2"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images/7555620/actions?page=5&per_page=1",
      "next": "https://api.digitalocean.com/v2/images/7555620/actions?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 5
  }
}
Retrieve an existing Image by id
GET /images/{IMAGE_ID}

To retrieve information about an image (public or private), send a GET request to /images/{IMAGE_ID}.

Path variables

IMAGE_ID
number required
Example:
7555620

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called image. The value of this will be an image object containing the standard image attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
image
Example 1
GET https://api.digitalocean.com/v2/images/7555620 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "image": {
    "id": 7555620,
    "name": "Nifty New Snapshot",
    "distribution": "Ubuntu",
    "slug": null,
    "public": false,
    "regions": [
      "nyc2",
      "nyc2"
    ],
    "created_at": "2014-11-04T22:23:02Z",
    "min_disk_size": 20
  }
}
Retrieve an existing Image by slug
GET /images/{IMAGE_SLUG}

To retrieve information about a public image, one option is to send a GET request to /images/{IMAGE_SLUG}.

Path variables

IMAGE_SLUG
string required
Example:
ubuntu-14-04-x64

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called image. The value of this will be an image object containing the standard image attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
image
Example 1
GET https://api.digitalocean.com/v2/images/ubuntu-14-04-x64 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "image": {
    "id": 6918990,
    "name": "14.04 x64",
    "distribution": "Ubuntu",
    "slug": "ubuntu-14-04-x64",
    "public": true,
    "regions": [
      "nyc1",
      "ams1",
      "sfo1",
      "nyc2",
      "ams2",
      "sgp1",
      "lon1",
      "nyc3",
      "ams3",
      "nyc3"
    ],
    "created_at": "2014-10-17T20:24:33Z",
    "min_disk_size": 20
  }
}
Update an Image
PUT /images/{IMAGE_ID}

To update an image, send a PUT request to /images/{IMAGE_ID}. Set the “name” attribute to the new value you would like to use.

Path variables

IMAGE_ID
number required
Example:
7938391

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
name
string

The new name that you would like to use for the image.

Example:
new-image-name

Responses

200 OK

The response will be a JSON object with a key set to image. The value of this will be an image object containing the standard image attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
image
Example 1
PUT https://api.digitalocean.com/v2/images/7938391 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "name": "new-image-name"
}

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "image": {
    "id": 7938391,
    "name": "new-image-name",
    "distribution": "Ubuntu",
    "slug": null,
    "public": false,
    "regions": [
      "nyc3",
      "nyc3"
    ],
    "created_at": "2014-11-14T16:44:03Z",
    "min_disk_size": 20
  }
}
Delete an Image
DELETE /images/{IMAGE_ID}

To delete an image, send a DELETE request to /images/{IMAGE_ID}

Path variables

IMAGE_ID
number required
Example:
7938391

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

204 No Content
Example 1
DELETE https://api.digitalocean.com/v2/images/7938391 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 204 No Content 
Image Actions

Image actions are commands that can be given to a DigitalOcean image. In general, these requests are made on the actions endpoint of a specific image.

An image action object is returned. These objects hold the current status of the requested action.

POST /images/{IMAGE_ID}/actions
POST /images/{IMAGE_ID}/actions
GET /images/{IMAGE_ID}/actions/{IMAGE_ACTION_ID}
Transfer an Image
POST /images/{IMAGE_ID}/actions

To transfer an image to another region, send a POST request to /images/$IMAGE_ID/actions. Set the “type” attribute to “transfer” and set “region” attribute to the slug identifier of the region you wish to transfer to.

Path variables

IMAGE_ID
number required
Example:
7938269

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be transfer

Example:
transfer
region
string

The region slug that represents the region target.

Example:
nyc2

Responses

201 Created

The response will be a JSON object with a key called action. The value of this will be an object containing the standard image action attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
action
Example 1
POST https://api.digitalocean.com/v2/images/7938269/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "transfer",
    "region": "nyc2"
}

HTTP/1.1 201 Created 

content-type: application/json
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
  "action": {
    "id": 36805527,
    "status": "in-progress",
    "type": "transfer",
    "started_at": "2014-11-14T16:42:45Z",
    "completed_at": null,
    "resource_id": 7938269,
    "resource_type": "image",
    "region": "nyc3",
    "region_slug": "nyc3"
  }
}
Convert an Image to a snapshot
POST /images/{IMAGE_ID}/actions

To convert an image, for example, a backup to a snapshot, send a POST request to /images/{IMAGE_ID}/actions. Set the “type” attribute to “convert”.

Path variables

IMAGE_ID
number required
Example:
7938291

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
type
string

Must be convert

Example:
convert

Responses

201 Created

The response will be a JSON object with a key called action. The value of this will be an object containing the standard image action attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
action
Example 1
POST https://api.digitalocean.com/v2/images/7938291/actions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "type": "convert"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
    "action": {
        id": 46592838,
        "status": "completed",
        "type": "convert_to_snapshot",
        "started_at": "2015-03-24T19:02:47Z",
        "completed_at": "2015-03-24T19:02:47Z",
        "resource_id": 11060029,
        "resource_type": "image",
        "region": null,
        "region_slug": null
    }
}
Retrieve an existing Image Action
GET /images/{IMAGE_ID}/actions/{IMAGE_ACTION_ID}

To retrieve the status of an image action, send a GET request to /images/{IMAGE_ID}/actions/{IMAGE_ACTION_ID}.

Path variables

IMAGE_ID
number required
Example:
7938269
IMAGE_ACTION_ID
number required
Example:
36805527

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be an object with a key called action. The value of this will be an object that contains the standard image action attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
action
Example 1
GET https://api.digitalocean.com/v2/images/7938269/actions/36805527 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
    "action": {
        "id": 36805527,
        "status": "in-progress",
        "type": "transfer",
        "started_at": "2014-11-14T16:42:45Z",
        "completed_at": null,
        "resource_id": 7938269,
        "resource_type": "image",
        "region": "nyc3",
        "region_slug": "nyc3"
    }
}
SSH Keys

DigitalOcean allows you to add SSH public keys to the interface so that you can embed your public key into a Droplet at the time of creation. Only the public key is required to take advantage of this functionality.

GET /account/keys
POST /account/keys
GET /account/keys/{KEY_ID}
PUT /account/keys/{SSH_KEY_ID}
DELETE /account/keys/{KEY_ID}
List all Keys
GET /account/keys

To list all of the keys in your account, send a GET request to /account/keys.

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of key objects, each of which contain the standard key attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/account/keys HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
    "ssh_keys": [
    {
      "id": 512189,
      "fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa",
      "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
      "name": "My SSH Public Key"
    }
    ],
    "links": {
    },
    "meta": {
        "total": 1
    }
}
Create a new Key
POST /account/keys

To add a new SSH public key to your DigitalOcean account, send a POST request to /account/keys. Set the “name” attribute to the name you wish to use and the “public_key” attribute to a string of the full public key you are adding.

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
name
string

The name to give the new SSH key in your account.

Example:
My SSH Public Key
public_key
string

A string containing the entire public key.

Example:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example

Responses

201 Created
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
ssh_key
Example 1
POST https://api.digitalocean.com/v2/account/keys HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "name": "My SSH Public Key",
    "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example"
}

HTTP/1.1 201 Created 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
    "ssh_key": {
        "id": 512190,
        "fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa",
        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
        "name": "My SSH Public Key"
  }
}
Retrieve an existing Key
GET /account/keys/{KEY_ID}

To show information about a key, send a GET request to /account/keys/{KEY_ID} or /account/keys/{KEY_FINGERPRINT}.

Path variables

KEY_ID
number required
Example:
512190

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called ssh_key. The value of this will be a key object which contains the standard key attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
ssh_key
404 Not Found
Example 1
GET https://api.digitalocean.com/v2/account/keys/512190 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
    "ssh_key": {
        "id": 512190,
        "fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa",
        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
        "name": "My SSH Public Key"
    }
}
Update a Key
PUT /account/keys/{SSH_KEY_ID}

To update the name of an SSH key, send a PUT request to either /account/keys/{SSH_KEY_ID} or /account/keys/{SSH_KEY_FINGERPRINT}. Set the “name” attribute to the new name you want to use.

Path variables

SSH_KEY_ID
number required
Example:
512190

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Request body

Object
name
string

The name to give the new SSH key in your account.

Example:
Renamed SSH Key

Responses

200 OK
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
ssh_key
Example 1
PUT https://api.digitalocean.com/v2/account/keys/512190 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

{
    "name": "Renamed SSH Key"
}

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 1124
ratelimit-reset: 1415984218

{
    "ssh_key": {
        "id": 512190,
        "fingerprint": "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa",
        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
        "name": "Renamed SSH Key"
    }
}
Destroy a Key
DELETE /account/keys/{KEY_ID}

To destroy a public SSH key that you have in your account, send a DELETE request to /account/keys/{KEY_ID} or /account/keys/{KEY_FINGERPRINT}.

Path variables

KEY_ID
number required
Example:
512190

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

204 No Content
Example 1
DELETE https://api.digitalocean.com/v2/account/keys/512190 HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 204 No Content 
Regions

A region in DigitalOcean represents a datacenter where Droplets can be deployed and images can be transferred.

Each region represents a specific datacenter in a geographic location. Some geographical locations may have multiple “regions” available. This means that there are multiple datacenters available within that area.

GET /regions
List all Regions
GET /regions

To list all of the regions that are available, send a GET request to /regions.

Request parameters

page
string optional
Example:
1
per_page
string optional
Example:
1

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called regions. The value of this will be an array of region objects, each of which will contain the standard region attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
Example 1
GET https://api.digitalocean.com/v2/regions HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

Content-Type: application/json

{
  "regions": [
    {
      "name": "New York 1",
      "slug": "nyc1",
      "sizes": [

      ],
      "features": [
        "virtio",
        "backups"
      ],
      "available": false
    },
    {
      "name": "Amsterdam 1",
      "slug": "ams1",
      "sizes": [

      ],
      "features": [
        "virtio",
        "backups"
      ],
      "available": false
    },
    {
      "name": "San Francisco 1",
      "slug": "sfo1",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "backups",
        "metadata"
      ],
      "available": true
    },
    {
      "name": "New York 2",
      "slug": "nyc2",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups"
      ],
      "available": true
    },
    {
      "name": "Amsterdam 2",
      "slug": "ams2",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups",
        "metadata"
      ],
      "available": true
    },
    {
      "name": "Singapore 1",
      "slug": "sgp1",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups",
        "ipv6",
        "metadata"
      ],
      "available": true
    },
    {
      "name": "London 1",
      "slug": "lon1",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups",
        "ipv6",
        "metadata"
      ],
      "available": true
    },
    {
      "name": "New York 3",
      "slug": "nyc3",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups",
        "ipv6",
        "metadata"
      ],
      "available": true
    },
    {
      "name": "Amsterdam 3",
      "slug": "ams3",
      "sizes": [
        "32gb",
        "16gb",
        "2gb",
        "1gb",
        "4gb",
        "8gb",
        "512mb",
        "64gb",
        "48gb"
      ],
      "features": [
        "virtio",
        "private_networking",
        "backups",
        "ipv6",
        "metadata"
      ],
      "available": true
    }
  ],
  "links": {
  },
  "meta": {
    "total": 9
  }
}
Sizes

The sizes objects represent different packages of hardware resources that can be used for Droplets. When a Droplet is created, a size must be selected so that the correct resources can be allocated.

Each size represents a plan that bundles together specific sets of resources. This includes the amount of RAM, the number of virtual CPUs, disk space, and transfer. The size object also includes the pricing details and the regions that the size is available in.

GET /sizes
List all Sizes
GET /sizes

To list all of the sizes, send a GET request to /sizes

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Bearer b7d03a6947b217efb6f3ec3bd3504582

Responses

200 OK

The response will be a JSON object with a key called sizes. The value of this will be an array of size objects each of which contain the standard sizes attributes

Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Body
Object
sizes
Example 1
GET https://api.digitalocean.com/v2/sizes HTTP/1.1 

Content-Type: application/json
Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582

HTTP/1.1 200 OK 

content-type: application/json; charset=utf-8
ratelimit-limit: 1200
ratelimit-remaining: 769
ratelimit-reset: 1415984218

{
  "sizes": [
    {
      "slug": "512mb",
      "memory": 512,
      "vcpus": 1,
      "disk": 20,
      "transfer": 1.0,
      "price_monthly": 5.0,
      "price_hourly": 0.00744,
      "regions": [
        "nyc1",
        "sgp1",
        "ams1",
        "ams2",
        "sfo1",
        "nyc2",
        "lon1",
        "nyc3",
        "ams3"
      ],
      "available": true
    },
    {
      "slug": "1gb",
      "memory": 1024,
      "vcpus": 1,
      "disk": 30,
      "transfer": 2.0,
      "price_monthly": 10.0,
      "price_hourly": 0.01488,
      "regions": [
        "nyc2",
        "sgp1",
        "ams1",
        "sfo1",
        "lon1",
        "nyc3",
        "ams3",
        "ams2",
        "nyc1"
      ],
      "available": true
    },
    {
      "slug": "2gb",
      "memory": 2048,
      "vcpus": 2,
      "disk": 40,
      "transfer": 3.0,
      "price_monthly": 20.0,
      "price_hourly": 0.02976,
      "regions": [
        "nyc2",
        "sfo1",
        "ams1",
        "sgp1",
        "ams2",
        "lon1",
        "nyc3",
        "ams3",
        "nyc1"
      ],
      "available": true
    },
    {
      "slug": "4gb",
      "memory": 4096,
      "vcpus": 2,
      "disk": 60,
      "transfer": 4.0,
      "price_monthly": 40.0,
      "price_hourly": 0.05952,
      "regions": [
        "nyc2",
        "sfo1",
        "ams1",
        "sgp1",
        "ams2",
        "lon1",
        "nyc3",
        "ams3",
        "nyc1"
      ],
      "available": true
    },
    {
      "slug": "8gb",
      "memory": 8192,
      "vcpus": 4,
      "disk": 80,
      "transfer": 5.0,
      "price_monthly": 80.0,
      "price_hourly": 0.11905,
      "regions": [
        "nyc2",
        "sfo1",
        "sgp1",
        "ams1",
        "ams2",
        "nyc1",
        "lon1",
        "nyc3",
        "ams3"
      ],
      "available": true
    },
    {
      "slug": "16gb",
      "memory": 16384,
      "vcpus": 8,
      "disk": 160,
      "transfer": 6.0,
      "price_monthly": 160.0,
      "price_hourly": 0.2381,
      "regions": [
        "sgp1",
        "nyc1",
        "sfo1",
        "ams2",
        "nyc3",
        "lon1",
        "nyc2",
        "ams1",
        "ams3"
      ],
      "available": true
    },
    {
      "slug": "32gb",
      "memory": 32768,
      "vcpus": 12,
      "disk": 320,
      "transfer": 7.0,
      "price_monthly": 320.0,
      "price_hourly": 0.47619,
      "regions": [
        "nyc2",
        "sgp1",
        "ams2",
        "nyc1",
        "sfo1",
        "lon1",
        "ams3",
        "nyc3"
      ],
      "available": true
    },
    {
      "slug": "48gb",
      "memory": 49152,
      "vcpus": 16,
      "disk": 480,
      "transfer": 8.0,
      "price_monthly": 480.0,
      "price_hourly": 0.71429,
      "regions": [
        "sgp1",
        "ams2",
        "sfo1",
        "nyc1",
        "lon1",
        "nyc2",
        "ams3",
        "nyc3"
      ],
      "available": true
    },
    {
      "slug": "64gb",
      "memory": 65536,
      "vcpus": 20,
      "disk": 640,
      "transfer": 9.0,
      "price_monthly": 640.0,
      "price_hourly": 0.95238,
      "regions": [
        "sgp1",
        "nyc1",
        "nyc2",
        "sfo1",
        "lon1",
        "ams3",
        "ams2",
        "nyc3"
      ],
      "available": true
    }
  ],
  "links": {
  },
  "meta": {
    "total": 9
  }
}
Data Reference
Action

Actions are records of events that have occurred on the resources in your account. These can be things like rebooting a Droplet, or transferring an image to a new region.

An action object is created every time one of these actions is initiated. The action object contains information about the current status of the action, start and complete timestamps, and the associated resource type and ID.

Every action that creates an action object is available through this endpoint. Completed actions are not removed from this list and are always available for querying.

Object
id
number

A unique numeric ID that can be used to identify and reference an action.

Example:
36804636
status
string

The current status of the action. This can be “in-progress”, “completed”, or “errored”.

Example:
completed
type
string

This is the type of action that the object represents. For example, this could be “transfer” to represent the state of an image transfer action.

Example:
create
started_at
string

A time value given in ISO8601 combined date and time format that represents when the action was initiated.

Example:
2014-11-14T16:29:21Z
completed_at
string

A time value given in ISO8601 combined date and time format that represents when the action was initiated.

Example:
2014-11-14T16:30:06Z
resource_id
number

A unique identifier for the resource that the action is associated with.

Example:
3164444
resource_type
string

The type of resource that the action is associated with.

Example:
droplet
region
string

(deprecated) A slug representing the region where the action occurred.

Example:
nyc3
region_slug
string

A slug representing the region where the action occurred.

Example:
nyc3
Domain

Domain resources are domain names that you have purchased from a domain name registrar that you are managing through the DigitalOcean DNS interface.

This resource establishes top-level control over each domain. Actions that affect individual domain records should be taken on the [Domain Records] resource.

Object
name
string

The name of the domain itself. This should follow the standard domain format of domain.TLD. For instance, example.com is a valid domain name.

Example:
digitaloceanisthebombdiggity.com
ttl
number

This value is the time to live for the records on this domain, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.

Example:
1800
zone_file
string nullable

This attribute contains the complete contents of the zone file for the selected domain. Individual domain record resources should be used to get more granular control over records. However, this attribute can also be used to get information about the SOA record, which is created automatically and is not accessible as an individual record resource.

Example:
$ORIGIN digitaloceanisthebombdiggity.com. $TTL 1800 digitaloceanisthebombdiggity.com. IN SOA ns1.digitalocean.com. hostmaster.digitaloceanisthebombdiggity.com. 1415982609 10800 3600 604800 1800 digitaloceanisthebombdiggity.com. 1800 IN NS ns1.digitalocean.com. digitaloceanisthebombdiggity.com. 1800 IN NS ns2.digitalocean.com. digitaloceanisthebombdiggity.com. 1800 IN NS ns3.digitalocean.com. digitaloceanisthebombdiggity.com. 1800 IN A 1.2.3.4
Domain_Record
Object
id
number

A unique identifier for each domain record.

Example:
3352892
type
string

The type of the DNS record (ex: A, CNAME, TXT, …).

Example:
NS
name
string

The name to use for the DNS record.

Example:
@
data
string

The value to use for the DNS record.

Example:
ns1.digitalocean.com
priority
number nullable

The priority for SRV and MX records.

Example:
port
number nullable

The port for SRV records.

Example:
weight
number nullable

The weight for SRV records.

Example:
Droplet
Object
id
number

A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.

Example:
3164494
name
string

The human-readable name set for the Droplet instance.

Example:
example.com
memory
number

Memory of the Droplet in megabytes.

Example:
512
vcpus
number

The number of virtual CPUs.

Example:
1
disk
number

The size of the Droplet’s disk in gigabytes.

Example:
20
locked
boolean

A boolean value indicating whether the Droplet has been locked, preventing actions by users.

Example:
true
created_at
string

A time value given in ISO8601 combined date and time format that represents when the Droplet was created.

Example:
2014-11-14T16:36:31Z

A status string indicating the state of the Droplet instance. This may be “new”, “active”, “off”, or “archive”.

Example:
new
backup_ids
Array of number

An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.

Example:
[7938002,7938005]
snapshot_ids
Array of number

An array of snapshot IDs of any snapshots created from the Droplet instance.

Example:
7938206
features
Array of string

An array of features enabled on this Droplet.

Example:
["virtio","ipv6"]
region

The region that the Droplet instance is deployed in. When setting a region, the value should be the slug identifier for the region. When you query a Droplet, the entire region object will be returned.

image

The base image used to create the Droplet instance. When setting an image, the value is set to the image id or slug. When querying the Droplet, the entire image object will be returned.

size
string

The current size object describing the Droplet. When setting a size, the value is set to the size slug. When querying the Droplet, the entire size object will be returned. Note that the disk volume of a droplet may not match the size’s disk due to Droplet resize actions. The disk attribute on the Droplet should always be referenced.

Example:
size_slug
string

The unique slug identifier for the size of this Droplet.

Example:
512mb
networks
Object

The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.

v4
Array
Object
ip_address
string
Example:
104.236.32.182
netmask
string
Example:
255.255.192.0
gateway
string
Example:
104.236.0.1
type
string

public or private

Example:
public
v6
Array
Object
ip_address
string
Example:
104.236.32.182
netmask
string
Example:
255.255.192.0
gateway
string
Example:
104.236.0.1
type
string
Example:
public
kernel
Kernel nullable

The current kernel. This will initially be set to the kernel of the base image when the Droplet is created.

next_backup_window
Object nullable

The details of the Droplet’s backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.

Image
Object
id
number

A unique number that can be used to identify and reference a specific image.

Example:
6918990
name
string

The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.

Example:
14.04 x64
distribution
string

This attribute describes the base distribution used for this image.

Example:
Ubuntu
slug
string nullable

A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.

Example:
ubuntu-14-04-x64
public
boolean

This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.

Example:
true
regions
Array of string

This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.

Example:
["nyc1","ams1"]
created_at
string
Example:
2014-10-17T20:24:33Z
type
string

The kind of image, describing the duration of how long the image is stored. This is one of “snapshot”, “temporary” or “backup”.

Example:
snapshot
min_disk_size
number

The minimum ‘disk’ required for a size to use this image.

Example:
20
Region
Object
name
string

The display name of the region. This will be a full name that is used in the control panel and other interfaces.

Example:
New York 1
slug
string

A human-readable string that is used as a unique identifier for each region.

Example:
nyc1
sizes
Array of string

This attribute is set to an array which contains the identifying slugs for the sizes available in this region.

Example:
["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]
available
boolean

This is a boolean value that represents whether new Droplets can be created in this region.

Example:
true
features
Array of string

This attribute is set to an array which contains features available in this region

Example:
["virtio","backups","metadata"]
Types: Droplet
Kernel
Object
id
number

A unique number used to identify and reference a specific kernel

Example:
2233
name
string

The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.

Example:
Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic
version
string

A standard kernel version string representing the version, patch, and release information

Example:
3.13.0-37-generic
Snapshot
Object
id
number

A unique number used to identify and reference a specific image.

Example:
7938206
name
string

The display name of the image. This is shown in the web UI and is generally a descriptive title for the image in question.

Example:
nginx-fresh
distribution
string

The base distribution used for this image.

Example:
Ubuntu
slug
string nullable

A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.

public
boolean

A boolean value that indicates whether the image in question is public. An image that is public is available to all accounts. A non-public image is only accessible from your account.

Example:
true
regions
Array of string

An array of the regions that the image is available in. The regions are represented by their identifying slug values.

Example:
["nyc3","ams1"]
created_at
string
Example:
2014-11-14T16:37:34Z
type
string

The kind of image, describing the duration of how long the image is stored. This is one of “snapshot”, “temporary” or “backup”.

Example:
snapshot
min_disk_size
number

The minimum ‘disk’ required for a size to use this image.

Example:
20
Droplet_Action
Object
id
number

A unique numeric ID that can be used to identify and reference an action.

Example:
36804745
status
string

The current status of the action. This can be “in-progress”, “completed”, or “errored”.

Example:
in-progress
type
string

This is the type of action that the object represents. For example, this could be “transfer” to represent the state of an image transfer action.

Example:
disable_backups
started_at
string

A time value given in ISO8601 combined date and time format that represents when the action was initiated.

Example:
2014-11-14T16:30:56Z
completed_at
string nullable

A time value given in ISO8601 combined date and time format that represents when the action was completed.

resource_id
number

A unique identifier for the resource that the action is associated with.

Example:
3164450
resource_type
string

The type of resource that the action is associated with.

Example:
droplet
region
string nullable

(deprecated) A slug representing the region where the action occurred.

Example:
nyc3
region_slug
string nullable

A slug representing the region where the action occurred.

Example:
nyc3

The links object is returned as part of the response body when pagination is enabled. By default, 25 objects are returned per page. If the response contains 25 objects or fewer, no links object will be returned.

Object
first
string

The URI of the first page of results.

Example:
prev
string

The URI of the previous sequential page of results.

next
string

The URI of the next sequential page of results.

Example:
https://api.digitalocean.com/v2/actions?page=2&per_page=1
last
string

The URI of the last page of results.

Example:
https://api.digitalocean.com/v2/actions?page=159&per_page=1
Pagination.Meta

This object contains information about the response itself. The meta object contains a total key that is set to the total number of objects returned by the request. This has implications on the links object and pagination.

Object
total
number

Set to the total number of objects returned by the request

SSH_Key
Object
id
number

This is a unique identification number for the key. This can be used to reference a specific SSH key when you wish to embed a key into a Droplet.

Example:
512189
fingerprint
string

This attribute contains the fingerprint value that is generated from the public key. This is a unique identifier that will differentiate it from other keys using a format that SSH recognizes.

Example:
3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa
public_key
string

This attribute contains the entire public key string that was uploaded. This is what is embedded into the root user’s authorized_keys file if you choose to include this SSH key during Droplet creation.

Example:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example
name
string

This is the human-readable display name for the given SSH key. This is used to easily identify the SSH keys when they are displayed.

Example:
My SSH Public Key
Size
Object
slug
string

A human-readable string that is used to uniquely identify each size.

Example:
512mb
memory
number

The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.

Example:
512
vcpus
number

The number of virtual CPUs allocated to Droplets of this size.

Example:
1
disk
number

The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.

Example:
20
transfer
number

The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.

Example:
1
price_monthly
number

This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.

Example:
5
price_hourly
number

This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.

Example:
0.00744
regions
Array of string

An array containing the region slugs where this size is available for Droplet creates.

Example:
nyc1
available
boolean

This is a boolean value that represents whether new Droplets can be created with this size.

Example:
true
Methods: List all Sizes
Droplet.Status

A status string indicating the state of the Droplet instance. This may be “new”, “active”, “off”, or “archive”.

string
Enumeration:
new
active
off
archive
Types: Droplet
Droplet_Action.Type
string
Enumeration:
disable_backups
reboot
power_cycle
shutdown
power_off
power_on
restore
password_reset
resize
rebuild
rename
change_kernel
enable_ipv6
enable_private_networking
snapshot
upgrade
Parameters
Headers
Responses
204 No Content
Headers
content-type
string required
Default:
Example:
application/json; charset=utf-8
ratelimit-limit
number required

The number of requests that can be made per hour per OAuth token.

Max: 5,000
Example:
1200
ratelimit-remaining
number required

The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.

Example:
1124
ratelimit-reset
number required

This represents the time when the oldest request will expire. The value is given in Unix epoch time. See below for more information about how request limits expire.

Example:
1415984218
Traits