DigitalOcean API
Introduction
The DigitalOcean API allows you to manage Droplets and resources within the DigitalOcean cloud in a simple, programmatic way using conventional HTTP requests.
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.
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.
400 and 500 level error responses will include a JSON object in their body, including the following attributes:
Example Error Response
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
Response for an Object Collection
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
Links & Pagination
The links object is returned as part of the response body when pagination
is enabled. By default, 20 objects are returned per page. If the response
contains 20 objects or fewer, no links object will be returned. If the
response contains more than 20 objects, the first 20 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 maximum number of results
per page is 200.
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
Rate Limit
Requests through the API are rate limited per OAuth token. Current rate limits:
- 5,000 requests per hour
- 250 requests per minute (5% of the hourly total)
Once you exceed either limit, you will be rate limited until the next cycle starts. Space out any requests that you would otherwise issue in bursts for the best results.
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 . 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.
Note: The following endpoints have special rate limit requirements that are independent of the limits defined above.
- Only 12
POSTrequests to the/v2/floating_ipsendpoint to create Floating IPs can be made per 60 seconds. - Only 10
GETrequests to the/v2/account/keysendpoint to list SSH keys can be made per 60 seconds. - Only 5 requests to any and all
v2/cdn/endpointscan be made per 10 seconds. This includesv2/cdn/endpoints,v2/cdn/endpoints/$ENDPOINT_ID, andv2/cdn/endpoints/$ENDPOINT_ID/cache. - Only 50 strings within the
filesjson struct in thev2/cdn/endpoints/$ENDPOINT_ID/cachecan be requested every 20 seconds.
Sample Rate Limit Headers
Sample Rate Exceeded Response
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.
These examples assume that you are using a Linux or macOS command line. To run these commands on a Windows machine, you can either use cmd.exe, PowerShell, or WSL:
-
For cmd.exe, use the
set VAR=VALUEto define environment variables, call them with%VAR%, then replace all backslashes (\) in the examples with carets (^). -
For PowerShell, use the
$Env:VAR = "VALUE"to define environment variables, call them with$Env:VAR, then replacecurlwithcurl.exeand all backslashes (\) in the examples with backticks (`). -
WSL is a compatibility layer that allows you to emulate a Linux terminal on a Windows machine. Install WSL with our , then follow this API documentation normally.
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 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 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
Set and Export a Variable
Parameters
There are two different ways to pass parameters in a request with the API.
When passing parameters to create or update an object, parameters should be
passed 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.
When passing parameters to filter a response on GET requests, parameters can
be passed using standard query attributes. 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 &. Tools like curl can create the appropriate URI when
given parameters and values; this can also be 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.
Pass Parameters as a JSON Object
Pass Filter Parameters as a Query String
Cross Origin Resource Sharing
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
Originheader. - 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. `
HTTP/1.1 403 Forbidden { "id": "forbidden", "message": "You do not have access for the attempted action." } { "droplet": { "name": "example.com" . . . } } { "droplets": [ { "name": "example.com" . . . }, { "name": "second.com" . . . } ] } { . . . "meta": { "total": 43 } . . . } { . . . "links": { "pages": { "last": "https://api.digitalocean.com/v2/images?page=2", "next": "https://api.digitalocean.com/v2/images?page=2" } } . . . } . . . ratelimit-limit: 1200 ratelimit-remaining: 1193 rateLimit-reset: 1402425459 . . . 429 Too Many Requests { id: "too_many_requests", message: "API Rate limit exceeded." }export DIGITALOCEAN_TOKEN=your_token_hereexport DROPLET_ID=1111111 curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "example.com", "ip_address": "127.0.0.1"}' \ -X POST "https://api.digitalocean.com/v2/domains" curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -X GET \ "https://api.digitalocean.com/v2/images?private=true"- Homepage
- https://api.apis.guru/v2/specs/digitalocean.com/2.0.json
- Provider
- digitalocean.com
- OpenAPI version
- 3.0.0
- Spec (JSON)
- https://api.apis.guru/v2/specs/digitalocean.com/2.0/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/digitalocean.com/2.0/openapi.yaml
Tools (292)
Extracted live via the executor SDK.
-
1ClickApplications.oneClicksInstallKubernetesTo install a Kubernetes 1-Click application on a cluster, send a POST request to
/v2/1-clicks/kubernetes. Theaddon_slugsandcluster_uuidmust be provided as body parameter in order to specify which 1-Click application(s) to install. To list all available 1-Click Kubernetes applications, send a request to/v2/1-clicks?type=kubernetes. -
1ClickApplications.oneClicksListTo list all available 1-Click applications, send a GET request to
/v2/1-clicks. Thetypemay be provided as query paramater in order to restrict results to a certain type of 1-Click, for example:/v2/1-clicks?type=droplet. Current supported types arekubernetesanddroplet.The response will be a JSON object with a key called
1_clicks. This will be set to an array of 1-Click application data, each of which will contain the the slug and type for the 1-Click. -
account.accountGetTo show information about the current user account, send a GET request to
/v2/account. -
actions.actionsGetTo retrieve a specific action object, send a GET request to
/v2/actions/$ACTION_ID. -
actions.actionsListThis 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 20 on each page by default.
-
apps.appsAssignAlertDestinationsUpdates the emails and slack webhook destinations for app alerts. Emails must be associated to a user with access to the app.
-
apps.appsCancelDeploymentImmediately cancel an in-progress deployment.
-
apps.appsCommitRollbackCommit an app rollback. This action permanently applies the rollback and unpins the app to resume new deployments.
-
apps.appsCreateCreate a new app by submitting an app specification. For documentation on app specifications (
AppSpecobjects), please refer to . -
apps.appsCreateDeploymentCreating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app.
-
apps.appsCreateRollbackRollback an app to a previous deployment. A new deployment will be created to perform the rollback. The app will be pinned to the rollback deployment preventing any new deployments from being created, either manually or through Auto Deploy on Push webhooks. To resume deployments, the rollback must be either committed or reverted.
It is recommended to use the Validate App Rollback endpoint to double check if the rollback is valid and if there are any warnings.
-
apps.appsDeleteDelete an existing app. Once deleted, all active deployments will be permanently shut down and the app deleted. If needed, be sure to back up your app specification so that you may re-create it at a later time.
-
apps.appsGetRetrieve details about an existing app by either its ID or name. To retrieve an app by its name, do not include an ID in the request path. Information about the current active deployment as well as any in progress ones will also be included in the response.
-
apps.appsGetDeploymentRetrieve information about an app deployment.
-
apps.appsGetInstanceSizeRetrieve information about a specific instance size for
service,worker, andjobcomponents. -
apps.appsGetLogsRetrieve the logs of a past, in-progress, or active deployment. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment.
-
apps.appsGetLogsActiveDeploymentRetrieve the logs of the active deployment if one exists. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment. Note log_type=BUILD logs will return logs associated with the current active deployment (being served). To view build logs associated with in-progress build, the query must explicitly reference the deployment id.
-
apps.appsGetLogsActiveDeploymentAggregateRetrieve the logs of the active deployment if one exists. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment. Note log_type=BUILD logs will return logs associated with the current active deployment (being served). To view build logs associated with in-progress build, the query must explicitly reference the deployment id.
-
apps.appsGetLogsAggregateRetrieve the logs of a past, in-progress, or active deployment. If a component name is specified, the logs will be limited to only that component. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment.
-
apps.appsGetMetricsBandwidthDailyRetrieve daily bandwidth usage metrics for a single app.
-
apps.appsGetTierRetrieve information about a specific app tier.
-
apps.appsListList all apps on your account. Information about the current active deployment as well as any in progress ones will also be included for each app.
-
apps.appsListAlertsList alerts associated to the app and any components. This includes configuration information about the alerts including emails, slack webhooks, and triggering events or conditions.
-
apps.appsListDeploymentsList all deployments of an app.
-
apps.appsListInstanceSizesList all instance sizes for
service,worker, andjobcomponents. -
apps.appsListMetricsBandwidthDailyRetrieve daily bandwidth usage metrics for multiple apps.
-
apps.appsListRegionsList all regions supported by App Platform.
-
apps.appsListTiersList all app tiers.
-
apps.appsRevertRollbackRevert an app rollback. This action reverts the active rollback by creating a new deployment from the latest app spec prior to the rollback and unpins the app to resume new deployments.
-
apps.appsUpdateUpdate an existing app by submitting a new app specification. For documentation on app specifications (
AppSpecobjects), please refer to . -
apps.appsValidateAppSpecTo propose and validate a spec for a new or existing app, send a POST request to the
/v2/apps/proposeendpoint. The request returns some information about the proposed app, including app cost and upgrade cost. If an existing app ID is specified, the app spec is treated as a proposed update to the existing app. -
apps.appsValidateRollbackCheck whether an app can be rolled back to a specific deployment. This endpoint can also be used to check if there are any warnings or validation conditions that will cause the rollback to proceed under unideal circumstances. For example, if a component must be rebuilt as part of the rollback causing it to take longer than usual.
-
billing.balanceGetTo retrieve the balances on a customer's account, send a GET request to
/v2/customers/my/balance. -
billing.billingHistoryListTo retrieve a list of all billing history entries, send a GET request to
/v2/customers/my/billing_history. -
billing.invoicesGetByUuidTo retrieve the invoice items for an invoice, send a GET request to
/v2/customers/my/invoices/$INVOICE_UUID. -
billing.invoicesGetCsvByUuidTo retrieve a CSV for an invoice, send a GET request to
/v2/customers/my/invoices/$INVOICE_UUID/csv. -
billing.invoicesGetPdfByUuidTo retrieve a PDF for an invoice, send a GET request to
/v2/customers/my/invoices/$INVOICE_UUID/pdf. -
billing.invoicesGetSummaryByUuidTo retrieve a summary for an invoice, send a GET request to
/v2/customers/my/invoices/$INVOICE_UUID/summary. -
billing.invoicesListTo retrieve a list of all invoices, send a GET request to
/v2/customers/my/invoices. -
blockStorage.volumesCreateTo create a new volume, send a POST request to
/v2/volumes. Optionally, afilesystem_typeattribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. -
blockStorage.volumesDeleteTo delete a block storage volume, destroying all data and removing it from your account, send a DELETE request to
/v2/volumes/$VOLUME_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. -
blockStorage.volumesDeleteByNameBlock storage volumes may also be deleted by name by sending a DELETE request with the volume's name and the region slug for the region it is located in as query parameters to
/v2/volumes?name=$VOLUME_NAME®ion=nyc1. 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. -
blockStorage.volumesGetTo show information about a block storage volume, send a GET request to
/v2/volumes/$VOLUME_ID. -
blockStorage.volumesListTo list all of the block storage volumes available on your account, send a GET request to
/v2/volumes.Filtering Results
By Region
The
regionmay be provided as query parameter in order to restrict results to volumes available in a specific region. For example:/v2/volumes?region=nyc1By Name
It is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to
/v2/volumes?name=$VOLUME_NAME. Note: You can only create one volume per region with the same name.By Name and Region
It is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to
/v2/volumes?name=$VOLUME_NAME®ion=nyc1. -
blockStorage.volumeSnapshotsCreateTo create a snapshot from a volume, sent a POST request to
/v2/volumes/$VOLUME_ID/snapshots. -
blockStorage.volumeSnapshotsDeleteByIdTo delete a volume snapshot, send a DELETE request to
/v2/snapshots/$SNAPSHOT_ID.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
blockStorage.volumeSnapshotsGetByIdTo retrieve the details of a snapshot that has been created from a volume, send a GET request to
/v2/volumes/snapshots/$SNAPSHOT_ID. -
blockStorage.volumeSnapshotsListTo retrieve the snapshots that have been created from a volume, send a GET request to
/v2/volumes/$VOLUME_ID/snapshots. -
blockStorageActions.volumeActionsGetTo retrieve the status of a volume action, send a GET request to
/v2/volumes/$VOLUME_ID/actions/$ACTION_ID. -
blockStorageActions.volumeActionsListTo retrieve all actions that have been executed on a volume, send a GET request to
/v2/volumes/$VOLUME_ID/actions. -
blockStorageActions.volumeActionsPostTo initiate an action on a block storage volume by Name, send a POST request to
~/v2/volumes/actions. The body should contain the appropriate attributes for the respective action.Attach a Block Storage Volume to a Droplet
Each volume may only be attached to a single Droplet. However, up to five volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, is required.
Remove a Block Storage Volume from a Droplet
-
blockStorageActions.volumeActionsPostByIdTo initiate an action on a block storage volume by Id, send a POST request to
~/v2/volumes/$VOLUME_ID/actions. The body should contain the appropriate attributes for the respective action.Attach a Block Storage Volume to a Droplet
Each volume may only be attached to a single Droplet. However, up to seven volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, is required.
Remove a Block Storage Volume from a Droplet
Resize a Volume
Volumes may only be resized upwards. The maximum size for a volume is 16TiB.
-
cdnEndpoints.cdnCreateEndpointTo create a new CDN endpoint, send a POST request to
/v2/cdn/endpoints. The origin attribute must be set to the fully qualified domain name (FQDN) of a DigitalOcean Space. Optionally, the TTL may be configured by setting thettlattribute.A custom subdomain may be configured by specifying the
custom_domainandcertificate_idattributes. -
cdnEndpoints.cdnDeleteEndpointTo delete a specific CDN endpoint, send a DELETE request to
/v2/cdn/endpoints/$ENDPOINT_ID.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
cdnEndpoints.cdnGetEndpointTo show information about an existing CDN endpoint, send a GET request to
/v2/cdn/endpoints/$ENDPOINT_ID. -
cdnEndpoints.cdnListEndpointsTo list all of the CDN endpoints available on your account, send a GET request to
/v2/cdn/endpoints. -
cdnEndpoints.cdnPurgeCacheTo purge cached content from a CDN endpoint, send a DELETE request to
/v2/cdn/endpoints/$ENDPOINT_ID/cache. The body of the request should include afilesattribute containing a list of cached file paths to be purged. A path may be for a single file or may contain a wildcard (*) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged. -
cdnEndpoints.cdnUpdateEndpointsTo update the TTL, certificate ID, or the FQDN of the custom subdomain for an existing CDN endpoint, send a PUT request to
/v2/cdn/endpoints/$ENDPOINT_ID. -
certificates.certificatesCreateTo upload new SSL certificate which you have previously generated, send a POST request to
/v2/certificates.When uploading a user-generated certificate, the
private_key,leaf_certificate, and optionally thecertificate_chainattributes should be provided. The type must be set tocustom.When using Let's Encrypt to create a certificate, the
dns_namesattribute must be provided, and the type must be set tolets_encrypt. -
certificates.certificatesDeleteTo delete a specific certificate, send a DELETE request to
/v2/certificates/$CERTIFICATE_ID. -
certificates.certificatesGetTo show information about an existing certificate, send a GET request to
/v2/certificates/$CERTIFICATE_ID. -
certificates.certificatesListTo list all of the certificates available on your account, send a GET request to
/v2/certificates. -
containerRegistry.registryCreateTo create your container registry, send a POST request to
/v2/registry.The
namebecomes part of the URL for images stored in the registry. For example, if your registry is calledexample, an image in it will have the URLregistry.digitalocean.com/example/image:tag. -
containerRegistry.registryDeleteTo delete your container registry, destroying all container image data stored in it, send a DELETE request to
/v2/registry. -
containerRegistry.registryDeleteRepositoryManifestTo delete a container repository manifest by digest, send a DELETE request to
/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests/$MANIFEST_DIGEST.Note that if your repository name contains
/characters, it must be URL-encoded in the request URL. For example, to deleteregistry.digitalocean.com/example/my/repo@sha256:abcd, the path would be/v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
containerRegistry.registryDeleteRepositoryTagTo delete a container repository tag, send a DELETE request to
/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags/$TAG.Note that if your repository name contains
/characters, it must be URL-encoded in the request URL. For example, to deleteregistry.digitalocean.com/example/my/repo:mytag, the path would be/v2/registry/example/repositories/my%2Frepo/tags/mytag.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
containerRegistry.registryGetTo get information about your container registry, send a GET request to
/v2/registry. -
containerRegistry.registryGetDockerCredentialsIn order to access your container registry with the Docker client or from a Kubernetes cluster, you will need to configure authentication. The necessary JSON configuration can be retrieved by sending a GET request to
/v2/registry/docker-credentials.The response will be in the format of a Docker
config.jsonfile. To use the config in your Kubernetes cluster, create a Secret with:By default, the returned credentials have read-only access to your registry and cannot be used to push images. This is appropriate for most Kubernetes clusters. To retrieve read/write credentials, suitable for use with the Docker client or in a CI system, read_write may be provided as query parameter. For example:
/v2/registry/docker-credentials?read_write=trueBy default, the returned credentials will not expire. To retrieve credentials with an expiry set, expiry_seconds may be provided as a query parameter. For example:
/v2/registry/docker-credentials?expiry_seconds=3600will return credentials that expire after one hour. -
containerRegistry.registryGetGarbageCollectionTo get information about the currently-active garbage collection for a registry, send a GET request to
/v2/registry/$REGISTRY_NAME/garbage-collection. -
containerRegistry.registryGetOptionsThis endpoint serves to provide additional information as to which option values are available when creating a container registry. There are multiple subscription tiers available for container registry. Each tier allows a different number of image repositories to be created in your registry, and has a different amount of storage and transfer included. There are multiple regions available for container registry and controls where your data is stored. To list the available options, send a GET request to
/v2/registry/options. -
containerRegistry.registryGetSubscriptionA subscription is automatically created when you configure your container registry. To get information about your subscription, send a GET request to
/v2/registry/subscription. -
containerRegistry.registryListGarbageCollectionsTo get information about past garbage collections for a registry, send a GET request to
/v2/registry/$REGISTRY_NAME/garbage-collections. -
containerRegistry.registryListRepositoriesThis endpoint has been deprecated in favor of the List All Container Registry Repositories [V2] endpoint.
To list all repositories in your container registry, send a GET request to
/v2/registry/$REGISTRY_NAME/repositories. -
containerRegistry.registryListRepositoriesV2To list all repositories in your container registry, send a GET request to
/v2/registry/$REGISTRY_NAME/repositoriesV2. -
containerRegistry.registryListRepositoryManifestsTo list all manifests in your container registry repository, send a GET request to
/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests.Note that if your repository name contains
/characters, it must be URL-encoded in the request URL. For example, to list manifests forregistry.digitalocean.com/example/my/repo, the path would be/v2/registry/example/repositories/my%2Frepo/digests. -
containerRegistry.registryListRepositoryTagsTo list all tags in your container registry repository, send a GET request to
/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags.Note that if your repository name contains
/characters, it must be URL-encoded in the request URL. For example, to list tags forregistry.digitalocean.com/example/my/repo, the path would be/v2/registry/example/repositories/my%2Frepo/tags. -
containerRegistry.registryRunGarbageCollectionGarbage collection enables users to clear out unreferenced blobs (layer & manifest data) after deleting one or more manifests from a repository. If there are no unreferenced blobs resulting from the deletion of one or more manifests, garbage collection is effectively a noop. about how and why you should clean up your container registry periodically.
To request a garbage collection run on your registry, send a POST request to
/v2/registry/$REGISTRY_NAME/garbage-collection. This will initiate the following sequence of events on your registry.- Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes.
- Wait until all existing write-scoped JWTs have expired.
- Scan all registry manifests to determine which blobs are unreferenced.
- Delete all unreferenced blobs from the registry.
- Record the number of blobs deleted and bytes freed, mark the garbage
collection status as
success. - Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients.
-
containerRegistry.registryUpdateGarbageCollectionTo cancel the currently-active garbage collection for a registry, send a PUT request to
/v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUIDand specify one or more of the attributes below. -
containerRegistry.registryUpdateSubscriptionAfter creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to
/v2/registry/subscription. -
containerRegistry.registryValidateNameTo validate that a container registry name is available for use, send a POST request to
/v2/registry/validate-name.If the name is both formatted correctly and available, the response code will be 204 and contain no body. If the name is already in use, the response will be a 409 Conflict.
-
databases.databasesAddTo add a new database to an existing cluster, send a POST request to
/v2/databases/$DATABASE_ID/dbs.Note: Database management is not supported for Redis clusters.
The response will be a JSON object with a key called
db. The value of this will be an object that contains the standard attributes associated with a database. -
databases.databasesAddConnectionPoolFor PostgreSQL database clusters, connection pools can be used to allow a database to share its idle connections. The popular PostgreSQL connection pooling utility PgBouncer is used to provide this service. about how and why to use PgBouncer connection pooling including details about the available transaction modes.
To add a new connection pool to a PostgreSQL database cluster, send a POST request to
/v2/databases/$DATABASE_ID/poolsspecifying a name for the pool, the user to connect with, the database to connect to, as well as its desired size and transaction mode. -
databases.databasesAddUserTo add a new database user, send a POST request to
/v2/databases/$DATABASE_ID/userswith the desired username.Note: User management is not supported for Redis clusters.
When adding a user to a MySQL cluster, additional options can be configured in the
mysql_settingsobject.The response will be a JSON object with a key called
user. The value of this will be an object that contains the standard attributes associated with a database user including its randomly generated password. -
databases.databasesCreateClusterTo create a database cluster, send a POST request to
/v2/databases. The response will be a JSON object with a key calleddatabase. The value of this will be an object that contains the standard attributes associated with a database cluster. The initial value of the database cluster'sstatusattribute will becreating. When the cluster is ready to receive traffic, this will transition toonline. The embeddedconnectionandprivate_connectionobjects will contain the information needed to access the database cluster. DigitalOcean managed PostgreSQL and MySQL database clusters take automated daily backups. To create a new database cluster based on a backup of an existing cluster, send a POST request to/v2/databases. In addition to the standard database cluster attributes, the JSON body must include a key namedbackup_restorewith the name of the original database cluster and the timestamp of the backup to be restored. Creating a database from a backup is the same as forking a database in the control panel. Note: Backups are not supported for Redis clusters. -
databases.databasesCreateReplicaTo create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to
/v2/databases/$DATABASE_ID/replicasspecifying the name it should be given, the size of the node to be used, and the region where it will be located.Note: Read-only replicas are not supported for Redis clusters.
The response will be a JSON object with a key called
replica. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica'sstatusattribute will beforking. When the replica is ready to receive traffic, this will transition toactive. -
databases.databasesDeleteTo delete a specific database, send a DELETE request to
/v2/databases/$DATABASE_ID/dbs/$DB_NAME.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
Note: Database management is not supported for Redis clusters.
-
databases.databasesDeleteConnectionPoolTo delete a specific connection pool for a PostgreSQL database cluster, send a DELETE request to
/v2/databases/$DATABASE_ID/pools/$POOL_NAME.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
databases.databasesDeleteOnlineMigrationTo stop an online migration, send a DELETE request to
/v2/databases/$DATABASE_ID/online-migration/$MIGRATION_ID.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
databases.databasesDeleteUserTo remove a specific database user, send a DELETE request to
/v2/databases/$DATABASE_ID/users/$USERNAME.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
Note: User management is not supported for Redis clusters.
-
databases.databasesDestroyClusterTo destroy a specific database, send a DELETE request to
/v2/databases/$DATABASE_ID. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. -
databases.databasesDestroyReplicaTo destroy a specific read-only replica, send a DELETE request to
/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.Note: Read-only replicas are not supported for Redis clusters.
A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
databases.databasesGetTo show information about an existing database cluster, send a GET request to
/v2/databases/$DATABASE_ID/dbs/$DB_NAME.Note: Database management is not supported for Redis clusters.
The response will be a JSON object with a
dbkey. This will be set to an object containing the standard database attributes. -
databases.databasesGetCaTo retrieve the public certificate used to secure the connection to the database cluster send a GET request to
/v2/databases/$DATABASE_ID/ca.The response will be a JSON object with a
cakey. This will be set to an object containing the base64 encoding of the public key certificate. -
databases.databasesGetClusterTo show information about an existing database cluster, send a GET request to
/v2/databases/$DATABASE_ID. The response will be a JSON object with a database key. This will be set to an object containing the standard database cluster attributes. The embedded connection and private_connection objects will contain the information needed to access the database cluster. The embedded maintenance_window object will contain information about any scheduled maintenance for the database cluster. -
databases.databasesGetConfigShows configuration parameters for an existing database cluster by sending a GET request to
/v2/databases/$DATABASE_ID/config. The response is a JSON object with aconfigkey, which is set to an object containing any database configuration parameters. -
databases.databasesGetConnectionPoolTo show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to
/v2/databases/$DATABASE_ID/pools/$POOL_NAME. The response will be a JSON object with apoolkey. -
databases.databasesGetEvictionPolicyTo retrieve the configured eviction policy for an existing Redis cluster, send a GET request to
/v2/databases/$DATABASE_ID/eviction_policy. The response will be a JSON object with aneviction_policykey. This will be set to a string representing the eviction policy. -
databases.databasesGetMigrationStatusTo retrieve the status of the most recent online migration, send a GET request to
/v2/databases/$DATABASE_ID/online-migration. -
databases.databasesGetReplicaTo show information about an existing database replica, send a GET request to
/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.Note: Read-only replicas are not supported for Redis clusters.
The response will be a JSON object with a
replica key. This will be set to an object containing the standard database replica attributes. -
databases.databasesGetSqlModeTo retrieve the configured SQL modes for an existing MySQL cluster, send a GET request to
/v2/databases/$DATABASE_ID/sql_mode. The response will be a JSON object with asql_modekey. This will be set to a string representing the configured SQL modes. -
databases.databasesGetUserTo show information about an existing database user, send a GET request to
/v2/databases/$DATABASE_ID/users/$USERNAME.Note: User management is not supported for Redis clusters.
The response will be a JSON object with a
userkey. This will be set to an object containing the standard database user attributes.For MySQL clusters, additional options will be contained in the mysql_settings object.
-
databases.databasesListTo list all of the databases in a clusters, send a GET request to
/v2/databases/$DATABASE_ID/dbs.The result will be a JSON object with a
dbskey. This will be set to an array of database objects, each of which will contain the standard database attributes.Note: Database management is not supported for Redis clusters.
-
databases.databasesListBackupsTo list all of the available backups of a PostgreSQL or MySQL database cluster, send a GET request to
/v2/databases/$DATABASE_ID/backups. Note: Backups are not supported for Redis clusters. The result will be a JSON object with abackups key. This will be set to an array of backup objects, each of which will contain the size of the backup and the timestamp at which it was created. -
databases.databasesListClustersTo list all of the database clusters available on your account, send a GET request to
/v2/databases. To limit the results to database clusters with a specific tag, include thetag_namequery parameter set to the name of the tag. For example,/v2/databases?tag_name=$TAG_NAME. The result will be a JSON object with adatabaseskey. This will be set to an array of database objects, each of which will contain the standard database attributes. The embeddedconnectionandprivate_connectionobjects will contain the information needed to access the database cluster: The embeddedmaintenance_windowobject will contain information about any scheduled maintenance for the database cluster. -
databases.databasesListConnectionPoolsTo list all of the connection pools available to a PostgreSQL database cluster, send a GET request to
/v2/databases/$DATABASE_ID/pools. The result will be a JSON object with apoolskey. This will be set to an array of connection pool objects. -
databases.databasesListFirewallRulesTo list all of a database cluster's firewall rules (known as "trusted sources" in the control panel), send a GET request to
/v2/databases/$DATABASE_ID/firewall. The result will be a JSON object with aruleskey. -
databases.databasesListOptionsTo list all of the options available for the offered database engines, send a GET request to
/v2/databases/options. The result will be a JSON object with anoptionskey. -
databases.databasesListReplicasTo list all of the read-only replicas associated with a database cluster, send a GET request to
/v2/databases/$DATABASE_ID/replicas.Note: Read-only replicas are not supported for Redis clusters.
The result will be a JSON object with a
replicaskey. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes. -
databases.databasesListUsersTo list all of the users for your database cluster, send a GET request to
/v2/databases/$DATABASE_ID/users.Note: User management is not supported for Redis clusters.
The result will be a JSON object with a
userskey. This will be set to an array of database user objects, each of which will contain the standard database user attributes.For MySQL clusters, additional options will be contained in the mysql_settings object.
-
databases.databasesPatchConfigTo update the configuration for an existing database cluster, send a PATCH request to
/v2/databases/$DATABASE_ID/config. -
databases.databasesPromoteReplicaTo promote a specific read-only replica, send a PUT request to
/v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote.Note: Read-only replicas are not supported for Redis clusters.
A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
databases.databasesResetAuthTo reset the password for a database user, send a POST request to
/v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth.For
mysqldatabases, the authentication method can be specifying by including a key in the JSON body calledmysql_settingswith theauth_pluginvalue specified.The response will be a JSON object with a
userkey. This will be set to an object containing the standard database user attributes. -
databases.databasesUpdateClusterSizeTo resize a database cluster, send a PUT request to
/v2/databases/$DATABASE_ID/resize. The body of the request must specify both the size and num_nodes attributes. A successful request will receive a 202 Accepted status code with no body in response. Querying the database cluster will show that its status attribute will now be set to resizing. This will transition back to online when the resize operation has completed. -
databases.databasesUpdateConnectionPoolTo update a connection pool for a PostgreSQL database cluster, send a PUT request to
/v2/databases/$DATABASE_ID/pools/$POOL_NAME. -
databases.databasesUpdateEvictionPolicyTo configure an eviction policy for an existing Redis cluster, send a PUT request to
/v2/databases/$DATABASE_ID/eviction_policyspecifying the desired policy. -
databases.databasesUpdateFirewallRulesTo update a database cluster's firewall rules (known as "trusted sources" in the control panel), send a PUT request to
/v2/databases/$DATABASE_ID/firewallspecifying which resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 rules (or trusted sources). When possible, we recommend to limit access to them instead of using a firewall. A successful -
databases.databasesUpdateMaintenanceWindowTo configure the window when automatic maintenance should be performed for a database cluster, send a PUT request to
/v2/databases/$DATABASE_ID/maintenance. A successful request will receive a 204 No Content status code with no body in response. -
databases.databasesUpdateMajorVersionTo upgrade the major version of a database, send a PUT request to
/v2/databases/$DATABASE_ID/upgrade, specifying the target version. A successful request will receive a 204 No Content status code with no body in response. -
databases.databasesUpdateOnlineMigrationTo start an online migration, send a PUT request to
/v2/databases/$DATABASE_ID/online-migrationendpoint. Migrating a cluster establishes a connection with an existing cluster and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, and Redis clusters. -
databases.databasesUpdateRegionTo migrate a database cluster to a new region, send a
PUTrequest to/v2/databases/$DATABASE_ID/migrate. The body of the request must specify aregionattribute.A successful request will receive a 202 Accepted status code with no body in response. Querying the database cluster will show that its
statusattribute will now be set tomigrating. This will transition back toonlinewhen the migration has completed. -
databases.databasesUpdateSqlModeTo configure the SQL modes for an existing MySQL cluster, send a PUT request to
/v2/databases/$DATABASE_ID/sql_modespecifying the desired modes. See the official MySQL 8 documentation for a . A successful request will receive a 204 No Content status code with no body in response. -
domainRecords.domainsCreateRecordTo create a new record to a domain, send a POST request to
/v2/domains/$DOMAIN_NAME/records.The request must include all of the required fields for the domain record type being added.
See the for details regarding record types and their respective required attributes.
-
domainRecords.domainsDeleteRecordTo delete a record for a domain, send a DELETE request to
/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID.The record will be deleted and the response status will be a 204. This indicates a successful request with no body returned.
-
domainRecords.domainsGetRecordTo retrieve a specific domain record, send a GET request to
/v2/domains/$DOMAIN_NAME/records/$RECORD_ID. -
domainRecords.domainsListRecordsTo get a listing of all records configured for a domain, send a GET request to
/v2/domains/$DOMAIN_NAME/records. The list of records returned can be filtered by using thenameandtypequery parameters. For example, to only include A records for a domain, send a GET request to/v2/domains/$DOMAIN_NAME/records?type=A.namemust be a fully qualified record name. For example, to only include records matchingsub.example.com, send a GET request to/v2/domains/$DOMAIN_NAME/records?name=sub.example.com. Both name and type may be used together. -
domainRecords.domainsPatchRecordTo update an existing record, send a PATCH request to
/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record.See the for details regarding record types and their respective attributes.
-
domainRecords.domainsUpdateRecordTo update an existing record, send a PUT request to
/v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record.See the for details regarding record types and their respective attributes.
-
domains.domainsCreateTo create a new domain, send a POST request to
/v2/domains. Set the "name" attribute to the domain name you are adding. Optionally, you may set the "ip_address" attribute, and an A record will be automatically created pointing to the apex domain. -
domains.domainsDeleteTo delete a domain, send a DELETE request to
/v2/domains/$DOMAIN_NAME. -
domains.domainsGetTo get details about a specific domain, send a GET request to
/v2/domains/$DOMAIN_NAME. -
domains.domainsListTo retrieve a list of all of the domains in your account, send a GET request to
/v2/domains. -
dropletActions.dropletActionsGetTo retrieve a Droplet action, send a GET request to
/v2/droplets/$DROPLET_ID/actions/$ACTION_ID.The response will be a JSON object with a key called
action. The value will be a Droplet action object. -
dropletActions.dropletActionsListTo retrieve a list of all actions that have been executed for a Droplet, send a GET request to
/v2/droplets/$DROPLET_ID/actions.The results will be returned as a JSON object with an
actionskey. This will be set to an array filled withactionobjects containing the standardactionattributes. -
dropletActions.dropletActionsPostTo initiate an action on a Droplet send a POST request to
/v2/droplets/$DROPLET_ID/actions. In the JSON body to the request, set thetypeattribute to on of the supported action types: -
dropletActions.dropletActionsPostByTagSome actions can be performed in bulk on tagged Droplets. The actions can be initiated by sending a POST to
/v2/droplets/actions?tag_name=$TAG_NAMEwith the action arguments.Only a sub-set of action types are supported:
power_cyclepower_onpower_offshutdownenable_ipv6enable_backupsdisable_backupssnapshot
-
droplets.dropletsCreateTo create a new Droplet, send a POST request to
/v2/dropletssetting the required attributes.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. The response code, 202 Accepted, does not indicate the success or failure of the operation, just that the request has been accepted for processing. Theactionsreturned as part of the response'slinksobject can be used to check the status of the Droplet create event.Create Multiple Droplets
Creating multiple Droplets is very similar to creating a single Droplet. Instead of sending
nameas a string, sendnamesas an array of strings. A Droplet will be created for each name you send using the associated information. Up to ten Droplets may be created this way at a time.Rather than returning a single Droplet, the response body will contain a JSON array with a key called
droplets. This will be set to an array of JSON objects, each of which will contain the standard Droplet attributes. The response code, 202 Accepted, does not indicate the success or failure of any operation, just that the request has been accepted for processing. The array ofactionsreturned as part of the response'slinksobject can be used to check the status of each individual Droplet create event. -
droplets.dropletsDestroyTo delete a Droplet, send a DELETE request to
/v2/droplets/$DROPLET_ID.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
droplets.dropletsDestroyByTagTo delete all Droplets assigned to a specific tag, include the
tag_namequery parameter set to the name of the tag in your DELETE request. For example,/v2/droplets?tag_name=$TAG_NAME.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
droplets.dropletsDestroyRetryWithAssociatedResourcesIf the status of a request to destroy a Droplet with its associated resources reported any errors, it can be retried by sending a POST request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retryendpoint.Only one destroy can be active at a time per Droplet. If a retry is issued while another destroy is in progress for the Droplet a 409 status code will be returned. A successful response will include a 202 response code and no content.
-
droplets.dropletsDestroyWithAssociatedResourcesDangerousTo destroy a Droplet along with all of its associated resources, send a DELETE request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerousendpoint. The headers of this request must include anX-Dangerouskey set totrue. To preview which resources will be destroyed, first query the Droplet's associated resources. This operation can not be reverse and should be used with caution.A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources.
-
droplets.dropletsDestroyWithAssociatedResourcesSelectiveTo destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selectiveendpoint. The JSON body of the request should includereserved_ips,snapshots,volumes, orvolume_snapshotskeys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet's associated resources. Any associated resource not included in the request will remain and continue to accrue changes on your account.A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources.
-
droplets.dropletsGetTo show information about an individual Droplet, send a GET request to
/v2/droplets/$DROPLET_ID. -
droplets.dropletsGetDestroyAssociatedResourcesStatusTo check on the status of a request to destroy a Droplet with its associated resources, send a GET request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/statusendpoint. -
droplets.dropletsListTo list all Droplets in your account, send a GET request to
/v2/droplets.The response body will be a JSON object with a key of
droplets. This will be set to an array containing objects each representing a Droplet. These will contain the standard Droplet attributes.Filtering Results by Tag
It's possible to request filtered results by including certain query parameters. To only list Droplets assigned to a specific tag, include the
tag_namequery parameter set to the name of the tag in your GET request. For example,/v2/droplets?tag_name=$TAG_NAME. -
droplets.dropletsListAssociatedResourcesTo list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resourcesendpoint.The response will be a JSON object containing
snapshots,volumes, andvolume_snapshotskeys. Each will be set to an array of objects containing information about the associated resources. -
droplets.dropletsListBackupsTo retrieve any backups associated with a Droplet, send a GET request to
/v2/droplets/$DROPLET_ID/backups.You will get back a JSON object that has a
backupskey. This will be set to an array of backup objects, each of which contain the standard Droplet backup attributes. -
droplets.dropletsListFirewallsTo retrieve a list of all firewalls available to a Droplet, send a GET request to
/v2/droplets/$DROPLET_ID/firewallsThe response will be a JSON object that has a key called
firewalls. This will be set to an array offirewallobjects, each of which contain the standardfirewallattributes. -
droplets.dropletsListKernelsTo retrieve a list of all kernels available to a Droplet, send a GET request to
/v2/droplets/$DROPLET_ID/kernelsThe response will be a JSON object that has a key called
kernels. This will be set to an array ofkernelobjects, each of which contain the standardkernelattributes. -
droplets.dropletsListNeighborsTo retrieve a list of any "neighbors" (i.e. Droplets that are co-located on the same physical hardware) for a specific Droplet, send a GET request to
/v2/droplets/$DROPLET_ID/neighbors.The results will be returned as a JSON object with a key of
droplets. This will be set to an array containing objects representing any other Droplets that share the same physical hardware. An empty array indicates that the Droplet is not co-located any other Droplets associated with your account. -
droplets.dropletsListNeighborsIdsTo retrieve a list of all Droplets that are co-located on the same physical hardware, send a GET request to
/v2/reports/droplet_neighbors_ids.The results will be returned as a JSON object with a key of
neighbor_ids. This will be set to an array of arrays. Each array will contain a set of Droplet IDs for Droplets that share a physical server. An empty array indicates that all Droplets associated with your account are located on separate physical hardware. -
droplets.dropletsListSnapshotsTo retrieve the snapshots that have been created from a Droplet, send a GET request to
/v2/droplets/$DROPLET_ID/snapshots.You will get back a JSON object that has a
snapshotskey. This will be set to an array of snapshot objects, each of which contain the standard Droplet snapshot attributes. -
firewalls.firewallsAddRulesTo add additional access rules to a firewall, send a POST request to
/v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an inbound_rules and/or outbound_rules attribute containing an array of rules to be added.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.
-
firewalls.firewallsAddTagsTo assign a tag representing a group of Droplets to a firewall, send a POST request to
/v2/firewalls/$FIREWALL_ID/tags. In the body of the request, there should be atagsattribute containing a list of tag names.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.
-
firewalls.firewallsAssignDropletsTo assign a Droplet to a firewall, send a POST request to
/v2/firewalls/$FIREWALL_ID/droplets. In the body of the request, there should be adroplet_idsattribute containing a list of Droplet IDs.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.
-
firewalls.firewallsCreateTo create a new firewall, send a POST request to
/v2/firewalls. The request must contain at least one inbound or outbound access rule. -
firewalls.firewallsDeleteTo delete a firewall send a DELETE request to
/v2/firewalls/$FIREWALL_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.
-
firewalls.firewallsDeleteDropletsTo remove a Droplet from a firewall, send a DELETE request to
/v2/firewalls/$FIREWALL_ID/droplets. In the body of the request, there should be adroplet_idsattribute containing a list of Droplet IDs.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.
-
firewalls.firewallsDeleteRulesTo remove access rules from a firewall, send a DELETE request to
/v2/firewalls/$FIREWALL_ID/rules. The body of the request may include aninbound_rulesand/oroutbound_rulesattribute containing an array of rules to be removed.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.
-
firewalls.firewallsDeleteTagsTo remove a tag representing a group of Droplets from a firewall, send a DELETE request to
/v2/firewalls/$FIREWALL_ID/tags. In the body of the request, there should be atagsattribute containing a list of tag names.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.
-
firewalls.firewallsGetTo show information about an existing firewall, send a GET request to
/v2/firewalls/$FIREWALL_ID. -
firewalls.firewallsListTo list all of the firewalls available on your account, send a GET request to
/v2/firewalls. -
firewalls.firewallsUpdateTo update the configuration of an existing firewall, send a PUT request to
/v2/firewalls/$FIREWALL_ID. The request should contain a full representation of the firewall including existing attributes. Note that any attributes that are not provided will be reset to their default values. -
floatingIpActions.floatingIPsActionGetTo retrieve the status of a floating IP action, send a GET request to
/v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID. -
floatingIpActions.floatingIPsActionListTo retrieve all actions that have been executed on a floating IP, send a GET request to
/v2/floating_ips/$FLOATING_IP/actions. -
floatingIpActions.floatingIPsActionPostTo initiate an action on a floating IP send a POST request to
/v2/floating_ips/$FLOATING_IP/actions. In the JSON body to the request, set thetypeattribute to on of the supported action types: -
floatingIPs.floatingIPsCreateOn creation, a floating IP must be either assigned to a Droplet or reserved to a region.
-
To create a new floating IP assigned to a Droplet, send a POST request to
/v2/floating_ipswith thedroplet_idattribute. -
To create a new floating IP reserved to a region, send a POST request to
/v2/floating_ipswith theregionattribute.
Note: In addition to the standard rate limiting, only 12 floating IPs may be created per 60 seconds.
-
-
floatingIPs.floatingIPsDeleteTo delete a floating IP and remove it from your account, send a DELETE request to
/v2/floating_ips/$FLOATING_IP_ADDR.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
floatingIPs.floatingIPsGetTo show information about a floating IP, send a GET request to
/v2/floating_ips/$FLOATING_IP_ADDR. -
floatingIPs.floatingIPsListTo list all of the floating IPs available on your account, send a GET request to
/v2/floating_ips. -
functions.functionsCreateNamespaceCreates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to
/v2/functions/namespaceswith theregionandlabelproperties. -
functions.functionsCreateTriggerCreates a new trigger for a given function in a namespace. To create a trigger, send a POST request to
/v2/functions/namespaces/$NAMESPACE_ID/triggerswith thename,function,type,is_enabledandscheduled_detailsproperties. -
functions.functionsDeleteNamespaceDeletes the given namespace. When a namespace is deleted all assets, in the namespace are deleted, this includes packages, functions and triggers. Deleting a namespace is a destructive operation and assets in the namespace are not recoverable after deletion. Some metadata is retained, such as activations, or soft deleted for reporting purposes. To delete namespace, send a DELETE request to
/v2/functions/namespaces/$NAMESPACE_ID. A successful deletion returns a 204 response. -
functions.functionsDeleteTriggerDeletes the given trigger. To delete trigger, send a DELETE request to
/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME. A successful deletion returns a 204 response. -
functions.functionsGetNamespaceGets the namespace details for the given namespace UUID. To get namespace details, send a GET request to
/v2/functions/namespaces/$NAMESPACE_IDwith no parameters. -
functions.functionsGetTriggerGets the trigger details. To get the trigger details, send a GET request to
/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME. -
functions.functionsListNamespacesReturns a list of namespaces associated with the current user. To get all namespaces, send a GET request to
/v2/functions/namespaces. -
functions.functionsListTriggersReturns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to
/v2/functions/namespaces/$NAMESPACE_ID/triggers. -
functions.functionsUpdateTriggerUpdates the details of the given trigger. To update a trigger, send a PUT request to
/v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAMEwith new values for theis_enabledorscheduled_detailsproperties. -
imageActions.imageActionsGetTo retrieve the status of an image action, send a GET request to
/v2/images/$IMAGE_ID/actions/$IMAGE_ACTION_ID. -
imageActions.imageActionsListTo retrieve all actions that have been executed on an image, send a GET request to
/v2/images/$IMAGE_ID/actions. -
imageActions.imageActionsPostThe following actions are available on an Image.
Convert an Image to a Snapshot
To convert an image, for example, a backup to a snapshot, send a POST request to
/v2/images/$IMAGE_ID/actions. Set thetypeattribute toconvert.Transfer an Image
To transfer an image to another region, send a POST request to
/v2/images/$IMAGE_ID/actions. Set thetypeattribute totransferand setregionattribute to the slug identifier of the region you wish to transfer to. -
images.imagesCreateCustomTo create a new custom image, send a POST request to /v2/images. The body must contain a url attribute pointing to a Linux virtual machine image to be imported into DigitalOcean. The image must be in the raw, qcow2, vhdx, vdi, or vmdk format. It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed.
-
images.imagesDeleteTo delete a snapshot or custom image, send a
DELETErequest to/v2/images/$IMAGE_ID. -
images.imagesGetTo retrieve information about an image, send a
GETrequest to/v2/images/$IDENTIFIER. -
images.imagesListTo list all of the images available on your account, send a GET request to /v2/images.
Filtering Results
It's possible to request filtered results by including certain query parameters.
Image Type
Either 1-Click Application or OS Distribution images can be filtered by using the
typequery parameter.Important: The
typequery parameter does not directly relate to thetypeattribute.To retrieve only distribution images, include the
typequery parameter set to distribution,/v2/images?type=distribution.To retrieve only application images, include the
typequery parameter set to application,/v2/images?type=application.User Images
To retrieve only the private images of a user, include the
privatequery parameter set to true,/v2/images?private=true.Tags
To list all images assigned to a specific tag, include the
tag_namequery parameter set to the name of the tag in your GET request. For example,/v2/images?tag_name=$TAG_NAME. -
images.imagesUpdateTo update an image, send a
PUTrequest to/v2/images/$IMAGE_ID. Set thenameattribute to the new value you would like to use. For custom images, thedescriptionanddistributionattributes may also be updated. -
kubernetes.kubernetesAddNodePoolTo add an additional node pool to a Kubernetes clusters, send a POST request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_poolswith the following attributes. -
kubernetes.kubernetesAddRegistryTo integrate the container registry with Kubernetes clusters, send a POST request to
/v2/kubernetes/registry. -
kubernetes.kubernetesCreateClusterTo create a new Kubernetes cluster, send a POST request to
/v2/kubernetes/clusters. The request must contain at least one node pool with at least one worker.The request may contain a maintenance window policy describing a time period when disruptive maintenance tasks may be carried out. Omitting the policy implies that a window will be chosen automatically. See for details.
-
kubernetes.kubernetesDeleteClusterTo delete a Kubernetes cluster and all services deployed to it, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID.A 204 status code with no body will be returned in response to a successful request.
-
kubernetes.kubernetesDeleteNodeTo delete a single node in a pool, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID.Appending the
skip_drain=1query parameter to the request causes node draining to be skipped. Omitting the query parameter or setting its value to0carries out draining prior to deletion.Appending the
replace=1query parameter to the request causes the node to be replaced by a new one after deletion. Omitting the query parameter or setting its value to0deletes without replacement. -
kubernetes.kubernetesDeleteNodePoolTo delete a node pool, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID.A 204 status code with no body will be returned in response to a successful request. Nodes in the pool will subsequently be drained and deleted.
-
kubernetes.kubernetesDestroyAssociatedResourcesDangerousTo delete a Kubernetes cluster with all of its associated resources, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous. A 204 status code with no body will be returned in response to a successful request. -
kubernetes.kubernetesDestroyAssociatedResourcesSelectiveTo delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective.The JSON body of the request should include
load_balancers,volumes, orvolume_snapshotskeys each set to an array of IDs for the associated resources to be destroyed.The IDs can be found by querying the cluster's associated resources endpoint. Any associated resource not included in the request will remain and continue to accrue changes on your account.
-
kubernetes.kubernetesGetAvailableUpgradesTo determine whether a cluster can be upgraded, and the versions to which it can be upgraded, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades. -
kubernetes.kubernetesGetClusterTo show information about an existing Kubernetes cluster, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID. -
kubernetes.kubernetesGetClusterLintResultsTo request clusterlint diagnostics for your cluster, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint. If therun_idquery parameter is provided, then the diagnostics for the specific run is fetched. By default, the latest results are shown.To find out how to address clusterlint feedback, please refer to .
-
kubernetes.kubernetesGetClusterUserTo show information the user associated with a Kubernetes cluster, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/user. -
kubernetes.kubernetesGetCredentialsThis endpoint returns a JSON object . It can be used to programmatically construct Kubernetes clients which cannot parse kubeconfig files.
The resulting JSON object contains token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of supported versions and more information, see "".
To retrieve credentials for accessing a Kubernetes cluster, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials.Clusters supporting token-based authentication may define an expiration by passing a duration in seconds as a query parameter to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS. If not set or 0, then the token will have a 7 day expiry. The query parameter has no impact in certificate-based authentication. -
kubernetes.kubernetesGetKubeconfigThis endpoint returns a kubeconfig file in YAML format. It can be used to connect to and administer the cluster using the Kubernetes command line tool,
kubectl, or other programs supporting kubeconfig files (e.g., client libraries).The resulting kubeconfig file uses token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of supported versions and more information, see "".
To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig.Clusters supporting token-based authentication may define an expiration by passing a duration in seconds as a query parameter to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS. If not set or 0, then the token will have a 7 day expiry. The query parameter has no impact in certificate-based authentication. -
kubernetes.kubernetesGetNodePoolTo show information about a specific node pool in a Kubernetes cluster, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID. -
kubernetes.kubernetesListAssociatedResourcesTo list the associated billable resources that can be destroyed along with a cluster, send a GET request to the
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resourcesendpoint. -
kubernetes.kubernetesListClustersTo list all of the Kubernetes clusters on your account, send a GET request to
/v2/kubernetes/clusters. -
kubernetes.kubernetesListNodePoolsTo list all of the node pools in a Kubernetes clusters, send a GET request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools. -
kubernetes.kubernetesListOptionsTo list the versions of Kubernetes available for use, the regions that support Kubernetes, and the available node sizes, send a GET request to
/v2/kubernetes/options. -
kubernetes.kubernetesRecycleNodePoolThe endpoint has been deprecated. Please use the DELETE
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_IDmethod instead. -
kubernetes.kubernetesRemoveRegistryTo remove the container registry from Kubernetes clusters, send a DELETE request to
/v2/kubernetes/registry. -
kubernetes.kubernetesRunClusterLintClusterlint helps operators conform to Kubernetes best practices around resources, security and reliability to avoid common problems while operating or upgrading the clusters.
To request a clusterlint run on your cluster, send a POST request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint. This will run all checks present in thedoksgroup by default, if a request body is not specified. Optionally specify the below attributes.For information about the available checks, please refer to .
-
kubernetes.kubernetesUpdateClusterTo update a Kubernetes cluster, send a PUT request to
/v2/kubernetes/clusters/$K8S_CLUSTER_IDand specify one or more of the attributes below. -
kubernetes.kubernetesUpdateNodePoolTo update the name of a node pool, edit the tags applied to it, or adjust its number of nodes, send a PUT request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_IDwith the following attributes. -
kubernetes.kubernetesUpgradeClusterTo immediately upgrade a Kubernetes cluster to a newer patch release of Kubernetes, send a POST request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrade. The body of the request must specify a version attribute.Available upgrade versions for a cluster can be fetched from
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades. -
loadBalancers.loadBalancersAddDropletsTo assign a Droplet to a load balancer instance, send a POST request to
/v2/load_balancers/$LOAD_BALANCER_ID/droplets. In the body of the request, there should be adroplet_idsattribute containing a list of Droplet IDs. Individual Droplets can not be added to a load balancer configured with a Droplet tag. Attempting to do so will result in a "422 Unprocessable Entity" response from the API.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.
-
loadBalancers.loadBalancersAddForwardingRulesTo add an additional forwarding rule to a load balancer instance, send a POST request to
/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules. In the body of the request, there should be aforwarding_rulesattribute containing an array of rules to be added.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.
-
loadBalancers.loadBalancersCreateTo create a new load balancer instance, send a POST request to
/v2/load_balancers.You can specify the Droplets that will sit behind the load balancer using one of two methods:
- Set
droplet_idsto a list of specific Droplet IDs. - Set
tagto the name of a tag. All Droplets with this tag applied will be assigned to the load balancer. Additional Droplets will be automatically assigned as they are tagged.
These methods are mutually exclusive.
- Set
-
loadBalancers.loadBalancersDeleteTo delete a load balancer instance, disassociating any Droplets assigned to it and removing it from your account, send a DELETE request to
/v2/load_balancers/$LOAD_BALANCER_ID.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
loadBalancers.loadBalancersGetTo show information about a load balancer instance, send a GET request to
/v2/load_balancers/$LOAD_BALANCER_ID. -
loadBalancers.loadBalancersListTo list all of the load balancer instances on your account, send a GET request to
/v2/load_balancers. -
loadBalancers.loadBalancersRemoveDropletsTo remove a Droplet from a load balancer instance, send a DELETE request to
/v2/load_balancers/$LOAD_BALANCER_ID/droplets. In the body of the request, there should be adroplet_idsattribute containing a list of Droplet IDs.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.
-
loadBalancers.loadBalancersRemoveForwardingRulesTo remove forwarding rules from a load balancer instance, send a DELETE request to
/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules. In the body of the request, there should be aforwarding_rulesattribute containing an array of rules to be removed.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.
-
loadBalancers.loadBalancersUpdateTo update a load balancer's settings, send a PUT request to
/v2/load_balancers/$LOAD_BALANCER_ID. The request should contain a full representation of the load balancer including existing attributes. It may contain one of thedroplets_idsortagattributes as they are mutually exclusive. Note that any attribute that is not provided will be reset to its default value. -
monitoring.monitoringCreateAlertPolicyTo create a new alert, send a POST request to
/v2/monitoring/alerts. -
monitoring.monitoringDeleteAlertPolicyTo delete an alert policy, send a DELETE request to
/v2/monitoring/alerts/{alert_uuid} -
monitoring.monitoringGetAlertPolicyTo retrieve a given alert policy, send a GET request to
/v2/monitoring/alerts/{alert_uuid} -
monitoring.monitoringGetDropletBandwidthMetricsTo retrieve bandwidth metrics for a given Droplet, send a GET request to
/v2/monitoring/metrics/droplet/bandwidth. Use theinterfacequery parameter to specify if the results should be for theprivateorpublicinterface. Use thedirectionquery parameter to specify if the results should be forinboundoroutboundtraffic. -
monitoring.monitoringGetDropletCpuMetricsTo retrieve CPU metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/cpu. -
monitoring.monitoringGetDropletFilesystemFreeMetricsTo retrieve filesystem free metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/filesystem_free. -
monitoring.monitoringGetDropletFilesystemSizeMetricsTo retrieve filesystem size metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/filesystem_size. -
monitoring.monitoringGetDropletLoad15MetricsTo retrieve 15 minute load average metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/load_15. -
monitoring.monitoringGetDropletLoad1MetricsTo retrieve 1 minute load average metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/load_1. -
monitoring.monitoringGetDropletLoad5MetricsTo retrieve 5 minute load average metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/load_5. -
monitoring.monitoringGetDropletMemoryAvailableMetricsTo retrieve available memory metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/memory_available. -
monitoring.monitoringGetDropletMemoryCachedMetricsTo retrieve cached memory metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/memory_cached. -
monitoring.monitoringGetDropletMemoryFreeMetricsTo retrieve free memory metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/memory_free. -
monitoring.monitoringGetDropletMemoryTotalMetricsTo retrieve total memory metrics for a given droplet, send a GET request to
/v2/monitoring/metrics/droplet/memory_total. -
monitoring.monitoringListAlertPolicyReturns all alert policies that are configured for the given account. To List all alert policies, send a GET request to
/v2/monitoring/alerts. -
monitoring.monitoringUpdateAlertPolicyTo update en existing policy, send a PUT request to
v2/monitoring/alerts/{alert_uuid}. -
projectResources.projectsAssignResourcesTo assign resources to a project, send a POST request to
/v2/projects/$PROJECT_ID/resources. -
projectResources.projectsAssignResourcesDefaultTo assign resources to your default project, send a POST request to
/v2/projects/default/resources. -
projectResources.projectsListResourcesTo list all your resources in a project, send a GET request to
/v2/projects/$PROJECT_ID/resources. -
projectResources.projectsListResourcesDefaultTo list all your resources in your default project, send a GET request to
/v2/projects/default/resources. -
projects.projectsCreateTo create a project, send a POST request to
/v2/projects. -
projects.projectsDeleteTo delete a project, send a DELETE request to
/v2/projects/$PROJECT_ID. To be deleted, a project must not have any resources assigned to it. Any existing resources must first be reassigned or destroyed, or you will receive a 412 error.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
projects.projectsGetTo get a project, send a GET request to
/v2/projects/$PROJECT_ID. -
projects.projectsGetDefaultTo get your default project, send a GET request to
/v2/projects/default. -
projects.projectsListTo list all your projects, send a GET request to
/v2/projects. -
projects.projectsPatchTo update only specific attributes of a project, send a PATCH request to
/v2/projects/$PROJECT_ID. At least one of the following attributes needs to be sent. -
projects.projectsPatchDefaultTo update only specific attributes of your default project, send a PATCH request to
/v2/projects/default. At least one of the following attributes needs to be sent. -
projects.projectsUpdateTo update a project, send a PUT request to
/v2/projects/$PROJECT_ID. All of the following attributes must be sent. -
projects.projectsUpdateDefaultTo update you default project, send a PUT request to
/v2/projects/default. All of the following attributes must be sent. -
regions.regionsListTo list all of the regions that are available, send a GET request to
/v2/regions. The response will be a JSON object with a key calledregions. The value of this will be an array ofregionobjects, each of which will contain the standard region attributes. -
reservedIpActions.reservedIPsActionsGetTo retrieve the status of a reserved IP action, send a GET request to
/v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID. -
reservedIpActions.reservedIPsActionsListTo retrieve all actions that have been executed on a reserved IP, send a GET request to
/v2/reserved_ips/$RESERVED_IP/actions. -
reservedIpActions.reservedIPsActionsPostTo initiate an action on a reserved IP send a POST request to
/v2/reserved_ips/$RESERVED_IP/actions. In the JSON body to the request, set thetypeattribute to on of the supported action types: -
reservedIPs.reservedIPsCreateOn creation, a reserved IP must be either assigned to a Droplet or reserved to a region.
-
To create a new reserved IP assigned to a Droplet, send a POST request to
/v2/reserved_ipswith thedroplet_idattribute. -
To create a new reserved IP reserved to a region, send a POST request to
/v2/reserved_ipswith theregionattribute.
Note: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds.
-
-
reservedIPs.reservedIPsDeleteTo delete a reserved IP and remove it from your account, send a DELETE request to
/v2/reserved_ips/$RESERVED_IP_ADDR.A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
-
reservedIPs.reservedIPsGetTo show information about a reserved IP, send a GET request to
/v2/reserved_ips/$RESERVED_IP_ADDR. -
reservedIPs.reservedIPsListTo list all of the reserved IPs available on your account, send a GET request to
/v2/reserved_ips. -
sizes.sizesListTo list all of available Droplet sizes, send a GET request to
/v2/sizes. The response will be a JSON object with a key calledsizes. The value of this will be an array ofsizeobjects each of which contain the standard size attributes. -
snapshots.snapshotsDeleteBoth Droplet and volume snapshots are managed through the
/v2/snapshots/endpoint. To delete a snapshot, send a DELETE request to/v2/snapshots/$SNAPSHOT_ID.A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
-
snapshots.snapshotsGetTo retrieve information about a snapshot, send a GET request to
/v2/snapshots/$SNAPSHOT_ID.The response will be a JSON object with a key called
snapshot. The value of this will be an snapshot object containing the standard snapshot attributes. -
snapshots.snapshotsListTo list all of the snapshots available on your account, send a GET request to
/v2/snapshots.The response will be a JSON object with a key called
snapshots. This will be set to an array ofsnapshotobjects, each of which will contain the standard snapshot attributes.Filtering Results by Resource Type
It's possible to request filtered results by including certain query parameters.
List Droplet Snapshots
To retrieve only snapshots based on Droplets, include the
resource_typequery parameter set todroplet. For example,/v2/snapshots?resource_type=droplet.List Volume Snapshots
To retrieve only snapshots based on volumes, include the
resource_typequery parameter set tovolume. For example,/v2/snapshots?resource_type=volume. -
sshKeys.sshKeysCreateTo add a new SSH public key to your DigitalOcean account, send a POST request to
/v2/account/keys. Set thenameattribute to the name you wish to use and thepublic_keyattribute to the full public key you are adding. -
sshKeys.sshKeysDeleteTo destroy a public SSH key that you have in your account, send a DELETE request to
/v2/account/keys/$KEY_IDor/v2/account/keys/$KEY_FINGERPRINT. A 204 status will be returned, indicating that the action was successful and that the response body is empty. -
sshKeys.sshKeysGetTo get information about a key, send a GET request to
/v2/account/keys/$KEY_IDor/v2/account/keys/$KEY_FINGERPRINT. The response will be a JSON object with the keyssh_keyand value an ssh_key object which contains the standard ssh_key attributes. -
sshKeys.sshKeysListTo list all of the keys in your account, send a GET request to
/v2/account/keys. The response will be a JSON object with a key set tossh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes. -
sshKeys.sshKeysUpdateTo update the name of an SSH key, send a PUT request to either
/v2/account/keys/$SSH_KEY_IDor/v2/account/keys/$SSH_KEY_FINGERPRINT. Set thenameattribute to the new name you want to use. -
tags.tagsAssignResourcesResources can be tagged by sending a POST request to
/v2/tags/$TAG_NAME/resourceswith an array of json objects containingresource_idandresource_typeattributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported.resource_typeis expected to be the stringdroplet,database,image,volumeorvolume_snapshot.resource_idis expected to be the ID of the resource as a string. -
tags.tagsCreateTo create a tag you can send a POST request to
/v2/tagswith anameattribute. -
tags.tagsDeleteA tag can be deleted by sending a
DELETErequest to/v2/tags/$TAG_NAME. Deleting a tag also untags all the resources that have previously been tagged by the Tag -
tags.tagsGetTo retrieve an individual tag, you can send a
GETrequest to/v2/tags/$TAG_NAME. -
tags.tagsListTo list all of your tags, you can send a GET request to
/v2/tags. -
tags.tagsUnassignResourcesResources can be untagged by sending a DELETE request to
/v2/tags/$TAG_NAME/resourceswith an array of json objects containingresource_idandresource_typeattributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported.resource_typeis expected to be the stringdroplet,database,image,volumeorvolume_snapshot.resource_idis expected to be the ID of the resource as a string. -
uptime.uptimeAlertCreateTo create an Uptime alert, send a POST request to
/v2/uptime/checks/$CHECK_ID/alertsspecifying the attributes in the table below in the JSON body. -
uptime.uptimeAlertDeleteTo delete an Uptime alert, send a DELETE request to
/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID. A 204 status code with no body will be returned in response to a successful request. -
uptime.uptimeAlertGetTo show information about an existing alert, send a GET request to
/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID. -
uptime.uptimeAlertUpdateTo update the settings of an Uptime alert, send a PUT request to
/v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID. -
uptime.uptimeCheckAlertsListTo list all of the alerts for an Uptime check, send a GET request to
/v2/uptime/checks/$CHECK_ID/alerts. -
uptime.uptimeCheckCreateTo create an Uptime check, send a POST request to
/v2/uptime/checksspecifying the attributes in the table below in the JSON body. -
uptime.uptimeCheckDeleteTo delete an Uptime check, send a DELETE request to
/v2/uptime/checks/$CHECK_ID. A 204 status code with no body will be returned in response to a successful request.Deleting a check will also delete alerts associated with the check.
-
uptime.uptimeCheckGetTo show information about an existing check, send a GET request to
/v2/uptime/checks/$CHECK_ID. -
uptime.uptimeChecksListTo list all of the Uptime checks on your account, send a GET request to
/v2/uptime/checks. -
uptime.uptimeCheckStateGetTo show information about an existing check's state, send a GET request to
/v2/uptime/checks/$CHECK_ID/state. -
uptime.uptimeCheckUpdateTo update the settings of an Uptime check, send a PUT request to
/v2/uptime/checks/$CHECK_ID. -
vpCs.vpcsCreateTo create a VPC, send a POST request to
/v2/vpcsspecifying the attributes in the table below in the JSON body.Note: If you do not currently have a VPC network in a specific datacenter region, the first one that you create will be set as the default for that region. The default VPC for a region cannot be changed or deleted.
-
vpCs.vpcsDeleteTo delete a VPC, send a DELETE request to
/v2/vpcs/$VPC_ID. A 204 status code with no body will be returned in response to a successful request.The default VPC for a region can not be deleted. Additionally, a VPC can only be deleted if it does not contain any member resources. Attempting to delete a region's default VPC or a VPC that still has members will result in a 403 Forbidden error response.
-
vpCs.vpcsGetTo show information about an existing VPC, send a GET request to
/v2/vpcs/$VPC_ID. -
vpCs.vpcsListTo list all of the VPCs on your account, send a GET request to
/v2/vpcs. -
vpCs.vpcsListMembersTo list all of the resources that are members of a VPC, send a GET request to
/v2/vpcs/$VPC_ID/members.To only list resources of a specific type that are members of the VPC, included a
resource_typequery parameter. For example, to only list Droplets in the VPC, send a GET request to/v2/vpcs/$VPC_ID/members?resource_type=droplet. -
vpCs.vpcsPatchTo update a subset of information about a VPC, send a PATCH request to
/v2/vpcs/$VPC_ID. -
vpCs.vpcsUpdateTo update information about a VPC, send a PUT request to
/v2/vpcs/$VPC_ID. -
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools