App Platform API Reference
Validated on 16 Jun 2022 • Last edited on 23 Mar 2026
App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
Most API operations are centered around a few core object types. Following are the definitions of these types. These definitions will be omitted from the operation-specific documentation.
For documentation on app specifications (AppSpec objects), please refer to the
product documentation).
https://api.digitalocean.com
Endpoints
GET List All Apps
/v2/apps
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List 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.
Query Parameters
page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1per_page
1 – 200 optional
2Number of items returned per page
Default:20with_projects
optional
trueWhether the project_id of listed apps should be fetched and included.
Request: /v2/apps
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list()Responses
200
A JSON object with a apps key. This is list of object apps.
apps key. This is list of object apps.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
apps
optional
Show child properties
active_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405created_at
optional read-only
2020-11-19T20:27:18Zdedicated_ips
optional read-only
Show child properties
id
optional
9e7bc2ac-205a-45d6-919c-e1ac5e73f962ip
optional
192.168.1.1status
optional read-only
ASSIGNEDdefault_ingress
optional read-only
digitalocean.comdomains
optional read-only
Show child properties
certificate_expires_at
optional read-only
2024-01-29T23:59:59Zid
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfphase
optional
ACTIVEprogress
optional
Show child properties
steps
optional
rotate_validation_records
optional read-only
spec
optional
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
validations
optional
Show child properties
txt_name
optional read-only
_acme-challenge.app.example.comtxt_value
optional read-only
lXLOcN6cPv0nproViNcUHcahD9TrIPlNgdwesj0pYpkid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfin_progress_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405last_deployment_created_at
optional read-only
2020-11-19T20:27:18Zlive_domain
optional read-only
live_domainlive_url
optional read-only
google.comlive_url_base
optional read-only
digitalocean.comowner_uuid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfpending_deployment
optional
pinned_deployment
optional
project_id
optional read-only
88b72d1a-b78a-4d9f-9090-b53c4399073fRequires project:read scope.
region
optional
Show child properties
continent
optional read-only
europedata_centers
optional read-only
["ams"]default
optional read-only
trueWhether or not the region is presented as the default.
disabled
optional read-only
trueflag
optional read-only
amslabel
optional read-only
amsreason
optional read-only
to crowdedslug
optional read-only
basicspec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
tier_slug
optional read-only
basicupdated_at
optional read-only
2020-12-01T00:42:16Zvpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427aclinks
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
meta
required
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"apps": [
{
"active_deployment": {
"created_at": "2020-12-01T00:40:05Z",
"id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"phase_last_updated_at": "2020-12-01T00:42:12Z",
"services": [
{
"name": "sample-php",
"source_commit_hash": "54d4a727f457231062439895000d45437c7bb405"
}
],
"spec": {
"domains": [
{
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
],
"name": "sample-php",
"region": "fra",
"services": [
{
"environment_slug": "php",
"git": {
"branch": "main",
"repo_clone_url": "https://github.com/digitalocean/sample-php.git"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "sample-php",
"routes": [
{
"path": "/"
}
],
"run_command": "heroku-php-apache2"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"updated_at": "2020-12-01T00:42:12Z"
},
"cause": "app spec updated",
"created_at": "2020-11-19T20:27:18Z",
"dedicated_ips": [
{
"id": "c24d8f48-3bc4-49f5-8ca0-58e8164427ac",
"ip": "192.168.1.1",
"status": "ASSIGNED"
},
{
"id": "4768fb15-2837-4dda-9be5-3951df4bc3d0",
"ip": "192.168.1.2",
"status": "ASSIGNED"
}
],
"default_ingress": "https://sample-php-iaj87.ondigitalocean.app",
"domains": [
{
"certificate_expires_at": "2024-01-29T23:59:59Z",
"id": "0831f444-a1a7-11ed-828c-ef59494480b5",
"phase": "ACTIVE",
"progress": {
"steps": [
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "default-ingress-ready",
"started_at": "2023-01-30T22:15:45.021896292Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-zone",
"started_at": "2023-01-30T22:15:45.022017004Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:42:28.50752065Z",
"name": "ensure-ns-records",
"started_at": "2023-01-30T22:15:45.025567874Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-nameservers",
"started_at": "2023-01-30T22:15:45.033591906Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-record",
"started_at": "2023-01-30T22:15:45.156750604Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258626422Z",
"name": "ensure-alias-record",
"started_at": "2023-01-30T22:15:45.165933869Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258808279Z",
"name": "ensure-wildcard-record",
"started_at": "2023-01-30T22:15:45.166093422Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-cname",
"started_at": "2023-01-30T22:15:45.166205559Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.475903785Z",
"name": "ensure-ssl-txt-record-saved",
"started_at": "2023-01-30T22:15:45.295237186Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476017236Z",
"name": "ensure-ssl-txt-record",
"started_at": "2023-01-30T22:15:45.295315291Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476094058Z",
"name": "ensure-renewal-email",
"started_at": "2023-01-30T22:15:45.295374087Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-CA-authorization",
"started_at": "2023-01-30T22:15:45.295428101Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-certificate",
"started_at": "2023-01-30T22:15:45.978756406Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:52.570612857Z",
"name": "create-deployment",
"started_at": "0001-01-01T00:00:00Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:31.333582377Z",
"name": "configuration-alert",
"started_at": "2023-01-30T22:15:46.278987808Z",
"status": "SUCCESS"
}
]
},
"rotate_validation_records": false,
"spec": {
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
}
],
"id": "4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf",
"last_deployment_created_at": "2020-12-01T00:40:05Z",
"live_domain": "sample-php.example.com",
"live_url": "https://sample-php.example.com",
"live_url_base": "https://sample-php.example.com",
"owner_uuid": "ff36cbc6fd350fe12577f5123133bb5ba01a2419",
"pending_deployment": {
"created_at": "2020-12-01T00:40:05Z",
"id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"phase_last_updated_at": "2020-12-01T00:42:12Z",
"services": [
{
"name": "sample-php",
"source_commit_hash": "54d4a727f457231062439895000d45437c7bb405"
}
],
"spec": {
"domains": [
{
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
],
"name": "sample-php",
"region": "fra",
"services": [
{
"environment_slug": "php",
"git": {
"branch": "main",
"repo_clone_url": "https://github.com/digitalocean/sample-php.git"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "sample-php",
"routes": [
{
"path": "/"
}
],
"run_command": "heroku-php-apache2"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"updated_at": "2020-12-01T00:42:12Z"
},
"progress": {
"phase": "ACTIVE",
"steps": [
{
"ended_at": "2020-12-01T00:41:26.653989756Z",
"name": "build",
"started_at": "2020-12-01T00:40:11.979257919Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2020-12-01T00:40:12.470972033Z",
"name": "initialize",
"started_at": "2020-12-01T00:40:11.979305214Z",
"status": "SUCCESS"
},
{
"ended_at": "2020-12-01T00:41:26.180360487Z",
"name": "components",
"started_at": "2020-12-01T00:40:12.470996857Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "sample-php",
"ended_at": "0001-01-01T00:00:00Z",
"message_base": "Building service",
"name": "sample-php",
"started_at": "0001-01-01T00:00:00Z",
"status": "SUCCESS"
}
]
}
]
}
],
"success_steps": 6,
"tier_slug": "basic",
"total_steps": 6
},
"region": {
"continent": "Europe",
"data_centers": [
"fra1"
],
"flag": "germany",
"label": "Frankfurt",
"slug": "fra"
},
"spec": {
"domains": [
{
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
],
"name": "sample-php",
"services": [
{
"environment_slug": "php",
"git": {
"branch": "main",
"repo_clone_url": "https://github.com/digitalocean/sample-php.git"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "sample-php",
"routes": [
{
"path": "/"
}
],
"run_command": "heroku-php-apache2"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2020-12-01T00:42:16Z",
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
],
"links": {
"pages": {}
},
"meta": {
"total": 1
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Create a New App
/v2/apps
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Create a new app by submitting an app specification. For documentation on app specifications (AppSpec objects), please refer to the product documentation.
Header Parameters
Accept
optional
application/jsonThe content-type that should be used by the response. By default, the response will be application/json. application/yaml is also supported.
Content-Type
optional
application/jsonThe content-type used for the request. By default, the requests are assumed to use application/json. application/yaml is also supported.
Request Body: application/json
project_id
optional
The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project.
Requires project:update scope.
spec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
Show child properties
disabled
optional
falseIs the alert disabled?
operator
optional
GREATER_THANrule
optional
CPU_UTILIZATIONvalue
optional
2.32Threshold value for alert
window
optional
FIVE_MINUTESbitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
cors
optional
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
Show child properties
component
optional
The component to route to. Only one of component or redirect may be set.
cors
optional
match
optional
The match configuration for the rule.
redirect
optional
The redirect configuration for the rule. Only one of component or redirect may be set.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
Show child properties
failure_threshold
optional
2The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
60The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port.
success_threshold
optional
3The number of successful health checks before considered healthy.
timeout_seconds
optional
45The number of seconds after which the check times out.
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
termination
optional
Show child properties
drain_seconds
optional
15The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15)
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
vpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
Request: /v2/apps
{
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": false,
"egress": {
"type": "DEDICATED_IP"
},
"enhanced_threat_control_enabled": true,
"name": "web-app",
"region": "nyc",
"services": [
{
"environment_slug": "node-js",
"github": {
"branch": "main",
"deploy_on_push": true,
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "api",
"routes": [
{
"path": "/api"
}
],
"run_command": "bin/api"
}
],
"vpc": {
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps"
-d '{"spec":{"name":"web-app","region":"nyc", \
"services":[{"name":"api","github":{"branch":"main",\
"deploy_on_push":true,"repo":"digitalocean/sample-golang"}, \
"run_command":"bin/api","environment_slug":"node-js", \
"instance_count":2,"instance_size_slug":"apps-s-1vcpu-0.5gb", \
"routes":[{"path":"/api"}]}]}}'import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
create_resp = client.apps.create(
{
"spec": {
"name": "web-app",
"region": "nyc",
"services": [
{
"name": "api",
"github": {},
"run_command": "bin/api",
"environment_slug": "node-js",
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"routes": [],
}
],
}
}
)Responses
200
A JSON or YAML of a spec object.
spec object.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app
optional
An application's configuration and status.
Show child properties
active_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405created_at
optional read-only
2020-11-19T20:27:18Zdedicated_ips
optional read-only
Show child properties
id
optional
9e7bc2ac-205a-45d6-919c-e1ac5e73f962ip
optional
192.168.1.1status
optional read-only
ASSIGNEDdefault_ingress
optional read-only
digitalocean.comdomains
optional read-only
Show child properties
certificate_expires_at
optional read-only
2024-01-29T23:59:59Zid
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfphase
optional
ACTIVEprogress
optional
Show child properties
steps
optional
rotate_validation_records
optional read-only
spec
optional
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
validations
optional
Show child properties
txt_name
optional read-only
_acme-challenge.app.example.comtxt_value
optional read-only
lXLOcN6cPv0nproViNcUHcahD9TrIPlNgdwesj0pYpkid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfin_progress_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405last_deployment_created_at
optional read-only
2020-11-19T20:27:18Zlive_domain
optional read-only
live_domainlive_url
optional read-only
google.comlive_url_base
optional read-only
digitalocean.comowner_uuid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfpending_deployment
optional
pinned_deployment
optional
project_id
optional read-only
88b72d1a-b78a-4d9f-9090-b53c4399073fRequires project:read scope.
region
optional
Show child properties
continent
optional read-only
europedata_centers
optional read-only
["ams"]default
optional read-only
trueWhether or not the region is presented as the default.
disabled
optional read-only
trueflag
optional read-only
amslabel
optional read-only
amsreason
optional read-only
to crowdedslug
optional read-only
basicspec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
tier_slug
optional read-only
basicupdated_at
optional read-only
2020-12-01T00:42:16Zvpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427ac
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"app": {
"active_deployment": {
"cause": "manual",
"created_at": "2021-02-10T17:05:30Z",
"id": "991dfa59-6a23-459f-86d6-67dfa2c6f1e3",
"phase": "ACTIVE",
"phase_last_updated_at": "2021-02-10T17:06:53Z",
"progress": {
"steps": [
{
"ended_at": "2021-02-10T17:06:19.807834070Z",
"name": "build",
"started_at": "2021-02-10T17:05:35.572287990Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2021-02-10T17:05:36.093995229Z",
"name": "initialize",
"started_at": "2021-02-10T17:05:35.572347485Z",
"status": "SUCCESS"
},
{
"ended_at": "2021-02-10T17:06:19.461737040Z",
"name": "components",
"started_at": "2021-02-10T17:05:36.094015928Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "SUCCESS"
}
]
}
]
},
{
"ended_at": "2021-02-10T17:06:53.404104185Z",
"name": "deploy",
"started_at": "2021-02-10T17:06:25.143932418Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2021-02-10T17:06:26.120343872Z",
"name": "initialize",
"started_at": "2021-02-10T17:06:25.143957508Z",
"status": "SUCCESS"
},
{
"ended_at": "2021-02-10T17:06:50.029695913Z",
"name": "components",
"started_at": "2021-02-10T17:06:26.120385561Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "SUCCESS"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "SUCCESS"
}
]
}
]
},
{
"ended_at": "2021-02-10T17:06:53.404065961Z",
"name": "finalize",
"started_at": "2021-02-10T17:06:50.348459495Z",
"status": "SUCCESS"
}
]
}
],
"success_steps": 6,
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "db6936cb46047c576962962eed81ad52c21f35d7"
}
],
"spec": {
"domains": [
{
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"zone": "example.com"
}
],
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "main",
"repo": "ChiefMateStarbuck/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2021-02-10T17:06:53Z"
},
"created_at": "2021-02-10T16:45:14Z",
"dedicated_ips": [
{
"id": "c24d8f48-3bc4-49f5-8ca0-58e8164427ac",
"ip": "192.168.1.1",
"status": "ASSIGNED"
},
{
"id": "4768fb15-2837-4dda-9be5-3951df4bc3d0",
"ip": "192.168.1.2",
"status": "ASSIGNED"
}
],
"default_ingress": "https://sample-golang-zyhgn.ondigitalocean.app",
"domains": [
{
"certificate_expires_at": "2024-01-29T23:59:59Z",
"id": "e206c64e-a1a3-11ed-9e6e-9b7b6dc9a52b",
"phase": "CONFIGURING",
"progress": {
"steps": [
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "default-ingress-ready",
"started_at": "2023-01-30T22:15:45.021896292Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-zone",
"started_at": "2023-01-30T22:15:45.022017004Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:42:28.50752065Z",
"name": "ensure-ns-records",
"started_at": "2023-01-30T22:15:45.025567874Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-nameservers",
"started_at": "2023-01-30T22:15:45.033591906Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-record",
"started_at": "2023-01-30T22:15:45.156750604Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258626422Z",
"name": "ensure-alias-record",
"started_at": "2023-01-30T22:15:45.165933869Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258808279Z",
"name": "ensure-wildcard-record",
"started_at": "2023-01-30T22:15:45.166093422Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-cname",
"started_at": "2023-01-30T22:15:45.166205559Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.475903785Z",
"name": "ensure-ssl-txt-record-saved",
"started_at": "2023-01-30T22:15:45.295237186Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476017236Z",
"name": "ensure-ssl-txt-record",
"started_at": "2023-01-30T22:15:45.295315291Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476094058Z",
"name": "ensure-renewal-email",
"started_at": "2023-01-30T22:15:45.295374087Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-CA-authorization",
"started_at": "2023-01-30T22:15:45.295428101Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-certificate",
"started_at": "2023-01-30T22:15:45.978756406Z",
"status": "RUNNING"
},
{
"ended_at": "0001-01-01T00:00:00",
"name": "create-deployment",
"started_at": "0001-01-01T00:00:00Z",
"status": "PENDING"
},
{
"ended_at": "0001-01-01T00:00:00",
"name": "configuration-alert",
"started_at": "0001-01-01T00:00:00",
"status": "PENDING"
}
]
},
"rotate_validation_records": false,
"spec": {
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
}
],
"id": "c2a93513-8d9b-4223-9d61-5e7272c81cf5",
"last_deployment_created_at": "2021-02-10T17:05:30Z",
"live_domain": "sample-golang-zyhgn.ondigitalocean.app",
"live_url": "https://sample-golang-zyhgn.ondigitalocean.app",
"live_url_base": "https://sample-golang-zyhgn.ondigitalocean.app",
"owner_uuid": "a4e16f25-cdd1-4483-b246-d77f283c9209",
"pending_deployment": {
"id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"spec": {
"domains": [
{
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
],
"name": "sample-php",
"region": "fra",
"services": [
{
"environment_slug": "php",
"git": {
"branch": "main",
"repo_clone_url": "https://github.com/digitalocean/sample-php.git"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "sample-php",
"routes": [
{
"path": "/"
}
],
"run_command": "heroku-php-apache2"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
},
"project_id": "88b72d1a-b78a-4d9f-9090-b53c4399073f",
"region": {
"continent": "Europe",
"data_centers": [
"ams3"
],
"flag": "netherlands",
"label": "Amsterdam",
"slug": "ams"
},
"spec": {
"disable_edge_cache": true,
"domains": [
{
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"zone": "example.com"
}
],
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "main",
"repo": "ChiefMateStarbuck/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2021-02-10T17:06:56Z",
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Retrieve Multiple Apps' Daily Bandwidth Metrics
/v2/apps/metrics/bandwidth_daily
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve daily bandwidth usage metrics for multiple apps.
Request Body: application/json
app_ids
required
["4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf","c2a93513-8d9b-4223-9d61-5e7272c81cf5"]A list of app IDs to query bandwidth metrics for.
date
optional
2023-01-17T00:00:00ZOptional day to query. Only the date component of the timestamp will be considered. Default: yesterday.
Request: /v2/apps/metrics/bandwidth_daily
{
"app_ids": [
"4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf",
"c2a93513-8d9b-4223-9d61-5e7272c81cf5"
],
"date": "2023-01-17T00:00:00Z"
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/metrics/bandwidth_daily" \
-d '{ "app_ids": ["4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf"] }'import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"app_ids": [
"4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf",
"c2a93513-8d9b-4223-9d61-5e7272c81cf5",
],
"date": "2023-01-17T00:00:00Z",
}
get_resp = client.apps.list_metrics_bandwidth_daily(body=req)Responses
200
A JSON object with a app_bandwidth_usage key
app_bandwidth_usage keyratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app_bandwidth_usage
optional
A list of bandwidth usage details by app.
Show child properties
app_id
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe ID of the app.
bandwidth_bytes
optional
513668The used bandwidth amount in bytes.
date
optional
2023-01-17T00:00:00ZThe date for the metrics data.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"app_bandwidth_usage": [
{
"app_id": "4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf",
"bandwidth_bytes": "513668"
},
{
"app_id": "c2a93513-8d9b-4223-9d61-5e7272c81cf5",
"bandwidth_bytes": "254847"
}
],
"date": "2023-01-17T00:00:00Z"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Propose an App Spec
/v2/apps/propose
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To propose and validate a spec for a new or existing app, send a POST request to the /v2/apps/propose endpoint. 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.
Request Body: application/json
app_id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84An optional ID of an existing app. If set, the spec will be treated as a proposed update to the specified app. The existing app is not modified using this method.
spec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
Show child properties
disabled
optional
falseIs the alert disabled?
operator
optional
GREATER_THANrule
optional
CPU_UTILIZATIONvalue
optional
2.32Threshold value for alert
window
optional
FIVE_MINUTESbitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
cors
optional
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
Show child properties
component
optional
The component to route to. Only one of component or redirect may be set.
cors
optional
match
optional
The match configuration for the rule.
redirect
optional
The redirect configuration for the rule. Only one of component or redirect may be set.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
Show child properties
failure_threshold
optional
2The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
60The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port.
success_threshold
optional
3The number of successful health checks before considered healthy.
timeout_seconds
optional
45The number of seconds after which the check times out.
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
termination
optional
Show child properties
drain_seconds
optional
15The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15)
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
vpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
Request: /v2/apps/propose
{
"app_id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"spec": {
"name": "web-app",
"region": "nyc",
"services": [
{
"environment_slug": "node-js",
"github": {
"branch": "main",
"deploy_on_push": true,
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "api",
"routes": [
{
"path": "/api"
}
],
"run_command": "bin/api"
}
]
}
}curl -X POST \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"app_id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"spec": {
"name": "web-app",
"region": "nyc",
"services": [
{
"environment_slug": "node-js",
"github": {
"branch": "main",
"deploy_on_push": true,
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "api",
"routes": [
{
"path": "/api"
}
],
"run_command": "bin/api"
}
]
}
}' \
"https://api.digitalocean.com/v2/apps/propose"Responses
200
A JSON object.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app_cost
optional
5The monthly cost of the proposed app in USD.
app_is_static
optional
trueIndicates whether the app is a static app.
app_name_available
optional
trueIndicates whether the app name is available.
app_name_suggestion
optional
newNameThe suggested name if the proposed app name is unavailable.
app_tier_downgrade_cost
optional Deprecated
17The monthly cost of the proposed app in USD using the previous pricing plan tier. For example, if you propose an app that uses the Professional tier, the app_tier_downgrade_cost field displays the monthly cost of the app if it were to use the Basic tier. If the proposed app already uses the lest expensive tier, the field is empty.
existing_static_apps
optional
2The maximum number of free static apps the account can have. We will charge you for any additional static apps.
spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
Show child properties
disabled
optional
falseIs the alert disabled?
operator
optional
GREATER_THANrule
optional
CPU_UTILIZATIONvalue
optional
2.32Threshold value for alert
window
optional
FIVE_MINUTESbitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
cors
optional
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
Show child properties
component
optional
The component to route to. Only one of component or redirect may be set.
cors
optional
match
optional
The match configuration for the rule.
redirect
optional
The redirect configuration for the rule. Only one of component or redirect may be set.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
Show child properties
failure_threshold
optional
2The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
60The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port.
success_threshold
optional
3The number of successful health checks before considered healthy.
timeout_seconds
optional
45The number of seconds after which the check times out.
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
termination
optional
Show child properties
drain_seconds
optional
15The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15)
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
vpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"app_cost": 5,
"app_name_available": true,
"existing_static_apps": "2",
"max_free_static_apps": "3",
"spec": {
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List App Regions
/v2/apps/regions
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List all regions supported by App Platform.
Request: /v2/apps/regions
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/regions"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list_regions()Responses
200
A JSON object with key regions
regionsratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
regions
optional
Show child properties
continent
optional read-only
europedata_centers
optional read-only
["ams"]default
optional read-only
trueWhether or not the region is presented as the default.
disabled
optional read-only
trueflag
optional read-only
amslabel
optional read-only
amsreason
optional read-only
to crowdedslug
optional read-only
basic
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"regions": [
{
"continent": "Europe",
"data_centers": [
"ams3"
],
"flag": "netherlands",
"label": "Amsterdam",
"slug": "ams"
},
{
"continent": "North America",
"data_centers": [
"nyc1",
"nyc3"
],
"default": true,
"flag": "usa",
"label": "New York",
"slug": "nyc"
},
{
"continent": "Europe",
"data_centers": [
"fra1"
],
"flag": "germany",
"label": "Frankfurt",
"slug": "fra"
},
{
"continent": "North America",
"data_centers": [
"sfo3"
],
"flag": "usa",
"label": "San Francisco",
"slug": "sfo"
},
{
"continent": "Asia",
"data_centers": [
"sgp1"
],
"flag": "singapore",
"label": "Singapore",
"slug": "sgp"
},
{
"continent": "Asia",
"data_centers": [
"blr1"
],
"flag": "india",
"label": "Bangalore",
"slug": "blr"
},
{
"continent": "North America",
"data_centers": [
"tor1"
],
"flag": "canada",
"label": "Toronto",
"slug": "tor"
},
{
"continent": "Europe",
"data_centers": [
"lon1"
],
"flag": "uk",
"label": "London",
"slug": "lon"
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List Instance Sizes
/v2/apps/tiers/instance_sizes
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List all instance sizes for service, worker, and job components.
Request: /v2/apps/tiers/instance_sizes
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/tiers/instance_sizes"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list_instance_sizes()Responses
200
A JSON with key instance_sizes
instance_sizesratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
discount_percent
optional
2.32instance_sizes
optional
Show child properties
bandwidth_allowance_gib
optional
1cpu_type
optional
SHAREDcpus
optional
3deprecation_intent
optional
truememory_bytes
optional
1048name
optional
namescalable
optional
falsesingle_instance_only
optional
trueslug
optional
apps-s-1vcpu-1gbtier_downgrade_to
optional Deprecated
basictier_slug
optional
basictier_upgrade_to
optional Deprecated
basicusd_per_month
optional
23usd_per_second
optional
0.00000001232
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"instance_sizes": [
{
"bandwidth_allowance_gib": "50",
"cpu_type": "SHARED",
"cpus": "1",
"memory_bytes": "536870912",
"name": "Shared 1VCPU 0.5GB",
"single_instance_only": true,
"slug": "apps-s-1vcpu-0.5gb",
"tier_slug": "basic",
"usd_per_month": "5.00",
"usd_per_second": "0.000002066799"
},
{
"bandwidth_allowance_gib": "100",
"cpu_type": "SHARED",
"cpus": "1",
"memory_bytes": "1073741824",
"name": "Shared 1VCPU 1GB Fixed",
"single_instance_only": true,
"slug": "apps-s-1vcpu-1gb-fixed",
"tier_slug": "basic",
"usd_per_month": "10.00",
"usd_per_second": "0.000004133598"
},
{
"bandwidth_allowance_gib": "150",
"cpu_type": "SHARED",
"cpus": "1",
"memory_bytes": "1073741824",
"name": "Shared 1VCPU 1GB",
"slug": "apps-s-1vcpu-1gb",
"tier_slug": "professional",
"usd_per_month": "12.00",
"usd_per_second": "0.000004960317"
},
{
"bandwidth_allowance_gib": "200",
"cpu_type": "SHARED",
"cpus": "1",
"memory_bytes": "2147483648",
"name": "Shared 1VCPU 2GB",
"slug": "apps-s-1vcpu-2gb",
"tier_slug": "professional",
"usd_per_month": "25.00",
"usd_per_second": "0.000010333995"
},
{
"bandwidth_allowance_gib": "250",
"cpu_type": "SHARED",
"cpus": "2",
"memory_bytes": "4294967296",
"name": "Shared 2VCPU 4GB",
"slug": "apps-s-2vcpu-4gb",
"tier_slug": "professional",
"usd_per_month": "50.00",
"usd_per_second": "0.000020667989"
},
{
"bandwidth_allowance_gib": "100",
"cpu_type": "DEDICATED",
"cpus": "1",
"memory_bytes": "536870912",
"name": "Dedicated 1VCPU 0.5GB",
"scalable": true,
"slug": "apps-d-1vcpu-0.5gb",
"tier_slug": "professional",
"usd_per_month": "29.00",
"usd_per_second": "0.000011987434"
},
{
"bandwidth_allowance_gib": "200",
"cpu_type": "DEDICATED",
"cpus": "1",
"memory_bytes": "1073741824",
"name": "Dedicated 1VCPU 1GB",
"scalable": true,
"slug": "apps-d-1vcpu-1gb",
"tier_slug": "professional",
"usd_per_month": "34.00",
"usd_per_second": "0.000014054233"
},
{
"bandwidth_allowance_gib": "300",
"cpu_type": "DEDICATED",
"cpus": "1",
"memory_bytes": "2147483648",
"name": "Dedicated 1VCPU 2GB",
"scalable": true,
"slug": "apps-d-1vcpu-2gb",
"tier_slug": "professional",
"usd_per_month": "39.00",
"usd_per_second": "0.000016121032"
},
{
"bandwidth_allowance_gib": "400",
"cpu_type": "DEDICATED",
"cpus": "1",
"memory_bytes": "4294967296",
"name": "Dedicated 1VCPU 4GB",
"scalable": true,
"slug": "apps-d-1vcpu-4gb",
"tier_slug": "professional",
"usd_per_month": "49.00",
"usd_per_second": "0.000020254630"
},
{
"bandwidth_allowance_gib": "500",
"cpu_type": "DEDICATED",
"cpus": "2",
"memory_bytes": "4294967296",
"name": "Dedicated 2VCPU 4GB",
"scalable": true,
"slug": "apps-d-2vcpu-4gb",
"tier_slug": "professional",
"usd_per_month": "78.00",
"usd_per_second": "0.000032242063"
},
{
"bandwidth_allowance_gib": "600",
"cpu_type": "DEDICATED",
"cpus": "2",
"memory_bytes": "8589934592",
"name": "Dedicated 2VCPU 8GB",
"scalable": true,
"slug": "apps-d-2vcpu-8gb",
"tier_slug": "professional",
"usd_per_month": "98.00",
"usd_per_second": "0.000040509259"
},
{
"bandwidth_allowance_gib": "700",
"cpu_type": "DEDICATED",
"cpus": "4",
"memory_bytes": "8589934592",
"name": "Dedicated 4VCPU 8GB",
"scalable": true,
"slug": "apps-d-4vcpu-8gb",
"tier_slug": "professional",
"usd_per_month": "156.00",
"usd_per_second": "0.000064484127"
},
{
"bandwidth_allowance_gib": "800",
"cpu_type": "DEDICATED",
"cpus": "4",
"memory_bytes": "17179869184",
"name": "Dedicated 4VCPU 16GB",
"scalable": true,
"slug": "apps-d-4vcpu-16gb",
"tier_slug": "professional",
"usd_per_month": "196.00",
"usd_per_second": "0.000081018519"
},
{
"bandwidth_allowance_gib": "900",
"cpu_type": "DEDICATED",
"cpus": "8",
"memory_bytes": "34359738368",
"name": "Dedicated 8VCPU 32GB",
"scalable": true,
"slug": "apps-d-8vcpu-32gb",
"tier_slug": "professional",
"usd_per_month": "392.00",
"usd_per_second": "0.000162037037"
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve an Instance Size
/v2/apps/tiers/instance_sizes/{slug}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve information about a specific instance size for service, worker, and job components.
Path Parameters
slug
required
apps-s-1vcpu-0.5gbThe slug of the instance size
Request: /v2/apps/tiers/instance_sizes/{slug}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/tiers/instance_sizes/{slug}"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_instance_size(slug="apps-s-1vcpu-0.5gb")Responses
200
A JSON with key instance_size
instance_sizeratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
instance_size
optional
Show child properties
bandwidth_allowance_gib
optional
1cpu_type
optional
SHAREDcpus
optional
3deprecation_intent
optional
truememory_bytes
optional
1048name
optional
namescalable
optional
falsesingle_instance_only
optional
trueslug
optional
apps-s-1vcpu-1gbtier_downgrade_to
optional Deprecated
basictier_slug
optional
basictier_upgrade_to
optional Deprecated
basicusd_per_month
optional
23usd_per_second
optional
0.00000001232
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"instance_size": {
"bandwidth_allowance_gib": "50",
"cpu_type": "SHARED",
"cpus": "1",
"memory_bytes": "536870912",
"name": "Shared 1VCPU 0.5GB",
"single_instance_only": true,
"slug": "apps-s-1vcpu-0.5gb",
"tier_slug": "basic",
"usd_per_month": "5.00",
"usd_per_second": "0.000002066799"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List all app alerts
/v2/apps/{app_id}/alerts
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List alerts associated to the app and any components. This includes configuration information about the alerts including emails, slack webhooks, and triggering events or conditions.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request: /v2/apps/{app_id}/alerts
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/alerts"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list_alerts(app_id="4f6c71e2")Responses
200
A JSON object with a alerts key. This is list of object alerts.
alerts key. This is list of object alerts.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alerts
optional
Show child properties
component_name
optional
backendemails
optional
["[email protected]"]id
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfphase
optional
ACTIVEprogress
optional
Show child properties
steps
optional
Show child properties
ended_at
optional
2020-11-19T20:27:18Zname
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSslack_webhooks
optional
Show child properties
channel
optional
Channel Nameurl
optional
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXXspec
optional
Show child properties
disabled
optional
falseIs the alert disabled?
operator
optional
GREATER_THANrule
optional
CPU_UTILIZATIONvalue
optional
2.32Threshold value for alert
window
optional
FIVE_MINUTES
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alerts": [
{
"emails": [
"[email protected]"
],
"id": "e552e1f9-c1b0-4e6d-8777-ad6f27767306",
"phase": "ACTIVE",
"progress": {
"steps": [
{
"ended_at": "2020-07-28T18:00:00Z",
"name": "alert-configure-insight-alert",
"started_at": "2020-07-28T18:00:00Z",
"status": "SUCCESS"
}
]
},
"spec": {
"rule": "DEPLOYMENT_FAILED"
}
},
{
"emails": [
"[email protected]"
],
"id": "b58cc9d4-0702-4ffd-ab45-4c2a8d979527",
"phase": "ACTIVE",
"progress": {
"steps": [
{
"ended_at": "2020-07-28T18:00:00Z",
"name": "alert-configure-insight-alert",
"started_at": "2020-07-28T18:00:00Z",
"status": "SUCCESS"
}
]
},
"spec": {
"operator": "GREATER_THAN",
"rule": "CPU_UTILIZATION",
"value": 85,
"window": "FIVE_MINUTES"
}
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Update destinations for alerts
/v2/apps/{app_id}/alerts/{alert_id}/destinations
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Updates the emails and slack webhook destinations for app alerts. Emails must be associated to a user with access to the app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
alert_id
required
5a624ab5-dd58-4b39-b7dd-8b7c36e8a91dThe alert ID
Request Body: application/json
emails
optional
["[email protected]"]slack_webhooks
optional
Show child properties
channel
optional
Channel Nameurl
optional
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXXRequest: /v2/apps/{app_id}/alerts/{alert_id}/destinations
{
"emails": [
"[email protected]"
],
"slack_webhooks": [
{
"channel": "Channel Name",
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}
]
}curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}/alerts/{alert_id}/destinations"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"emails": ["[email protected]"],
"slack_webhooks": [
{
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"channel": "Channel Name",
}
],
}
post_resp = client.apps.assign_alert_destinations("12345", "24556", req)Responses
200
A JSON object with an alert key. This is an object of type alert.
alert key. This is an object of type alert.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
alert
optional
Show child properties
component_name
optional
backendemails
optional
["[email protected]"]id
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfphase
optional
ACTIVEprogress
optional
Show child properties
steps
optional
Show child properties
ended_at
optional
2020-11-19T20:27:18Zname
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSslack_webhooks
optional
Show child properties
channel
optional
Channel Nameurl
optional
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXXspec
optional
Show child properties
disabled
optional
falseIs the alert disabled?
operator
optional
GREATER_THANrule
optional
CPU_UTILIZATIONvalue
optional
2.32Threshold value for alert
window
optional
FIVE_MINUTES
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"alert": {
"emails": [
"[email protected]"
],
"id": "e552e1f9-c1b0-4e6d-8777-ad6f27767306",
"phase": "ACTIVE",
"progress": {
"steps": [
{
"ended_at": "2020-07-28T18:00:00Z",
"name": "alert-configure-insight-alert",
"started_at": "2020-07-28T18:00:00Z",
"status": "SUCCESS"
}
]
},
"spec": {
"rule": "DEPLOYMENT_FAILED"
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Exec URL
/v2/apps/{app_id}/components/{component_name}/exec
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Returns a websocket URL that allows sending/receiving console input and output to a component of the active deployment if one exists.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
component_name
required
componentAn optional component name. If set, logs will be limited to this component only.
Query Parameters
instance_name
optional
go-app-d768568df-zz77dThe name of the actively running ephemeral compute instance
Request: /v2/apps/{app_id}/components/{component_name}/exec
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/components/{component_name}/exec"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_exec_active_deployment(app_id="a6adf840", component_name="component")Responses
200
A JSON object with a websocket URL that allows sending/receiving console input and output.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
url
optional
wss://exec/?token=xxxA websocket URL that allows sending/receiving console input and receiving console output.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"url": "wss://exec/?token=xxx"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Active Deployment Logs
/v2/apps/{app_id}/components/{component_name}/logs
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
component_name
required
componentAn optional component name. If set, logs will be limited to this component only.
Query Parameters
follow
optional
trueWhether the logs should follow live updates.
type
required
BUILDThe type of logs to retrieve
- BUILD: Build-time logs
- DEPLOY: Deploy-time logs
- RUN: Live run-time logs
- RUN_RESTARTED: Logs of crashed/restarted instances during runtime
- AUTOSCALE_EVENT: Logs of an autoscaling event (requires event_id)
UNSPECIFIEDpod_connection_timeout
optional
3mAn optional time duration to wait if the underlying component instance is not immediately available. Default: 3m.
Request: /v2/apps/{app_id}/components/{component_name}/logs
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/components/{component_name}/logs"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_logs_active_deployment(app_id="a6adf840", component_name="component")Responses
200
A JSON object with urls that point to archived logs
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
historic_urls
optional
live_url
optional
ws://logs/buildA URL of the real-time live logs. This URL may use either the https:// or wss:// protocols and will keep pushing live logs as they become available.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"historic_logs": [
"https://logs-example/archive/build.log"
],
"live_url": "https://logs-example/build.log",
"url": "https://logs/build.log"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List App Deployments
/v2/apps/{app_id}/deployments
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List all deployments of an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Query Parameters
page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1per_page
1 – 200 optional
2Number of items returned per page
Default:20deployment_types
optional
["MANUAL","AUTOSCALED"]Optional. Filter deployments by deployment_type
- MANUAL: manual deployment
- DEPLOY_ON_PUSH: deployment triggered by a push to the app's repository
- MAINTENANCE: deployment for maintenance purposes
- MANUAL_ROLLBACK: manual revert to a previous deployment
- AUTO_ROLLBACK: automatic revert to a previous deployment
- UPDATE_DATABASE_TRUSTED_SOURCES: update database trusted sources
- AUTOSCALED: deployment that has been autoscaled
Request: /v2/apps/{app_id}/deployments
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list_deployments(app_id="4f6c71e2")Responses
200
A JSON object with a deployments key. This will be a list of all app deployments
deployments key. This will be a list of all app deploymentsratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployments
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
meta
required
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployments": [
{
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
],
"links": {
"pages": {}
},
"meta": {
"total": 1
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Create an App Deployment
/v2/apps/{app_id}/deployments
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request Body: application/json
force_build
optional
trueRequest: /v2/apps/{app_id}/deployments
{
"force_build": true
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
create_resp = client.apps.create_deployment(app_id="b6bdf840", body={"force_build": True})Responses
200
A JSON object with a deployment key.
deployment key.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve an App Deployment
/v2/apps/{app_id}/deployments/{deployment_id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve information about an app deployment.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
deployment_id
required
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
Request: /v2/apps/{app_id}/deployments/{deployment_id}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_deployment(app_id="a6adf840", deployment_id="b6bdf840")Responses
200
A JSON of the requested deployment
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Cancel a Deployment
/v2/apps/{app_id}/deployments/{deployment_id}/cancel
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Immediately cancel an in-progress deployment.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
deployment_id
required
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
Request: /v2/apps/{app_id}/deployments/{deployment_id}/cancel
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/cancel"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
cancel_resp = client.apps.cancel_deployment("12345", "24556")Responses
200
A JSON the deployment that was just cancelled.
deployment that was just cancelled.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Exec URL for Deployment
/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/exec
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Returns a websocket URL that allows sending/receiving console input and output to a component of the specified deployment if one exists. Optionally, the instance_name parameter can be provided to retrieve the exec URL for a specific instance. Note that instances are ephemeral; therefore, we recommended to avoid making persistent changes or such scripting around them.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
deployment_id
required
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
component_name
required
componentAn optional component name. If set, logs will be limited to this component only.
Query Parameters
instance_name
optional
go-app-d768568df-zz77dThe name of the actively running ephemeral compute instance
Request: /v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/exec
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/exec"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_exec(app_id="4f6c71e2", deployment_id="3aa4d20e", component_name="component")Responses
200
A JSON object with a websocket URL that allows sending/receiving console input and output.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
url
optional
wss://exec/?token=xxxA websocket URL that allows sending/receiving console input and receiving console output.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"url": "wss://exec/?token=xxx"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Deployment Logs
/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/logs
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
deployment_id
required
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
component_name
required
componentAn optional component name. If set, logs will be limited to this component only.
Query Parameters
follow
optional
trueWhether the logs should follow live updates.
type
required
BUILDThe type of logs to retrieve
- BUILD: Build-time logs
- DEPLOY: Deploy-time logs
- RUN: Live run-time logs
- RUN_RESTARTED: Logs of crashed/restarted instances during runtime
- AUTOSCALE_EVENT: Logs of an autoscaling event (requires event_id)
UNSPECIFIEDpod_connection_timeout
optional
3mAn optional time duration to wait if the underlying component instance is not immediately available. Default: 3m.
Request: /v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/logs
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/logs"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_logs(app_id="4f6c71e2", deployment_id="3aa4d20e", component_name="component")Responses
200
A JSON object with urls that point to archived logs
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
historic_urls
optional
live_url
optional
ws://logs/buildA URL of the real-time live logs. This URL may use either the https:// or wss:// protocols and will keep pushing live logs as they become available.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"historic_logs": [
"https://logs-example/archive/build.log"
],
"live_url": "https://logs-example/build.log",
"url": "https://logs/build.log"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Aggregate Deployment Logs
/v2/apps/{app_id}/deployments/{deployment_id}/logs
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
deployment_id
required
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
Query Parameters
follow
optional
trueWhether the logs should follow live updates.
type
required
BUILDThe type of logs to retrieve
- BUILD: Build-time logs
- DEPLOY: Deploy-time logs
- RUN: Live run-time logs
- RUN_RESTARTED: Logs of crashed/restarted instances during runtime
- AUTOSCALE_EVENT: Logs of an autoscaling event (requires event_id)
UNSPECIFIEDpod_connection_timeout
optional
3mAn optional time duration to wait if the underlying component instance is not immediately available. Default: 3m.
Request: /v2/apps/{app_id}/deployments/{deployment_id}/logs
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/logs"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_logs_aggregate(app_id="b6bdf840", deployment_id="a6adf840")Responses
200
A JSON object with urls that point to archived logs
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
historic_urls
optional
live_url
optional
ws://logs/buildA URL of the real-time live logs. This URL may use either the https:// or wss:// protocols and will keep pushing live logs as they become available.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"historic_logs": [
"https://logs-example/archive/build.log"
],
"live_url": "https://logs-example/build.log",
"url": "https://logs/build.log"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List App Events
/v2/apps/{app_id}/events
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List all events for an app, including deployments and autoscaling events.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Query Parameters
page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1per_page
1 – 200 optional
2Number of items returned per page
Default:20event_types
optional
["DEPLOYMENT"]Filter events by event type.
Request: /v2/apps/{app_id}/events
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/events"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list_events(app_id="4f6c71e2")Responses
200
A JSON with key events
eventsratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
events
optional
Show child properties
autoscaling
optional
Autoscaling event details. Only present for autoscaling events.
Show child properties
components
optional
Map of component names to their scale changes
Show child properties
(additional properties)
optional
Additional properties are allowed.
phase
optional
SUCCEEDEDThe current phase of the autoscaling event
created_at
optional
2023-10-01T12:00:00Zdeployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405deployment_id
optional
c020763f-ddb7-4112-a0df-7f01c69fc00bFor deployment events, this is the same as the deployment's ID. For autoscaling events, this is the deployment that was autoscaled.
id
optional
ba32b134-569c-4c0c-ba02-8ffdb0492ecetype
optional
DEPLOYMENTThe type of event
links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"events": [
{
"created_at": "2023-10-01T12:00:00Z",
"deployment_id": "c020763f-ddb7-4112-a0df-7f01c69fc00b",
"id": "ba32b134-569c-4c0c-ba02-8ffdb0492ece",
"type": "DEPLOYMENT"
}
],
"links": {
"pages": {
"pages": {
"first": "https://api.digitalocean.com/v2/account/keys?page=1",
"prev": "https://api.digitalocean.com/v2/account/keys?page=2"
}
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Get an Event
/v2/apps/{app_id}/events/{event_id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Get a single event for an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
event_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe event ID
Request: /v2/apps/{app_id}/events/{event_id}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/events/{event_id}"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_event(app_id="4f6c71e2", event_id="3aa4d20e")Responses
200
A JSON with key event
eventratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
event
optional
Show child properties
autoscaling
optional
Autoscaling event details. Only present for autoscaling events.
Show child properties
components
optional
Map of component names to their scale changes
Show child properties
(additional properties)
optional
Additional properties are allowed.
phase
optional
SUCCEEDEDThe current phase of the autoscaling event
created_at
optional
2023-10-01T12:00:00Zdeployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405deployment_id
optional
c020763f-ddb7-4112-a0df-7f01c69fc00bFor deployment events, this is the same as the deployment's ID. For autoscaling events, this is the deployment that was autoscaled.
id
optional
ba32b134-569c-4c0c-ba02-8ffdb0492ecetype
optional
DEPLOYMENTThe type of event
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"event": {
"autoscaling": {
"phase": "SUCCEEDED"
},
"created_at": "2023-10-01T12:00:00Z",
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"cloned_from": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"created_at": "2020-07-28T18:00:00Z",
"functions": [],
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"jobs": [],
"phase": "ACTIVE",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"services": [],
"static_sites": [],
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z",
"workers": []
},
"deployment_id": "c020763f-ddb7-4112-a0df-7f01c69fc00b",
"id": "ba32b134-569c-4c0c-ba02-8ffdb0492ece",
"type": "DEPLOYMENT"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Cancel an Event
/v2/apps/{app_id}/events/{event_id}/cancel
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Cancel an in-progress autoscaling event.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
event_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe event ID
Request: /v2/apps/{app_id}/events/{event_id}/cancel
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/events/{event_id}/cancel"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.cancel_event(app_id="4f6c71e2", event_id="3aa4d20e")Responses
200
A JSON with key event
eventratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
event
optional
Show child properties
autoscaling
optional
Autoscaling event details. Only present for autoscaling events.
Show child properties
components
optional
Map of component names to their scale changes
Show child properties
(additional properties)
optional
Additional properties are allowed.
phase
optional
SUCCEEDEDThe current phase of the autoscaling event
created_at
optional
2023-10-01T12:00:00Zdeployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405deployment_id
optional
c020763f-ddb7-4112-a0df-7f01c69fc00bFor deployment events, this is the same as the deployment's ID. For autoscaling events, this is the deployment that was autoscaled.
id
optional
ba32b134-569c-4c0c-ba02-8ffdb0492ecetype
optional
DEPLOYMENTThe type of event
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"event": {
"autoscaling": {
"phase": "SUCCEEDED"
},
"created_at": "2023-10-01T12:00:00Z",
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"cloned_from": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"created_at": "2020-07-28T18:00:00Z",
"functions": [],
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"jobs": [],
"phase": "ACTIVE",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"services": [],
"static_sites": [],
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z",
"workers": []
},
"deployment_id": "c020763f-ddb7-4112-a0df-7f01c69fc00b",
"id": "ba32b134-569c-4c0c-ba02-8ffdb0492ece",
"type": "DEPLOYMENT"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Event Logs
/v2/apps/{app_id}/events/{event_id}/logs
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve the logs of an autoscaling event for an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
event_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe event ID
Query Parameters
follow
optional
trueWhether the logs should follow live updates.
type
required
BUILDThe type of logs to retrieve
- BUILD: Build-time logs
- DEPLOY: Deploy-time logs
- RUN: Live run-time logs
- RUN_RESTARTED: Logs of crashed/restarted instances during runtime
- AUTOSCALE_EVENT: Logs of an autoscaling event (requires event_id)
UNSPECIFIEDpod_connection_timeout
optional
3mAn optional time duration to wait if the underlying component instance is not immediately available. Default: 3m.
Request: /v2/apps/{app_id}/events/{event_id}/logs
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/events/{event_id}/logs?type=AUTOSCALE_EVENT"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_event_logs(app_id="4f6c71e2", event_id="3aa4d20e")Responses
200
A JSON object with urls that point to archived logs
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
historic_urls
optional
live_url
optional
ws://logs/buildA URL of the real-time live logs. This URL may use either the https:// or wss:// protocols and will keep pushing live logs as they become available.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"historic_logs": [
"https://logs-example/archive/build.log"
],
"live_url": "https://logs-example/build.log",
"url": "https://logs/build.log"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve App Health
/v2/apps/{app_id}/health
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve information like health status, cpu and memory utilization of app components.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request: /v2/apps/{app_id}/health
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}/health"Responses
200
A JSON with key app_health
app_healthratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app_health
optional
Show child properties
components
optional
Show child properties
cpu_usage_percent
optional
30memory_usage_percent
optional
25name
optional
sample_appreplicas_desired
optional
1replicas_ready
optional
1state
optional
HEALTHYfunctions_components
optional
Show child properties
functions_component_health_metrics
optional
Show child properties
metric_label
optional
activations_countmetric_value
optional
100time_window
optional
1hname
optional
sample_function
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"components": [
{
"cpu_usage_percent": 5.555,
"memory_usage_percent": 20.32,
"name": "sample-expressjs",
"replicas_desired": 1,
"replicas_ready": 2,
"state": "HEALTHY"
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve App Instances
/v2/apps/{app_id}/instances
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve the list of running instances for a given application, including instance names and component types. Please note that these instances are ephemeral and may change over time. It is recommended not to make persistent changes or develop scripts that rely on their persistence.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request: /v2/apps/{app_id}/instances
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}/instances"Responses
200
A JSON with key instances
instancesratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
instances
optional
Show child properties
component_name
optional
sample-golangName of the component, from the app spec.
component_type
optional
SERVICESupported compute component by DigitalOcean App Platform.
instance_alias
optional
sample-golang-0Readable identifier, an alias of the instance name, reference for mapping insights to instance names.
instance_name
optional
sample-golang-76b84c7fb8-6p8kqName of the instance, which is a unique identifier for the instance.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"instances": [
{
"component_name": "sample-golang",
"component_type": "SERVICE",
"instance_alias": "sample-golang-0",
"instance_name": "sample-golang-76b84c7fb8-6p8kq"
},
{
"component_name": "sample-golang",
"component_type": "SERVICE",
"instance_alias": "sample-golang-1",
"instance_name": "sample-golang-76b84c7fb8-ngvpc"
},
{
"component_name": "sample-php",
"component_type": "SERVICE",
"instance_alias": "sample-php-0",
"instance_name": "sample-php-767c6b49c4-dkgpt"
},
{
"component_name": "sample-php",
"component_type": "SERVICE",
"instance_alias": "sample-php-1",
"instance_name": "sample-php-767c6b49c4-z8dll"
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET List Job Invocations
/v2/apps/{app_id}/job-invocations
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
List all job invocations for an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Query Parameters
job_names
optional
["component1","component2"]The job names to list job invocations for.
deployment_id
optional
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1per_page
1 – 200 optional
2Number of items returned per page
Default:20Request: /v2/apps/{app_id}/job-invocations
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/job-invocations"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.list_job_invocations(app_id="4f6c71e2")Responses
200
A JSON with key job_invocations
job_invocationsratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
job_invocations
optional
Show child properties
completed_at
optional
2023-10-01T12:10:00Zcreated_at
optional
2023-10-01T12:00:00Zdeployment_id
optional
c020763f-ddb7-4112-a0df-7f01c69fc00bid
optional
ba32b134-569c-4c0c-ba02-8ffdb0492ecejob_name
optional
good-jobphase
optional
SUCCEEDEDThe phase of the job invocation
started_at
optional
2023-10-01T12:05:00Ztrigger
optional
Show child properties
manual
optional
Details about the manual trigger, if applicable
Show child properties
user
optional
The user who triggered the job
scheduled
optional
{"schedule":{"cron":"0 0 * * *","time_zone":"America/New_York"}}The schedule for the job
Show child properties
schedule
optional
type
optional
MANUALThe type of trigger that initiated the job invocation.
links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"job_invocations": [
{
"completed_at": "2025-09-11T11:04:40Z",
"created_at": "2025-09-11T11:04:05Z",
"deployment_id": "c020763f-ddb7-4112-a0df-7f01c69fc00b",
"id": "ba32b134-569c-4c0c-ba02-8ffdb0492ece",
"job_name": "good-job",
"phase": "SUCCEEDED",
"started_at": "2025-09-11T11:04:10Z",
"trigger": {
"properties": {
"scheduled": {
"properties": {
"schedule": {
"properties": {
"cron": {
"example": "*/2 * * * *",
"type": "string"
},
"time_zone": {
"example": "UTC",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": {
"type": "string"
}
},
"type": "SCHEDULE"
}
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Get Job Invocations
/v2/apps/{app_id}/job-invocations/{job_invocation_id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Get a specific job invocation for an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
job_invocation_id
required
123e4567-e89b-12d3-a456-426The ID of the job invocation to retrieve.
Query Parameters
job_name
optional
componentThe job name to list job invocations for.
Request: /v2/apps/{app_id}/job-invocations/{job_invocation_id}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/job-invocations/{job_invocation_id}"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_job_invocation(app_id="4f6c71e2", job_invocation_id="3aa4d20e")Responses
200
A JSON with key job_invocation
job_invocationratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
completed_at
optional
2023-10-01T12:10:00Zcreated_at
optional
2023-10-01T12:00:00Zdeployment_id
optional
c020763f-ddb7-4112-a0df-7f01c69fc00bid
optional
ba32b134-569c-4c0c-ba02-8ffdb0492ecejob_name
optional
good-jobphase
optional
SUCCEEDEDThe phase of the job invocation
started_at
optional
2023-10-01T12:05:00Ztrigger
optional
Show child properties
manual
optional
Details about the manual trigger, if applicable
Show child properties
user
optional
The user who triggered the job
Show child properties
email
optional
[email protected]full_name
optional
John Doeuuid
optional
550e8400-e29b-41d4-a716-446655440000scheduled
optional
{"schedule":{"cron":"0 0 * * *","time_zone":"America/New_York"}}The schedule for the job
Show child properties
schedule
optional
Show child properties
cron
optional
0 0 * * *The cron expression defining the schedule
time_zone
optional
America/New_YorkThe time zone for the schedule
type
optional
MANUALThe type of trigger that initiated the job invocation.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"job_invocation": [
{
"completed_at": "2025-09-11T11:04:40Z",
"created_at": "2025-09-11T11:04:05Z",
"deployment_id": "c020763f-ddb7-4112-a0df-7f01c69fc00b",
"id": "ba32b134-569c-4c0c-ba02-8ffdb0492ece",
"job_name": "good-job",
"phase": "SUCCEEDED",
"started_at": "2025-09-11T11:04:10Z",
"trigger": [
{
"scheduled": [
{
"schedule": {
"cron": "*/2 * * * *",
"time_zone": "UTC"
}
}
],
"type": "SCHEDULED"
}
]
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Cancel Job Invocation
/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Cancel a specific job invocation for an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
job_invocation_id
required
123e4567-e89b-12d3-a456-426The ID of the job invocation to retrieve.
Query Parameters
job_name
optional
componentThe job name to list job invocations for.
Request: /v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.cancel_job_invocation(app_id="4f6c71e2", job_invocation_id="3aa4d20e")Responses
200
A JSON with key job_invocation
job_invocationratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
completed_at
optional
2023-10-01T12:10:00Zcreated_at
optional
2023-10-01T12:00:00Zdeployment_id
optional
c020763f-ddb7-4112-a0df-7f01c69fc00bid
optional
ba32b134-569c-4c0c-ba02-8ffdb0492ecejob_name
optional
good-jobphase
optional
SUCCEEDEDThe phase of the job invocation
started_at
optional
2023-10-01T12:05:00Ztrigger
optional
Show child properties
manual
optional
Details about the manual trigger, if applicable
Show child properties
user
optional
The user who triggered the job
Show child properties
email
optional
[email protected]full_name
optional
John Doeuuid
optional
550e8400-e29b-41d4-a716-446655440000scheduled
optional
{"schedule":{"cron":"0 0 * * *","time_zone":"America/New_York"}}The schedule for the job
Show child properties
schedule
optional
Show child properties
cron
optional
0 0 * * *The cron expression defining the schedule
time_zone
optional
America/New_YorkThe time zone for the schedule
type
optional
MANUALThe type of trigger that initiated the job invocation.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"job_invocation": [
{
"completed_at": "2025-09-11T11:04:40Z",
"created_at": "2025-09-11T11:04:05Z",
"deployment_id": "c020763f-ddb7-4112-a0df-7f01c69fc00b",
"id": "ba32b134-569c-4c0c-ba02-8ffdb0492ece",
"job_name": "good-job",
"phase": "SUCCEEDED",
"started_at": "2025-09-11T11:04:10Z",
"trigger": [
{
"scheduled": [
{
"schedule": {
"cron": "*/2 * * * *",
"time_zone": "UTC"
}
}
],
"type": "SCHEDULED"
}
]
}
]
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Job Invocation Logs
/v2/apps/{app_id}/jobs/{job_name}/invocations/{job_invocation_id}/logs
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve 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. If deployment is omitted the active deployment will be selected (if available). The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
job_name
required
componentThe job name to list job invocations for.
job_invocation_id
required
123e4567-e89b-12d3-a456-426The ID of the job invocation to retrieve.
Query Parameters
deployment_id
optional
3aa4d20e-5527-4c00-b496-601fbd22520aThe deployment ID
follow
optional
trueWhether the logs should follow live updates.
type
required
JOB_INVOCATIONThe type of logs to retrieve
pod_connection_timeout
optional
3mAn optional time duration to wait if the underlying component instance is not immediately available. Default: 3m.
tail_lines
optional
100The number of lines from the end of the logs to retrieve.
Request: /v2/apps/{app_id}/jobs/{job_name}/invocations/{job_invocation_id}/logs
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/jobs/{job_name}/invocations/{job_invocation_id}/logs"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_job_invocation_logs(app_id="4f6c71e2", job_name="component", job_invocation_id="3aa4d20e")Responses
200
A JSON object with urls that point to Job Invocation logs
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
historic_urls
optional
live_url
optional
ws://logs/buildA URL of the real-time live logs. This URL may use either the https:// or wss:// protocols and will keep pushing live logs as they become available.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"historic_logs": [
"https://logs-example/archive/build.log"
],
"live_url": "https://logs-example/build.log",
"url": "https://logs/build.log"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve Active Deployment Aggregate Logs
/v2/apps/{app_id}/logs
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Query Parameters
follow
optional
trueWhether the logs should follow live updates.
type
required
BUILDThe type of logs to retrieve
- BUILD: Build-time logs
- DEPLOY: Deploy-time logs
- RUN: Live run-time logs
- RUN_RESTARTED: Logs of crashed/restarted instances during runtime
- AUTOSCALE_EVENT: Logs of an autoscaling event (requires event_id)
UNSPECIFIEDpod_connection_timeout
optional
3mAn optional time duration to wait if the underlying component instance is not immediately available. Default: 3m.
Request: /v2/apps/{app_id}/logs
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/logs"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_logs_active_deployment_aggregate(app_id="a6adf840")Responses
200
A JSON object with urls that point to archived logs
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
historic_urls
optional
live_url
optional
ws://logs/buildA URL of the real-time live logs. This URL may use either the https:// or wss:// protocols and will keep pushing live logs as they become available.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"historic_logs": [
"https://logs-example/archive/build.log"
],
"live_url": "https://logs-example/build.log",
"url": "https://logs/build.log"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve App Daily Bandwidth Metrics
/v2/apps/{app_id}/metrics/bandwidth_daily
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve daily bandwidth usage metrics for a single app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Query Parameters
date
optional
2023-01-17T00:00:00ZOptional day to query. Only the date component of the timestamp will be considered. Default: yesterday.
Request: /v2/apps/{app_id}/metrics/bandwidth_daily
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}/metrics/bandwidth_daily"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.apps.get_metrics_bandwidth_daily(app_id="4f6c71e2")Responses
200
A JSON object with a app_bandwidth_usage key
app_bandwidth_usage keyratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app_bandwidth_usage
optional
A list of bandwidth usage details by app.
Show child properties
app_id
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe ID of the app.
bandwidth_bytes
optional
513668The used bandwidth amount in bytes.
date
optional
2023-01-17T00:00:00ZThe date for the metrics data.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"app_bandwidth_usage": [
{
"app_id": "4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf",
"bandwidth_bytes": "513668"
}
],
"date": "2023-01-17T00:00:00Z"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Restart an App
/v2/apps/{app_id}/restart
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Perform a rolling restart of all or specific components in an app.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request Body: application/json
components
optional
["component1","component2"]Request: /v2/apps/{app_id}/restart
{
"components": [
"component1",
"component2"
]
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/restart"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
create_resp = client.apps.restart(app_id="b6bdf840", body={"components": ["component1", "component2"]})Responses
200
A JSON object with a deployment key.
deployment key.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Rollback App
/v2/apps/{app_id}/rollback
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Rollback 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request Body: application/json
deployment_id
optional
3aa4d20e-5527-4c00-b496-601fbd22520aThe ID of the deployment to rollback to.
skip_pin
optional
falseWhether to skip pinning the rollback deployment. If false, the rollback deployment will be pinned and any new deployments including Auto Deploy on Push hooks will be disabled until the rollback is either manually committed or reverted via the CommitAppRollback or RevertAppRollback endpoints respectively. If true, the rollback will be immediately committed and the app will remain unpinned.
Request: /v2/apps/{app_id}/rollback
{
"deployment_id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"skip_pin": false
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{ "deployment_id": "3aa4d20e-5527-4c00-b496-601fbd22520a" }' \
"https://api.digitalocean.com/v2/apps/{app_id}/rollback"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
create_resp = client.apps.create_rollback(app_id="b6bdf840")Responses
200
A JSON object with a deployment key.
deployment key.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Commit App Rollback
/v2/apps/{app_id}/rollback/commit
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Commit an app rollback. This action permanently applies the rollback and unpins the app to resume new deployments.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request: /v2/apps/{app_id}/rollback/commit
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/rollback/commit"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
commit_resp = client.apps.commit_rollback("1")Responses
200
The action was successful and the response body is empty.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Revert App Rollback
/v2/apps/{app_id}/rollback/revert
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Revert 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request: /v2/apps/{app_id}/rollback/revert
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{app_id}/rollback/revert"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
revert_resp = client.apps.revert_rollback("1")Responses
200
A JSON object with a deployment key.
deployment key.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
success_steps
optional
4summary_steps
optional
Show child properties
component_name
optional
componentended_at
optional
2020-11-19T20:27:18Zmessage_base
optional
Building serviceThe base of a human-readable description of the step intended to be combined with the component name for presentation. For example:
message_base = "Building service"
component_name = "api"
name
optional
example_stepreason
optional
started_at
optional
2020-11-19T20:27:18Zstatus
optional
SUCCESSsteps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"deployment": {
"cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
"created_at": "2020-07-28T18:00:00Z",
"id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
"phase": "PENDING_BUILD",
"phase_last_updated_at": "0001-01-01T00:00:00Z",
"progress": {
"pending_steps": 6,
"steps": [
{
"name": "build",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "PENDING"
}
]
}
]
},
{
"name": "deploy",
"status": "PENDING",
"steps": [
{
"name": "initialize",
"status": "PENDING"
},
{
"name": "components",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "PENDING",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "PENDING"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "PENDING"
}
]
}
]
},
{
"name": "finalize",
"status": "PENDING"
}
]
}
],
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
}
],
"spec": {
"disable_edge_cache": true,
"disable_email_obfuscation": true,
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "branch",
"repo": "digitalocean/sample-golang"
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
]
},
"tier_slug": "basic",
"updated_at": "2020-07-28T18:00:00Z"
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Validate App Rollback
/v2/apps/{app_id}/rollback/validate
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Check 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.
Path Parameters
app_id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe app ID
Request Body: application/json
deployment_id
optional
3aa4d20e-5527-4c00-b496-601fbd22520aThe ID of the deployment to rollback to.
skip_pin
optional
falseWhether to skip pinning the rollback deployment. If false, the rollback deployment will be pinned and any new deployments including Auto Deploy on Push hooks will be disabled until the rollback is either manually committed or reverted via the CommitAppRollback or RevertAppRollback endpoints respectively. If true, the rollback will be immediately committed and the app will remain unpinned.
Request: /v2/apps/{app_id}/rollback/validate
{
"deployment_id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"skip_pin": false
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{ "deployment_id": "3aa4d20e-5527-4c00-b496-601fbd22520a" }' \
"https://api.digitalocean.com/v2/apps/{app_id}/rollback/validate"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
validate_req = {"deployment_id": "2", "skip_pin": False}
validate_resp = client.apps.validate_rollback("1", validate_req)Responses
200
A JSON object with the validation results.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
error
optional
valid
optional
Indicates whether the app can be rolled back to the specified deployment.
warnings
optional
Contains a list of warnings that may cause the rollback to run under unideal circumstances.
Show child properties
code
optional
exceeded_revision_limitA code identifier that represents the failing condition.
Failing conditions:
incompatible_phase- indicates that the deployment's phase is not suitable for rollback.incompatible_result- indicates that the deployment's result is not suitable for rollback.exceeded_revision_limit- indicates that the app has exceeded the rollback revision limits for its tier.app_pinned- indicates that there is already a rollback in progress and the app is pinned.database_config_conflict- indicates that the deployment's database config is different than the current config.region_conflict- indicates that the deployment's region differs from the current app region.
Warning conditions:
static_site_requires_rebuild- indicates that the deployment contains at least one static site that will require a rebuild.image_source_missing_digest- indicates that the deployment contains at least one component with an image source that is missing a digest.
components
optional
["www"]message
optional
the deployment is past the maximum historical revision limit of 0 for the "starter" app tierA human-readable message describing the failing condition.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"error": {
"code": "incompatible_result",
"message": "deployment result \"failed\" is unsuitable for rollback"
},
"valid": false
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve an Existing App
/v2/apps/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Retrieve 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.
Path Parameters
id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe ID of the app
Query Parameters
name
optional
myAppThe name of the app to retrieve.
Request: /v2/apps/{id}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
create_resp = client.apps.get(id="4f6c71e2")Responses
200
A JSON with key app
appratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app
optional
An application's configuration and status.
Show child properties
active_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405created_at
optional read-only
2020-11-19T20:27:18Zdedicated_ips
optional read-only
Show child properties
id
optional
9e7bc2ac-205a-45d6-919c-e1ac5e73f962ip
optional
192.168.1.1status
optional read-only
ASSIGNEDdefault_ingress
optional read-only
digitalocean.comdomains
optional read-only
Show child properties
certificate_expires_at
optional read-only
2024-01-29T23:59:59Zid
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfphase
optional
ACTIVEprogress
optional
Show child properties
steps
optional
rotate_validation_records
optional read-only
spec
optional
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
validations
optional
Show child properties
txt_name
optional read-only
_acme-challenge.app.example.comtxt_value
optional read-only
lXLOcN6cPv0nproViNcUHcahD9TrIPlNgdwesj0pYpkid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfin_progress_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405last_deployment_created_at
optional read-only
2020-11-19T20:27:18Zlive_domain
optional read-only
live_domainlive_url
optional read-only
google.comlive_url_base
optional read-only
digitalocean.comowner_uuid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfpending_deployment
optional
pinned_deployment
optional
project_id
optional read-only
88b72d1a-b78a-4d9f-9090-b53c4399073fRequires project:read scope.
region
optional
Show child properties
continent
optional read-only
europedata_centers
optional read-only
["ams"]default
optional read-only
trueWhether or not the region is presented as the default.
disabled
optional read-only
trueflag
optional read-only
amslabel
optional read-only
amsreason
optional read-only
to crowdedslug
optional read-only
basicspec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
tier_slug
optional read-only
basicupdated_at
optional read-only
2020-12-01T00:42:16Zvpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427ac
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"app": {
"active_deployment": {
"cause": "manual",
"created_at": "2021-02-10T17:05:30Z",
"id": "991dfa59-6a23-459f-86d6-67dfa2c6f1e3",
"phase": "ACTIVE",
"phase_last_updated_at": "2021-02-10T17:06:53Z",
"progress": {
"steps": [
{
"ended_at": "2021-02-10T17:06:19.807834070Z",
"name": "build",
"started_at": "2021-02-10T17:05:35.572287990Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2021-02-10T17:05:36.093995229Z",
"name": "initialize",
"started_at": "2021-02-10T17:05:35.572347485Z",
"status": "SUCCESS"
},
{
"ended_at": "2021-02-10T17:06:19.461737040Z",
"name": "components",
"started_at": "2021-02-10T17:05:36.094015928Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "SUCCESS"
}
]
}
]
},
{
"ended_at": "2021-02-10T17:06:53.404104185Z",
"name": "deploy",
"started_at": "2021-02-10T17:06:25.143932418Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2021-02-10T17:06:26.120343872Z",
"name": "initialize",
"started_at": "2021-02-10T17:06:25.143957508Z",
"status": "SUCCESS"
},
{
"ended_at": "2021-02-10T17:06:50.029695913Z",
"name": "components",
"started_at": "2021-02-10T17:06:26.120385561Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "SUCCESS"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "SUCCESS"
}
]
}
]
},
{
"ended_at": "2021-02-10T17:06:53.404065961Z",
"name": "finalize",
"started_at": "2021-02-10T17:06:50.348459495Z",
"status": "SUCCESS"
}
]
}
],
"success_steps": 6,
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "db6936cb46047c576962962eed81ad52c21f35d7"
}
],
"spec": {
"domains": [
{
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"zone": "example.com"
}
],
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "main",
"repo": "ChiefMateStarbuck/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2021-02-10T17:06:53Z"
},
"created_at": "2021-02-10T16:45:14Z",
"dedicated_ips": [
{
"id": "c24d8f48-3bc4-49f5-8ca0-58e8164427ac",
"ip": "192.168.1.1",
"status": "ASSIGNED"
},
{
"id": "4768fb15-2837-4dda-9be5-3951df4bc3d0",
"ip": "192.168.1.2",
"status": "ASSIGNED"
}
],
"default_ingress": "https://sample-golang-zyhgn.ondigitalocean.app",
"domains": [
{
"certificate_expires_at": "2024-01-29T23:59:59Z",
"id": "e206c64e-a1a3-11ed-9e6e-9b7b6dc9a52b",
"phase": "CONFIGURING",
"progress": {
"steps": [
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "default-ingress-ready",
"started_at": "2023-01-30T22:15:45.021896292Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-zone",
"started_at": "2023-01-30T22:15:45.022017004Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:42:28.50752065Z",
"name": "ensure-ns-records",
"started_at": "2023-01-30T22:15:45.025567874Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-nameservers",
"started_at": "2023-01-30T22:15:45.033591906Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-record",
"started_at": "2023-01-30T22:15:45.156750604Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258626422Z",
"name": "ensure-alias-record",
"started_at": "2023-01-30T22:15:45.165933869Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258808279Z",
"name": "ensure-wildcard-record",
"started_at": "2023-01-30T22:15:45.166093422Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-cname",
"started_at": "2023-01-30T22:15:45.166205559Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.475903785Z",
"name": "ensure-ssl-txt-record-saved",
"started_at": "2023-01-30T22:15:45.295237186Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476017236Z",
"name": "ensure-ssl-txt-record",
"started_at": "2023-01-30T22:15:45.295315291Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476094058Z",
"name": "ensure-renewal-email",
"started_at": "2023-01-30T22:15:45.295374087Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-CA-authorization",
"started_at": "2023-01-30T22:15:45.295428101Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-certificate",
"started_at": "2023-01-30T22:15:45.978756406Z",
"status": "RUNNING"
},
{
"ended_at": "0001-01-01T00:00:00",
"name": "create-deployment",
"started_at": "0001-01-01T00:00:00Z",
"status": "PENDING"
},
{
"ended_at": "0001-01-01T00:00:00",
"name": "configuration-alert",
"started_at": "0001-01-01T00:00:00",
"status": "PENDING"
}
]
},
"rotate_validation_records": false,
"spec": {
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
}
],
"id": "c2a93513-8d9b-4223-9d61-5e7272c81cf5",
"last_deployment_created_at": "2021-02-10T17:05:30Z",
"live_domain": "sample-golang-zyhgn.ondigitalocean.app",
"live_url": "https://sample-golang-zyhgn.ondigitalocean.app",
"live_url_base": "https://sample-golang-zyhgn.ondigitalocean.app",
"owner_uuid": "a4e16f25-cdd1-4483-b246-d77f283c9209",
"pending_deployment": {
"id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"spec": {
"domains": [
{
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
],
"name": "sample-php",
"region": "fra",
"services": [
{
"environment_slug": "php",
"git": {
"branch": "main",
"repo_clone_url": "https://github.com/digitalocean/sample-php.git"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "sample-php",
"routes": [
{
"path": "/"
}
],
"run_command": "heroku-php-apache2"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
},
"project_id": "88b72d1a-b78a-4d9f-9090-b53c4399073f",
"region": {
"continent": "Europe",
"data_centers": [
"ams3"
],
"flag": "netherlands",
"label": "Amsterdam",
"slug": "ams"
},
"spec": {
"disable_edge_cache": true,
"domains": [
{
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"zone": "example.com"
}
],
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "main",
"repo": "ChiefMateStarbuck/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2021-02-10T17:06:56Z",
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}PUT Update an App
/v2/apps/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Update an existing app by submitting a new app specification. For documentation on app specifications (AppSpec objects), please refer to the product documentation.
Path Parameters
id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe ID of the app
Request Body: application/json
spec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
Show child properties
disabled
optional
falseIs the alert disabled?
operator
optional
GREATER_THANrule
optional
CPU_UTILIZATIONvalue
optional
2.32Threshold value for alert
window
optional
FIVE_MINUTESbitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
cors
optional
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
Show child properties
component
optional
The component to route to. Only one of component or redirect may be set.
cors
optional
match
optional
The match configuration for the rule.
redirect
optional
The redirect configuration for the rule. Only one of component or redirect may be set.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
Show child properties
failure_threshold
optional
2The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
60The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port.
success_threshold
optional
3The number of successful health checks before considered healthy.
timeout_seconds
optional
45The number of seconds after which the check times out.
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
termination
optional
Show child properties
drain_seconds
optional
15The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15)
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
path
optional
/api(Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
preserve_path_prefix
optional
trueAn optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api will have requests to /api/list trimmed to /list. If this value is true, the path will remain /api/list.
vpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
Show child properties
key
required
BASE_URLThe variable name
scope
optional
BUILD_TIME- RUN_TIME: Made available only at run-time
- BUILD_TIME: Made available only at build-time
- RUN_AND_BUILD_TIME: Made available at both build and run-time
type
optional
GENERAL- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variable
value
optional
http://example.comThe value. If the type is SECRET, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
git
optional
Show child properties
branch
optional
mainThe name of the branch to use
repo_clone_url
optional
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
github
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
gitlab
optional
Show child properties
branch
optional
mainThe name of the branch to use
deploy_on_push
optional
trueWhether to automatically deploy new commits made to the repo
repo
optional
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example: digitalocean/sample-golang
image
optional
Show child properties
deploy_on_push
optional
digest
optional
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
registry
optional
registry.hub.docker.comThe registry name. Must be left empty for the DOCR registry type.
registry_credentials
optional
my-dockerhub-username:dckr_pat_the_access_tokenThe credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used.
- "$username:$access_token" for registries of type
DOCKER_HUB. - "$username:$access_token" for registries of type
GHCR.
registry_type
optional
DOCR- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.
repository
optional
origin/masterThe repository name.
tag
optional
latestThe repository tag. Defaults to latest if not provided and no digest is provided. Cannot be specified if digest is provided.
log_destinations
optional
A list of configured log forwarding destinations.
Show child properties
datadog
optional
DataDog configuration.
logtail
optional
Logtail configuration.
name
required
my_log_destinationopen_search
optional
OpenSearch configuration.
papertrail
optional
Papertrail configuration.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
Show child properties
max_instance_count
optional
3The maximum amount of instances for this component. Must be more than min_instance_count.
metrics
optional
The metrics that the component is scaled on.
min_instance_count
optional
2The minimum amount of instances for this component. Must be less than max_instance_count.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
Show child properties
failure_threshold
optional
18The number of failed health checks before considered unhealthy.
http_path
optional
/healthThe route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
initial_delay_seconds
optional
30The number of seconds to wait before beginning health checks.
period_seconds
optional
10The number of seconds to wait between health checks.
port
optional
80The port on which the health check will be performed.
success_threshold
optional
1The number of successful health checks before considered healthy.
timeout_seconds
optional
1The number of seconds after which the check times out.
termination
optional
Show child properties
grace_period_seconds
optional
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
update_all_source_versions
optional
trueWhether or not to update the source versions (for example fetching a new commit or image digest) of all components. By default (when this is false) only newly added sources will be updated to avoid changes like updating the scale of a component from also updating the respective code.
Request: /v2/apps/{id}
{
"spec": {
"databases": [],
"disable_edge_cache": false,
"disable_email_obfuscation": false,
"domains": [],
"egress": {
"type": "AUTOASSIGN"
},
"enhanced_threat_control_enabled": false,
"functions": [],
"ingress": {
"rules": []
},
"jobs": [],
"maintenance": {
"archive": true,
"enabled": true,
"offline_page_url": "https://example.com/offline.html"
},
"name": "web-app-01",
"region": "nyc",
"services": [],
"static_sites": [],
"workers": []
},
"update_all_source_versions": true
}curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}" \
-d '{"alerts":[{"rule":"DEPLOYMENT_FAILED"},{"rule":"DOMAIN_FAILED"}],"domains":[{"domain":"example.com","type":"PRIMARY","zone":"example.com"}],"envs":[{"key":"API_KEY","scope":"RUN_AND_BUILD_TIME","type":"SECRET","value":"EV[1:zqiRIeaaYK/NqctZDYzy6t0pTrtRDez8:wqGpZRrsKN5nPhWQrS479cfBiXT0WQ==]"}],"features":["buildpack-stack=ubuntu-22"],"ingress":{},"name":"example-app","region":"nyc","services":[{"autoscaling":{"max_instance_count":4,"metrics":{"cpu":{"percent":70}},"min_instance_count":2},"git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-nodejs.git"},"internal_ports":[8080],"log_destinations":[{"name":"your_log_consumer_name","open_search":{"endpoint":"logs.example.com:12345","basic_auth":{"user":"doadmin","password":"1234567890abcdef"},"index_name":"example-index","cluster_name":"example-cluster"}}],"name":"sample-nodejs","run_command":"yarn start","source_dir":"/"}]}'import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"spec": {
"name": "web-app-01",
"region": "nyc",
"domains": [
{
"domain": "app.example.com",
"type": "DEFAULT",
"wildcard": True,
"zone": "example.com",
"minimum_tls_version": "1.3",
}
],
"services": [],
"static_sites": [
{
"cors": {
"allow_origins": [
{"exact": "https://www.example.com"},
{"regex": "^.*example.com"},
],
"allow_methods": [
"GET",
"OPTIONS",
"POST",
"PUT",
"PATCH",
"DELETE",
],
"allow_headers": ["Content-Type", "X-Custom-Header"],
"expose_headers": ["Content-Encoding", "X-Custom-Header"],
"max_age": "5h30m",
"allow_credentials": False,
},
"routes": [{"path": "/api", "preserve_path_prefix": True}],
}
],
"jobs": [
{
"name": "api",
"gitlab": {
"branch": "main",
"deploy_on_push": True,
"repo": "digitalocean/sample-golang",
},
"image": {
"registry": "registry.hub.docker.com",
"registry_type": "DOCR",
"repository": "origin/master",
"tag": "latest",
},
"dockerfile_path": "path/to/Dockerfile",
"build_command": "npm run build",
"run_command": "bin/api",
"source_dir": "path/to/dir",
"envs": [
{
"key": "BASE_URL",
"scope": "BUILD_TIME",
"type": "GENERAL",
"value": "http://example.com",
}
],
"environment_slug": "node-js",
"log_destinations": {
"name": "my_log_destination",
"papertrail": {
"endpoint": "https://mypapertrailendpoint.com"
},
"datadog": {
"endpoint": "https://mydatadogendpoint.com",
"api_key": "abcdefghijklmnopqrstuvwxyz0123456789",
},
"logtail": {
"token": "abcdefghijklmnopqrstuvwxyz0123456789"
},
"open_search": {
"endpoint": "https://myopensearchendpoint.com:9300"
"index_name": "logs"
"basic_auth": {
"user": "doadmin",
"password": "password"
}
},
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"kind": "PRE_DEPLOY",
}
],
"workers": [
{
"name": "api",
"gitlab": {
"branch": "main",
"deploy_on_push": True,
"repo": "digitalocean/sample-golang",
},
"image": {
"registry": "registry.hub.docker.com",
"registry_type": "DOCR",
"repository": "origin/master",
"tag": "latest",
},
"dockerfile_path": "path/to/Dockerfile",
"build_command": "npm run build",
"run_command": "bin/api",
"source_dir": "path/to/dir",
"envs": [
{
"key": "BASE_URL",
"scope": "BUILD_TIME",
"type": "GENERAL",
"value": "http://example.com",
}
],
"environment_slug": "node-js",
"log_destinations": {
"name": "my_log_destination",
"papertrail": {
"endpoint": "https://mypapertrailendpoint.com"
},
"datadog": {
"endpoint": "https://mydatadogendpoint.com",
"api_key": "abcdefghijklmnopqrstuvwxyz0123456789",
},
"logtail": {
"token": "abcdefghijklmnopqrstuvwxyz0123456789"
},
"open_search": {
"endpoint": "https://myopensearchendpoint.com:9300"
"index_name": "logs"
"basic_auth": {
"user": "doadmin",
"password": "password"
}
},
},
"instance_count": 2,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
}
],
"functions": [
{
"cors": {
"allow_origins": [
{"exact": "https://www.example.com"},
{"regex": "^.*example.com"},
],
"allow_methods": [
"GET",
"OPTIONS",
"POST",
"PUT",
"PATCH",
"DELETE",
],
"allow_headers": ["Content-Type", "X-Custom-Header"],
"expose_headers": ["Content-Encoding", "X-Custom-Header"],
"max_age": "5h30m",
"allow_credentials": False,
},
"routes": [{"path": "/api", "preserve_path_prefix": True}],
"name": "api",
"source_dir": "path/to/dir",
"alerts": [
{
"rule": "CPU_UTILIZATION",
"disabled": False,
"operator": "GREATER_THAN",
"value": 2.32,
"window": "FIVE_MINUTES",
}
],
"envs": [
{
"key": "BASE_URL",
"scope": "BUILD_TIME",
"type": "GENERAL",
"value": "http://example.com",
}
],
"gitlab": {
"branch": "main",
"deploy_on_push": True,
"repo": "digitalocean/sample-golang",
},
"log_destinations": {
"name": "my_log_destination",
"papertrail": {
"endpoint": "https://mypapertrailendpoint.com"
},
"datadog": {
"endpoint": "https://mydatadogendpoint.com",
"api_key": "abcdefghijklmnopqrstuvwxyz0123456789",
},
"logtail": {
"token": "abcdefghijklmnopqrstuvwxyz0123456789"
},
"open_search": {
"endpoint": "https://myopensearchendpoint.com:9300"
"index_name": "logs"
"basic_auth": {
"user": "doadmin",
"password": "password"
}
},
},
}
],
"databases": [
{
"cluster_name": "cluster_name",
"db_name": "my_db",
"db_user": "superuser",
"engine": "PG",
"name": "prod-db",
"production": True,
"version": "12",
}
],
“vpc”: {
“id”: “c22d8f48-4bc4-49f5-8ca0-58e7164427ac”,
}
}
update_resp = client.apps.update(id="bb245ba", body=req)Responses
200
A JSON object of the updated app
appratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
app
optional
An application's configuration and status.
Show child properties
active_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405created_at
optional read-only
2020-11-19T20:27:18Zdedicated_ips
optional read-only
Show child properties
id
optional
9e7bc2ac-205a-45d6-919c-e1ac5e73f962ip
optional
192.168.1.1status
optional read-only
ASSIGNEDdefault_ingress
optional read-only
digitalocean.comdomains
optional read-only
Show child properties
certificate_expires_at
optional read-only
2024-01-29T23:59:59Zid
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfphase
optional
ACTIVEprogress
optional
Show child properties
steps
optional
rotate_validation_records
optional read-only
spec
optional
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
validations
optional
Show child properties
txt_name
optional read-only
_acme-challenge.app.example.comtxt_value
optional read-only
lXLOcN6cPv0nproViNcUHcahD9TrIPlNgdwesj0pYpkid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfin_progress_deployment
optional
Show child properties
cause
optional
commit 9a4df0b pushed to github/digitalocean/sample-golangcloned_from
optional
3aa4d20e-5527-4c00-b496-601fbd22520acreated_at
optional
2020-07-28T18:00:00Zfunctions
optional
Show child properties
name
optional
my-functions-componentnamespace
optional
ap-b2a93513-8d9b-4223-9d61-5e7272c81c32The namespace where the functions are deployed.
source_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405The commit hash of the repository that was used to build this functions component.
id
optional
b6bdf840-2854-4f87-a36c-5f231c617c84jobs
optional
Show child properties
name
optional
migrate-dbsource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405phase
optional
ACTIVEphase_last_updated_at
optional
0001-01-01T00:00:00Zprogress
optional
Show child properties
error_steps
optional
3pending_steps
optional
2running_steps
optional
2steps
optional
success_steps
optional
4summary_steps
optional
total_steps
optional
5services
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405spec
optional
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
egress
optional
Specification for app egress configurations.
enhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
ingress
optional
Specification for app ingress configurations.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
static_sites
optional
Content which can be rendered to static web assets.
vpc
optional read-only
workers
optional
Workloads which do not expose publicly-accessible HTTP services.
static_sites
optional
Show child properties
name
optional
websource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405tier_slug
optional read-only
basicupdated_at
optional
2020-07-28T18:00:00Zworkers
optional
Show child properties
name
optional
queue-runnersource_commit_hash
optional
54d4a727f457231062439895000d45437c7bb405last_deployment_created_at
optional read-only
2020-11-19T20:27:18Zlive_domain
optional read-only
live_domainlive_url
optional read-only
google.comlive_url_base
optional read-only
digitalocean.comowner_uuid
optional read-only
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfpending_deployment
optional
pinned_deployment
optional
project_id
optional read-only
88b72d1a-b78a-4d9f-9090-b53c4399073fRequires project:read scope.
region
optional
Show child properties
continent
optional read-only
europedata_centers
optional read-only
["ams"]default
optional read-only
trueWhether or not the region is presented as the default.
disabled
optional read-only
trueflag
optional read-only
amslabel
optional read-only
amsreason
optional read-only
to crowdedslug
optional read-only
basicspec
required
The desired configuration of an application.
Show child properties
databases
optional
Database instances which can provide persistence to workloads within the application.
Show child properties
cluster_name
optional
cluster_nameThe name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
db_name
optional
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_user
optional
superuserThe name of the MySQL or PostgreSQL user to configure.
engine
optional
PG- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKey
name
required
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
production
optional
trueWhether this is a production or dev database.
version
optional
12The version of the database engine
disable_edge_cache
optional
If set to true, the app will not be cached at the edge (CDN). Enable this option if you want to manage CDN configuration yourself—whether by using an external CDN provider or by handling static content and caching within your app. This setting is also recommended for apps that require real-time data or serve dynamic content, such as those using Server-Sent Events (SSE) over GET, or hosting an MCP (Model Context Protocol) Server that utilizes SSE.
Note: This feature is not available for static site components.
For more information, see Disable CDN Cache.
disable_email_obfuscation
optional
If set to true, email addresses in the app will not be obfuscated. This is
useful for apps that require email addresses to be visible (in the HTML markup).
domains
optional
A set of hostnames where the application will be available.
Show child properties
domain
required
app.example.comThe hostname for the domain
minimum_tls_version
optional
1.3The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: "1.2" or "1.3".
type
optional
DEFAULT- DEFAULT: The default
.ondigitalocean.appdomain assigned to this app - PRIMARY: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app's live URL. Only one domain may be set as primary.
- ALIAS: A non-primary domain
wildcard
optional
trueIndicates whether the domain includes all sub-domains, in addition to the given domain
zone
optional
example.comOptional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com, the zone
could be domain.com.
egress
optional
Specification for app egress configurations.
Show child properties
type
optional
AUTOASSIGNenhanced_threat_control_enabled
optional
If set to true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
functions
optional
Workloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
alerts
optional
bitbucket
optional
cors
optional
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
required
apiThe name. Must be unique across all components within the same app.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
ingress
optional
Specification for app ingress configurations.
Show child properties
rules
optional
Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
jobs
optional
Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
kind
optional
PRE_DEPLOY- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind.
- PRE_DEPLOY: Indicates a job that runs before an app deployment.
- POST_DEPLOY: Indicates a job that runs after an app deployment.
- FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
termination
optional
maintenance
optional
Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
archive
optional
trueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
enabled
optional
trueIndicates whether maintenance mode should be enabled for the app.
offline_page_url
optional
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
name
required
web-app-01The name of the app. Must be unique across all apps in the same account.
region
optional
nycThe slug form of the geographical origin of the app. Default: nearest available
services
optional
Workloads which expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
cors
optional
health_check
optional
http_port
optional
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the name PORT, one will be automatically added with its value set to the value of this field.
internal_ports
optional
[80,443]The ports on which this service will listen for internal traffic.
liveness_health_check
optional
protocol
optional
HTTPThe protocol which the service uses to serve traffic on the http_port.
HTTP: The app is serving the HTTP protocol. Default.HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
termination
optional
static_sites
optional
Content which can be rendered to static web assets.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
catchall_document
optional
index.htmlThe name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document or error_document can be set.
cors
optional
error_document
optional
error.htmlThe name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
index_document
optional
main.htmlThe name of the index document to use when serving this static site. Default: index.html
output_dir
optional
dist/An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static, dist, public, build.
routes
optional Deprecated
(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
vpc
optional read-only
Show child properties
egress_ips
optional
id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427acworkers
optional
Workloads which do not expose publicly-accessible HTTP services.
Show child properties
bitbucket
optional
build_command
optional
npm run buildAn optional build command to run while building this component from source.
dockerfile_path
optional
path/to/DockerfileThe path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
environment_slug
optional
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
envs
optional
A list of environment variables made available to the component.
git
optional
github
optional
gitlab
optional
image
optional
log_destinations
optional
A list of configured log forwarding destinations.
name
optional
apiThe name. Must be unique across all components within the same app.
run_command
optional
bin/apiAn optional run command to override the component's default.
source_dir
optional
path/to/dirAn optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
autoscaling
optional
Configuration for automatically scaling this component based on metrics.
instance_count
optional
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slug
optional
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default: apps-s-1vcpu-0.5gb
liveness_health_check
optional
termination
optional
tier_slug
optional read-only
basicupdated_at
optional read-only
2020-12-01T00:42:16Zvpc
optional read-only
Show child properties
egress_ips
optional
Show child properties
ip
optional
10.0.0.1id
optional
c22d8f48-4bc4-49f5-8ca0-58e7164427ac
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"app": {
"active_deployment": {
"cause": "manual",
"created_at": "2021-02-10T17:05:30Z",
"id": "991dfa59-6a23-459f-86d6-67dfa2c6f1e3",
"phase": "ACTIVE",
"phase_last_updated_at": "2021-02-10T17:06:53Z",
"progress": {
"steps": [
{
"ended_at": "2021-02-10T17:06:19.807834070Z",
"name": "build",
"started_at": "2021-02-10T17:05:35.572287990Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2021-02-10T17:05:36.093995229Z",
"name": "initialize",
"started_at": "2021-02-10T17:05:35.572347485Z",
"status": "SUCCESS"
},
{
"ended_at": "2021-02-10T17:06:19.461737040Z",
"name": "components",
"started_at": "2021-02-10T17:05:36.094015928Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"message_base": "Building service",
"name": "web",
"status": "SUCCESS"
}
]
}
]
},
{
"ended_at": "2021-02-10T17:06:53.404104185Z",
"name": "deploy",
"started_at": "2021-02-10T17:06:25.143932418Z",
"status": "SUCCESS",
"steps": [
{
"ended_at": "2021-02-10T17:06:26.120343872Z",
"name": "initialize",
"started_at": "2021-02-10T17:06:25.143957508Z",
"status": "SUCCESS"
},
{
"ended_at": "2021-02-10T17:06:50.029695913Z",
"name": "components",
"started_at": "2021-02-10T17:06:26.120385561Z",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"name": "web",
"status": "SUCCESS",
"steps": [
{
"component_name": "web",
"message_base": "Deploying service",
"name": "deploy",
"status": "SUCCESS"
},
{
"component_name": "web",
"message_base": "Waiting for service",
"name": "wait",
"status": "SUCCESS"
}
]
}
]
},
{
"ended_at": "2021-02-10T17:06:53.404065961Z",
"name": "finalize",
"started_at": "2021-02-10T17:06:50.348459495Z",
"status": "SUCCESS"
}
]
}
],
"success_steps": 6,
"total_steps": 6
},
"services": [
{
"name": "web",
"source_commit_hash": "db6936cb46047c576962962eed81ad52c21f35d7"
}
],
"spec": {
"domains": [
{
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"zone": "example.com"
}
],
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "main",
"repo": "ChiefMateStarbuck/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2021-02-10T17:06:53Z"
},
"created_at": "2021-02-10T16:45:14Z",
"dedicated_ips": [
{
"id": "c24d8f48-3bc4-49f5-8ca0-58e8164427ac",
"ip": "192.168.1.1",
"status": "ASSIGNED"
},
{
"id": "4768fb15-2837-4dda-9be5-3951df4bc3d0",
"ip": "192.168.1.2",
"status": "ASSIGNED"
}
],
"default_ingress": "https://sample-golang-zyhgn.ondigitalocean.app",
"domains": [
{
"certificate_expires_at": "2024-01-29T23:59:59Z",
"id": "e206c64e-a1a3-11ed-9e6e-9b7b6dc9a52b",
"phase": "CONFIGURING",
"progress": {
"steps": [
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "default-ingress-ready",
"started_at": "2023-01-30T22:15:45.021896292Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-zone",
"started_at": "2023-01-30T22:15:45.022017004Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:42:28.50752065Z",
"name": "ensure-ns-records",
"started_at": "2023-01-30T22:15:45.025567874Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-nameservers",
"started_at": "2023-01-30T22:15:45.033591906Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-record",
"started_at": "2023-01-30T22:15:45.156750604Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258626422Z",
"name": "ensure-alias-record",
"started_at": "2023-01-30T22:15:45.165933869Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.258808279Z",
"name": "ensure-wildcard-record",
"started_at": "2023-01-30T22:15:45.166093422Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "verify-cname",
"started_at": "2023-01-30T22:15:45.166205559Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.475903785Z",
"name": "ensure-ssl-txt-record-saved",
"started_at": "2023-01-30T22:15:45.295237186Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476017236Z",
"name": "ensure-ssl-txt-record",
"started_at": "2023-01-30T22:15:45.295315291Z",
"status": "SUCCESS"
},
{
"ended_at": "2023-01-30T15:43:30.476094058Z",
"name": "ensure-renewal-email",
"started_at": "2023-01-30T22:15:45.295374087Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-CA-authorization",
"started_at": "2023-01-30T22:15:45.295428101Z",
"status": "SUCCESS"
},
{
"ended_at": "0001-01-01T00:00:00Z",
"name": "ensure-certificate",
"started_at": "2023-01-30T22:15:45.978756406Z",
"status": "RUNNING"
},
{
"ended_at": "0001-01-01T00:00:00",
"name": "create-deployment",
"started_at": "0001-01-01T00:00:00Z",
"status": "PENDING"
},
{
"ended_at": "0001-01-01T00:00:00",
"name": "configuration-alert",
"started_at": "0001-01-01T00:00:00",
"status": "PENDING"
}
]
},
"rotate_validation_records": false,
"spec": {
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
}
],
"id": "c2a93513-8d9b-4223-9d61-5e7272c81cf5",
"last_deployment_created_at": "2021-02-10T17:05:30Z",
"live_domain": "sample-golang-zyhgn.ondigitalocean.app",
"live_url": "https://sample-golang-zyhgn.ondigitalocean.app",
"live_url_base": "https://sample-golang-zyhgn.ondigitalocean.app",
"owner_uuid": "a4e16f25-cdd1-4483-b246-d77f283c9209",
"pending_deployment": {
"id": "3aa4d20e-5527-4c00-b496-601fbd22520a",
"spec": {
"domains": [
{
"domain": "sample-php.example.com",
"minimum_tls_version": "1.3",
"type": "PRIMARY",
"zone": "example.com"
}
],
"name": "sample-php",
"region": "fra",
"services": [
{
"environment_slug": "php",
"git": {
"branch": "main",
"repo_clone_url": "https://github.com/digitalocean/sample-php.git"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "sample-php",
"routes": [
{
"path": "/"
}
],
"run_command": "heroku-php-apache2"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
},
"project_id": "88b72d1a-b78a-4d9f-9090-b53c4399073f",
"region": {
"continent": "Europe",
"data_centers": [
"ams3"
],
"flag": "netherlands",
"label": "Amsterdam",
"slug": "ams"
},
"spec": {
"disable_edge_cache": true,
"domains": [
{
"domain": "sample-golang.example.com",
"minimum_tls_version": "1.3",
"zone": "example.com"
}
],
"enhanced_threat_control_enabled": true,
"name": "sample-golang",
"region": "ams",
"services": [
{
"environment_slug": "go",
"github": {
"branch": "main",
"repo": "ChiefMateStarbuck/sample-golang"
},
"http_port": 8080,
"instance_count": 1,
"instance_size_slug": "apps-s-1vcpu-0.5gb",
"name": "web",
"routes": [
{
"path": "/"
}
],
"run_command": "bin/sample-golang"
}
],
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
},
"tier_slug": "basic",
"updated_at": "2021-02-10T17:06:56Z",
"vpc": {
"egress_ips": [
{
"ip": "10.0.0.1"
}
],
"id": "c22d8f48-4bc4-49f5-8ca0-58e7164427ac"
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}DELETE Delete an App
/v2/apps/{id}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
Delete 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.
Path Parameters
id
required
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cfThe ID of the app
Request: /v2/apps/{id}
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/apps/{id}"import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
delete_resp = client.apps.delete(id="b7d64052")Responses
200
the ID of the app deleted.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
optional
4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"id": "b7d64052-3706-4cb7-b21a-c5a2f44e63b3"
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}