Skip to content

DigitalOcean API API

by digitalocean.com

Bearer tokenHTTPSCloud Platforms
Open documentation ↗

Overview

# 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. |Method|Usage| |--- |--- | |GET|For simple retrieval of information about your account, Droplets, or environment, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.| |DELETE|To destroy a resource and remove it from your account and environment, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource's availability prior to issuing a delete command, the final state will be the same regardless of its existence.| |PUT|To update the information about a resource in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object.| |PATCH|Some resources support partial modification. In these cases, the PATCH method is available. Unlike PUT which generally requires a complete representation of a resource, a PATCH request is is a set of instructions on how to modify a resource updating only specific attributes.| |POST|To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.| |HEAD|Finally, to retrieve metadata information, you should use the HEAD method to get the headers. This returns only the header of what would be returned with an associated GET request. Response headers contain some useful information about your API access and the results that are available for your request. For instance, the headers contain your current rate-limit value and the amount of time available until the limit resets. It also contains metrics about the total number of objects found, pagination information, and the total content length.| ## HTTP Statuses Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes. In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered. In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered. Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed. If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having

DigitalOcean API is a cloud platforms API from digitalocean.com. Requests are authenticated with a bearer token. It is served over HTTPS. Its OpenAPI description documents 290 endpoints.

At a glance

Authentication
Bearer token
HTTPS
Yes
CORS
Unknown
Base URL
https://api.digitalocean.com
Version
2.0
Endpoints
290
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.digitalocean.com/v2/1-clicks" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.digitalocean.com/v2/1-clicks", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.digitalocean.com/v2/1-clicks",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/v2/1-clicksList 1-Click Applications
POST/v2/1-clicks/kubernetesInstall Kubernetes 1-Click Applications
GET/v2/accountGet User Information
GET/v2/account/keysList All SSH Keys
POST/v2/account/keysCreate a New SSH Key
GET/v2/account/keys/{ssh_key_identifier}Retrieve an Existing SSH Key
PUT/v2/account/keys/{ssh_key_identifier}Update an SSH Key's Name
DELETE/v2/account/keys/{ssh_key_identifier}Delete an SSH Key
GET/v2/actionsList All Actions
GET/v2/actions/{action_id}Retrieve an Existing Action
GET/v2/appsList All Apps
POST/v2/appsCreate a New App
POST/v2/apps/metrics/bandwidth_dailyRetrieve Multiple Apps' Daily Bandwidth Metrics
POST/v2/apps/proposePropose an App Spec
GET/v2/apps/regionsList App Regions
GET/v2/apps/tiersList App Tiers
GET/v2/apps/tiers/instance_sizesList Instance Sizes
GET/v2/apps/tiers/instance_sizes/{slug}Retrieve an Instance Size
GET/v2/apps/tiers/{slug}Retrieve an App Tier
GET/v2/apps/{app_id}/alertsList all app alerts
POST/v2/apps/{app_id}/alerts/{alert_id}/destinationsUpdate destinations for alerts
GET/v2/apps/{app_id}/components/{component_name}/logsRetrieve Active Deployment Logs
GET/v2/apps/{app_id}/deploymentsList App Deployments
POST/v2/apps/{app_id}/deploymentsCreate an App Deployment
GET/v2/apps/{app_id}/deployments/{deployment_id}Retrieve an App Deployment
POST/v2/apps/{app_id}/deployments/{deployment_id}/cancelCancel a Deployment
GET/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/logsRetrieve Deployment Logs
GET/v2/apps/{app_id}/deployments/{deployment_id}/logsRetrieve Aggregate Deployment Logs
GET/v2/apps/{app_id}/logsRetrieve Active Deployment Aggregate Logs
GET/v2/apps/{app_id}/metrics/bandwidth_dailyRetrieve App Daily Bandwidth Metrics
POST/v2/apps/{app_id}/rollbackRollback App
POST/v2/apps/{app_id}/rollback/commitCommit App Rollback
POST/v2/apps/{app_id}/rollback/revertRevert App Rollback
POST/v2/apps/{app_id}/rollback/validateValidate App Rollback
GET/v2/apps/{id}Retrieve an Existing App
PUT/v2/apps/{id}Update an App
DELETE/v2/apps/{id}Delete an App
GET/v2/cdn/endpointsList All CDN Endpoints
POST/v2/cdn/endpointsCreate a New CDN Endpoint
GET/v2/cdn/endpoints/{cdn_id}Retrieve an Existing CDN Endpoint
PUT/v2/cdn/endpoints/{cdn_id}Update a CDN Endpoint
DELETE/v2/cdn/endpoints/{cdn_id}Delete a CDN Endpoint
DELETE/v2/cdn/endpoints/{cdn_id}/cachePurge the Cache for an Existing CDN Endpoint
GET/v2/certificatesList All Certificates
POST/v2/certificatesCreate a New Certificate
GET/v2/certificates/{certificate_id}Retrieve an Existing Certificate
DELETE/v2/certificates/{certificate_id}Delete a Certificate
GET/v2/customers/my/balanceGet Customer Balance
GET/v2/customers/my/billing_historyList Billing History
GET/v2/customers/my/invoicesList All Invoices
GET/v2/customers/my/invoices/{invoice_uuid}Retrieve an Invoice by UUID
GET/v2/customers/my/invoices/{invoice_uuid}/csvRetrieve an Invoice CSV by UUID
GET/v2/customers/my/invoices/{invoice_uuid}/pdfRetrieve an Invoice PDF by UUID
GET/v2/customers/my/invoices/{invoice_uuid}/summaryRetrieve an Invoice Summary by UUID
GET/v2/databasesList All Database Clusters
POST/v2/databasesCreate a New Database Cluster
GET/v2/databases/optionsList Database Options
GET/v2/databases/{database_cluster_uuid}Retrieve an Existing Database Cluster
DELETE/v2/databases/{database_cluster_uuid}Destroy a Database Cluster
GET/v2/databases/{database_cluster_uuid}/backupsList Backups for a Database Cluster
GET/v2/databases/{database_cluster_uuid}/caRetrieve the Public Certificate
GET/v2/databases/{database_cluster_uuid}/configRetrieve an Existing Database Cluster Configuration
PATCH/v2/databases/{database_cluster_uuid}/configUpdate the Database Configuration for an Existing Database
GET/v2/databases/{database_cluster_uuid}/dbsList All Databases
POST/v2/databases/{database_cluster_uuid}/dbsAdd a New Database
GET/v2/databases/{database_cluster_uuid}/dbs/{database_name}Retrieve an Existing Database
DELETE/v2/databases/{database_cluster_uuid}/dbs/{database_name}Delete a Database
GET/v2/databases/{database_cluster_uuid}/eviction_policyRetrieve the Eviction Policy for a Redis Cluster
PUT/v2/databases/{database_cluster_uuid}/eviction_policyConfigure the Eviction Policy for a Redis Cluster
GET/v2/databases/{database_cluster_uuid}/firewallList Firewall Rules (Trusted Sources) for a Database Cluster
PUT/v2/databases/{database_cluster_uuid}/firewallUpdate Firewall Rules (Trusted Sources) for a Database
PUT/v2/databases/{database_cluster_uuid}/maintenanceConfigure a Database Cluster's Maintenance Window
PUT/v2/databases/{database_cluster_uuid}/migrateMigrate a Database Cluster to a New Region
GET/v2/databases/{database_cluster_uuid}/online-migrationRetrieve the Status of an Online Migration
PUT/v2/databases/{database_cluster_uuid}/online-migrationStart an Online Migration
DELETE/v2/databases/{database_cluster_uuid}/online-migration/{migration_id}Stop an Online Migration
GET/v2/databases/{database_cluster_uuid}/poolsList Connection Pools (PostgreSQL)
POST/v2/databases/{database_cluster_uuid}/poolsAdd a New Connection Pool (PostgreSQL)
GET/v2/databases/{database_cluster_uuid}/pools/{pool_name}Retrieve Existing Connection Pool (PostgreSQL)
PUT/v2/databases/{database_cluster_uuid}/pools/{pool_name}Update Connection Pools (PostgreSQL)
DELETE/v2/databases/{database_cluster_uuid}/pools/{pool_name}Delete a Connection Pool (PostgreSQL)
GET/v2/databases/{database_cluster_uuid}/replicasList All Read-only Replicas
POST/v2/databases/{database_cluster_uuid}/replicasCreate a Read-only Replica
GET/v2/databases/{database_cluster_uuid}/replicas/{replica_name}Retrieve an Existing Read-only Replica
DELETE/v2/databases/{database_cluster_uuid}/replicas/{replica_name}Destroy a Read-only Replica
PUT/v2/databases/{database_cluster_uuid}/replicas/{replica_name}/promotePromote a Read-only Replica to become a Primary Cluster
PUT/v2/databases/{database_cluster_uuid}/resizeResize a Database Cluster
GET/v2/databases/{database_cluster_uuid}/sql_modeRetrieve the SQL Modes for a MySQL Cluster
PUT/v2/databases/{database_cluster_uuid}/sql_modeUpdate SQL Mode for a Cluster
PUT/v2/databases/{database_cluster_uuid}/upgradeUpgrade Major Version for a Database
GET/v2/databases/{database_cluster_uuid}/usersList all Database Users
POST/v2/databases/{database_cluster_uuid}/usersAdd a Database User
GET/v2/databases/{database_cluster_uuid}/users/{username}Retrieve an Existing Database User
DELETE/v2/databases/{database_cluster_uuid}/users/{username}Remove a Database User
POST/v2/databases/{database_cluster_uuid}/users/{username}/reset_authReset a Database User's Password or Authentication Method
GET/v2/domainsList All Domains
POST/v2/domainsCreate a New Domain
GET/v2/domains/{domain_name}Retrieve an Existing Domain
DELETE/v2/domains/{domain_name}Delete a Domain
GET/v2/domains/{domain_name}/recordsList All Domain Records

Showing the first 100 of 290 endpoints; the full list is in the documentation.

Questions

Does the DigitalOcean API API need an API key?

Yes. The DigitalOcean API API uses Bearer token authentication; the documentation explains how to get credentials.

Does the DigitalOcean API API support HTTPS?

Yes, the DigitalOcean API API is served over HTTPS.

How many endpoints does the DigitalOcean API API have?

Its OpenAPI description lists 290 endpoints in version 2.0. The first 100 are shown on this page.

What are alternatives to the DigitalOcean API API?

Other Cloud Platforms APIs include Remote Settings PROD, Linode API, Vercel API, Platform API, Azure Data Lake Storage.

Compare alternatives →

Remote Settings PROD

Cloud Platforms

Firefox is a free web browser backed by Mozilla, a non-profit dedicated to internet health and privacy.

No auth19 endpoints

Linode API

Cloud Platforms

## Introduction The Linode API provides the ability to programmatically manage the full range of Linode products and services. This reference is designed to assist application developers and system administrators. Each endpoint includes descriptions, request syntax, and examples using standard HTTP requests. Response data is returned in JSON format. This document was generated from our OpenAPI Specification. See the <a target="_top" href="https://www.openapis.org">OpenAPI website</a> for more information. <a target="_top" href="/docs/api/openapi.yaml">Download the Linode OpenAPI Specification</a>. ## Changelog <a target="_top" href="/docs/products/tools/api/release-notes/">View our Changelog</a> to see release notes on all changes made to our API. ## Access and Authentication Some endpoints are publicly accessible without requiring authentication. All endpoints affecting your Account, however, require either a Personal Access Token or OAuth authentication (when using third-party applications). ### Personal Access Token The easiest way to access the API is with a Personal Access Token (PAT) generated from the <a target="_top" href="https://cloud.linode.com/profile/tokens">Linode Cloud Manager</a> or the [Create Personal Access Token](/docs/api/profile/#personal-access-token-create) endpoint. All scopes for the OAuth security model ([defined below](/docs/api/profile/#oauth)) apply to this security model as well. #### Authentication | Security Scheme Type: | HTTP | |-----------------------|------| | **HTTP Authorization Scheme** | bearer | ### OAuth If you only need to access the Linode API for personal use, we recommend that you create a [personal access token](/docs/api/#personal-access-token). If you're designing an application that can authenticate with an arbitrary Linode user, then you should use the OAuth 2.0 workflows presented in this section. For a more detailed example of an OAuth 2.0 implementation, see our guide on [How to Create an OAuth App with the Linode Python API Library](/docs/products/tools/api/guides/create-an-oauth-app-with-the-python-api-library/#oauth-2-authentication-exchange). Before you implement OAuth in your application, you first need to create an OAuth client. You can do this [with the Linode API](/docs/api/account/#oauth-client-create) or [via the Cloud Manager](https://cloud.linode.com/profile/clients): - When creating the client, you'll supply a `label` and a `redirect_uri` (referred to as the Callback URL in the Cloud Manager). - The response from this endpoint will give you a `client_id` and a `secret`. - Clients can be public or private, and are private by default. You can choose to make the client public when it is created. - A private client is used with applications which can securely store the client secret (that is, the secret returned to you when you first created the client). For example, an application running on a secured server that only the developer has access to would use a private OAuth client. This is also called a confidential client in some OAuth documentation. - A public client is used with applications where the client secret is not guaranteed to be secure. For example, a native app running on a user's computer may not be able to keep the client secret safe, as a user could potentially inspect the source of the application. So, native apps or apps that run in a user's browser should use a public client. - Public and private clients follow different workflows, as described below. #### OAuth Workflow The OAuth workflow is a series of exchanges between your third-party app and Linode. The workflow is used to authenticate a user before an application can start making API calls on the user's behalf. Notes: - With respect to the diagram in [section 1.2 of RFC 6749](https://tools.ietf.org/html/rfc6749#section-1.2), login.linode.com (referred to in this section as the *login server*) is the Resource Owner and the Authorization Server; api.linode.com (referred to here as the *api se

Bearer token350 endpoints

Vercel API

Cloud Platforms

Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.

Bearer token112 endpoints

Platform API

Cloud Platforms

The [REST API specification](https://www.ably.io/documentation/rest-api) for Ably.

HTTP Basic22 endpoints

Azure Data Lake Storage

Cloud Platforms

Azure Data Lake Storage provides storage for Hadoop and other big data workloads.

No auth10 endpoints

Control API v1

Cloud Platforms

Use the Control API to manage your applications, namespaces, keys, queues, rules, and more. Detailed information on using this API can be found in the Ably <a href="https://ably.com/documentation/control-api">developer documentation</a>. Control API is currently in Beta.

Bearer token22 endpoints

Listed from APIs.guru (CC0).