pydo.apps.create()
Generated on 8 May 2026
from pydo version
v0.34.0
Usage
client.apps.create(
body={
"spec": {...},
"project_id": "your_project_id",
},
)Description
Create a new app by submitting an app specification. For documentation on app specifications (AppSpec objects), please refer to the product documentation.
Parameters
specobject requiredThe desired configuration of an application.
Show child properties
namestring requiredExample:
web-app-01The name of the app. Must be unique across all apps in the same account.
regionstring optionalThe slug form of the geographical origin of the app. Default:
nearest availabledisable_edge_cacheboolean optionalIf 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_obfuscationboolean optionalIf 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).enhanced_threat_control_enabledboolean optionalIf set to
true, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.domainsarray of objects optionalA set of hostnames where the application will be available.
Show child properties
domainstring requiredExample:
app.example.comThe hostname for the domain
typestring optional- 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 domainwildcardboolean optionalExample:
TrueIndicates whether the domain includes all sub-domains, in addition to the given domain
zonestring optionalExample:
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 isapp.domain.com, the zone
could bedomain.com.minimum_tls_versionstring optionalThe 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".
servicesarray of objects optionalWorkloads which expose publicly-accessible HTTP services.
Show child properties
namestring requiredExample:
apiThe name. Must be unique across all components within the same app.
gitobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
repo_clone_urlstring optionalExample:
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example:
https://github.com/digitalocean/sample-golang.git
githubobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
gitlabobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
bitbucketobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
imageobject optionalShow child properties
registrystring optionalExample:
registry.hub.docker.comThe registry name. Must be left empty for the
DOCRregistry type.registry_typestring optional- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.registry_credentialsstring optionalExample:
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 typeDOCKER_HUB.
- "$username:$access_token" for registries of typeGHCR.repositorystring optionalExample:
origin/masterThe repository name.
tagstring optionalExample:
latestThe repository tag. Defaults to
latestif not provided and no digest is provided. Cannot be specified if digest is provided.digeststring optionalExample:
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
deploy_on_pushobject optional
dockerfile_pathstring optionalExample:
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.
build_commandstring optionalExample:
npm run buildAn optional build command to run while building this component from source.
run_commandstring optionalExample:
bin/apiAn optional run command to override the component's default.
source_dirstring optionalExample:
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.
envsarray of objects optionalA list of environment variables made available to the component.
Show child properties
keystring requiredExample:
BASE_URLThe variable name
scopestring optional- 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-timetypestring optional- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variablevaluestring optionalExample:
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.
environment_slugstring optionalExample:
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
log_destinationsarray of objects optionalA list of configured log forwarding destinations.
Show child properties
namestring requiredExample:
my_log_destinationpapertrailobject optionalPapertrail configuration.
datadogobject optionalDataDog configuration.
logtailobject optionalLogtail configuration.
open_searchobject optionalOpenSearch configuration.
instance_countinteger optionalExample:
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slugobject optionalExample:
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default:
apps-s-1vcpu-0.5gbautoscalingobject optionalShow child properties
min_instance_countinteger optionalExample:
2The minimum amount of instances for this component.
max_instance_countinteger optionalExample:
3The maximum amount of instances for this component. Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.
metricsobject optional
corsobject optionalShow child properties
allow_originsarray of objects optionalExample:
[{'exact': 'https://www.example.com'}, {'regex': '^.*example.com'}]The set of allowed CORS origins.
allow_methodsarray of strings optionalExample:
['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']The set of allowed HTTP methods. This configures the
Access-Control-Allow-Methodsheader.allow_headersarray of strings optionalExample:
['Content-Type', 'X-Custom-Header']The set of allowed HTTP request headers. This configures the
Access-Control-Allow-Headersheader.expose_headersarray of strings optionalExample:
['Content-Encoding', 'X-Custom-Header']The set of HTTP response headers that browsers are allowed to access. This configures the
Access-Control-Expose-Headersheader.max_agestring optionalExample:
5h30mAn optional duration specifying how long browsers can cache the results of a preflight request. This configures the
Access-Control-Max-Ageheader.allow_credentialsboolean optionalExample:
FalseWhether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include. This configures the
Access-Control-Allow-Credentialsheader.
health_checkobject optionalShow child properties
failure_thresholdinteger optionalExample:
2The number of failed health checks before considered unhealthy.
portinteger optionalExample:
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.
http_pathstring optionalExample:
/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_secondsinteger optionalExample:
30The number of seconds to wait before beginning health checks.
period_secondsinteger optionalExample:
60The number of seconds to wait between health checks.
success_thresholdinteger optionalExample:
3The number of successful health checks before considered healthy.
timeout_secondsinteger optionalExample:
45The number of seconds after which the check times out.
liveness_health_checkobject optionalShow child properties
failure_thresholdinteger optionalExample:
18The number of failed health checks before considered unhealthy.
portinteger optionalExample:
80The port on which the health check will be performed.
http_pathstring optionalExample:
/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_secondsinteger optionalExample:
30The number of seconds to wait before beginning health checks.
period_secondsinteger optionalExample:
10The number of seconds to wait between health checks.
success_thresholdinteger optionalExample:
1The number of successful health checks before considered healthy.
timeout_secondsinteger optionalExample:
1The number of seconds after which the check times out.
protocolstring optionalThe 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).http_portinteger optionalExample:
3000The internal port on which this service's run command will listen. Default: 8080
If there is not an environment variable with the namePORT, one will be automatically added with its value set to the value of this field.internal_portsarray of integers optionalExample:
[80, 443]The ports on which this service will listen for internal traffic.
routesarray of objects optional deprecated(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
pathstring optionalExample:
/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_prefixboolean optionalExample:
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=/apiwill have requests to/api/listtrimmed to/list. If this value istrue, the path will remain/api/list.
terminationobject optionalShow child properties
drain_secondsinteger optionalExample:
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_secondsinteger optionalExample:
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_sitesarray of objects optionalContent which can be rendered to static web assets.
Show child properties
namestring requiredExample:
apiThe name. Must be unique across all components within the same app.
gitobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
repo_clone_urlstring optionalExample:
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example:
https://github.com/digitalocean/sample-golang.git
githubobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
gitlabobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
bitbucketobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
imageobject optionalShow child properties
registrystring optionalExample:
registry.hub.docker.comThe registry name. Must be left empty for the
DOCRregistry type.registry_typestring optional- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.registry_credentialsstring optionalExample:
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 typeDOCKER_HUB.
- "$username:$access_token" for registries of typeGHCR.repositorystring optionalExample:
origin/masterThe repository name.
tagstring optionalExample:
latestThe repository tag. Defaults to
latestif not provided and no digest is provided. Cannot be specified if digest is provided.digeststring optionalExample:
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
deploy_on_pushobject optional
dockerfile_pathstring optionalExample:
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.
build_commandstring optionalExample:
npm run buildAn optional build command to run while building this component from source.
run_commandstring optionalExample:
bin/apiAn optional run command to override the component's default.
source_dirstring optionalExample:
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.
envsarray of objects optionalA list of environment variables made available to the component.
Show child properties
keystring requiredExample:
BASE_URLThe variable name
scopestring optional- 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-timetypestring optional- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variablevaluestring optionalExample:
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.
environment_slugstring optionalExample:
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
log_destinationsarray of objects optionalA list of configured log forwarding destinations.
Show child properties
namestring requiredExample:
my_log_destinationpapertrailobject optionalPapertrail configuration.
datadogobject optionalDataDog configuration.
logtailobject optionalLogtail configuration.
open_searchobject optionalOpenSearch configuration.
index_documentstring optionalExample:
main.htmlThe name of the index document to use when serving this static site. Default: index.html
error_documentstring optionalExample:
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.
catchall_documentstring optionalExample:
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_documentorerror_documentcan be set.output_dirstring optionalExample:
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.corsobject optionalShow child properties
allow_originsarray of objects optionalExample:
[{'exact': 'https://www.example.com'}, {'regex': '^.*example.com'}]The set of allowed CORS origins.
allow_methodsarray of strings optionalExample:
['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']The set of allowed HTTP methods. This configures the
Access-Control-Allow-Methodsheader.allow_headersarray of strings optionalExample:
['Content-Type', 'X-Custom-Header']The set of allowed HTTP request headers. This configures the
Access-Control-Allow-Headersheader.expose_headersarray of strings optionalExample:
['Content-Encoding', 'X-Custom-Header']The set of HTTP response headers that browsers are allowed to access. This configures the
Access-Control-Expose-Headersheader.max_agestring optionalExample:
5h30mAn optional duration specifying how long browsers can cache the results of a preflight request. This configures the
Access-Control-Max-Ageheader.allow_credentialsboolean optionalExample:
FalseWhether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include. This configures the
Access-Control-Allow-Credentialsheader.
routesarray of objects optional deprecated(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
pathstring optionalExample:
/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_prefixboolean optionalExample:
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=/apiwill have requests to/api/listtrimmed to/list. If this value istrue, the path will remain/api/list.
jobsarray of objects optionalPre and post deployment workloads which do not expose publicly-accessible HTTP routes.
Show child properties
namestring requiredExample:
apiThe name. Must be unique across all components within the same app.
gitobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
repo_clone_urlstring optionalExample:
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example:
https://github.com/digitalocean/sample-golang.git
githubobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
gitlabobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
bitbucketobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
imageobject optionalShow child properties
registrystring optionalExample:
registry.hub.docker.comThe registry name. Must be left empty for the
DOCRregistry type.registry_typestring optional- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.registry_credentialsstring optionalExample:
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 typeDOCKER_HUB.
- "$username:$access_token" for registries of typeGHCR.repositorystring optionalExample:
origin/masterThe repository name.
tagstring optionalExample:
latestThe repository tag. Defaults to
latestif not provided and no digest is provided. Cannot be specified if digest is provided.digeststring optionalExample:
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
deploy_on_pushobject optional
dockerfile_pathstring optionalExample:
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.
build_commandstring optionalExample:
npm run buildAn optional build command to run while building this component from source.
run_commandstring optionalExample:
bin/apiAn optional run command to override the component's default.
source_dirstring optionalExample:
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.
envsarray of objects optionalA list of environment variables made available to the component.
Show child properties
keystring requiredExample:
BASE_URLThe variable name
scopestring optional- 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-timetypestring optional- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variablevaluestring optionalExample:
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.
environment_slugstring optionalExample:
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
log_destinationsarray of objects optionalA list of configured log forwarding destinations.
Show child properties
namestring requiredExample:
my_log_destinationpapertrailobject optionalPapertrail configuration.
datadogobject optionalDataDog configuration.
logtailobject optionalLogtail configuration.
open_searchobject optionalOpenSearch configuration.
instance_countinteger optionalExample:
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slugobject optionalExample:
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default:
apps-s-1vcpu-0.5gbkindstring optional- 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.terminationobject optionalShow child properties
grace_period_secondsinteger optionalExample:
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
workersarray of objects optionalWorkloads which do not expose publicly-accessible HTTP services.
Show child properties
namestring requiredExample:
apiThe name. Must be unique across all components within the same app.
gitobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
repo_clone_urlstring optionalExample:
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example:
https://github.com/digitalocean/sample-golang.git
githubobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
gitlabobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
bitbucketobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
imageobject optionalShow child properties
registrystring optionalExample:
registry.hub.docker.comThe registry name. Must be left empty for the
DOCRregistry type.registry_typestring optional- DOCKER_HUB: The DockerHub container registry type.
- DOCR: The DigitalOcean container registry type.
- GHCR: The Github container registry type.registry_credentialsstring optionalExample:
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 typeDOCKER_HUB.
- "$username:$access_token" for registries of typeGHCR.repositorystring optionalExample:
origin/masterThe repository name.
tagstring optionalExample:
latestThe repository tag. Defaults to
latestif not provided and no digest is provided. Cannot be specified if digest is provided.digeststring optionalExample:
sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041acThe image digest. Cannot be specified if tag is provided.
deploy_on_pushobject optional
dockerfile_pathstring optionalExample:
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.
build_commandstring optionalExample:
npm run buildAn optional build command to run while building this component from source.
run_commandstring optionalExample:
bin/apiAn optional run command to override the component's default.
source_dirstring optionalExample:
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.
envsarray of objects optionalA list of environment variables made available to the component.
Show child properties
keystring requiredExample:
BASE_URLThe variable name
scopestring optional- 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-timetypestring optional- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variablevaluestring optionalExample:
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.
environment_slugstring optionalExample:
node-jsAn environment slug describing the type of this app. For a full list, please refer to the product documentation.
log_destinationsarray of objects optionalA list of configured log forwarding destinations.
Show child properties
namestring requiredExample:
my_log_destinationpapertrailobject optionalPapertrail configuration.
datadogobject optionalDataDog configuration.
logtailobject optionalLogtail configuration.
open_searchobject optionalOpenSearch configuration.
instance_countinteger optionalExample:
2The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
instance_size_slugobject optionalExample:
apps-s-1vcpu-0.5gbThe instance size to use for this component. Default:
apps-s-1vcpu-0.5gbautoscalingobject optionalConfiguration for automatically scaling this component based on metrics.
Show child properties
min_instance_countinteger optionalExample:
2The minimum amount of instances for this component.
max_instance_countinteger optionalExample:
3The maximum amount of instances for this component. Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.
metricsobject optionalThe metrics that the component is scaled on.
terminationobject optionalShow child properties
grace_period_secondsinteger optionalExample:
120The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
liveness_health_checkobject optionalShow child properties
failure_thresholdinteger optionalExample:
18The number of failed health checks before considered unhealthy.
portinteger optionalExample:
80The port on which the health check will be performed.
http_pathstring optionalExample:
/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_secondsinteger optionalExample:
30The number of seconds to wait before beginning health checks.
period_secondsinteger optionalExample:
10The number of seconds to wait between health checks.
success_thresholdinteger optionalExample:
1The number of successful health checks before considered healthy.
timeout_secondsinteger optionalExample:
1The number of seconds after which the check times out.
functionsarray of objects optionalWorkloads which expose publicly-accessible HTTP services via Functions Components.
Show child properties
corsobject optionalShow child properties
allow_originsarray of objects optionalExample:
[{'exact': 'https://www.example.com'}, {'regex': '^.*example.com'}]The set of allowed CORS origins.
allow_methodsarray of strings optionalExample:
['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']The set of allowed HTTP methods. This configures the
Access-Control-Allow-Methodsheader.allow_headersarray of strings optionalExample:
['Content-Type', 'X-Custom-Header']The set of allowed HTTP request headers. This configures the
Access-Control-Allow-Headersheader.expose_headersarray of strings optionalExample:
['Content-Encoding', 'X-Custom-Header']The set of HTTP response headers that browsers are allowed to access. This configures the
Access-Control-Expose-Headersheader.max_agestring optionalExample:
5h30mAn optional duration specifying how long browsers can cache the results of a preflight request. This configures the
Access-Control-Max-Ageheader.allow_credentialsboolean optionalExample:
FalseWhether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include. This configures the
Access-Control-Allow-Credentialsheader.
routesarray of objects optional deprecated(Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
Show child properties
pathstring optionalExample:
/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_prefixboolean optionalExample:
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=/apiwill have requests to/api/listtrimmed to/list. If this value istrue, the path will remain/api/list.
namestring requiredExample:
apiThe name. Must be unique across all components within the same app.
source_dirstring optionalExample:
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.
alertsarray of objects optionalShow child properties
rulestring optionaldisabledboolean optionalExample:
FalseIs the alert disabled?
operatorstring optionalvaluenumber optionalExample:
2.32Threshold value for alert
windowstring optional
envsarray of objects optionalA list of environment variables made available to the component.
Show child properties
keystring requiredExample:
BASE_URLThe variable name
scopestring optional- 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-timetypestring optional- GENERAL: A plain-text environment variable
- SECRET: A secret encrypted environment variablevaluestring optionalExample:
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.
gitobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
repo_clone_urlstring optionalExample:
https://github.com/digitalocean/sample-golang.gitThe clone URL of the repo. Example:
https://github.com/digitalocean/sample-golang.git
githubobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
gitlabobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
bitbucketobject optionalShow child properties
branchstring optionalExample:
mainThe name of the branch to use
deploy_on_pushboolean optionalExample:
TrueWhether to automatically deploy new commits made to the repo
repostring optionalExample:
digitalocean/sample-golangThe name of the repo in the format owner/repo. Example:
digitalocean/sample-golang
log_destinationsarray of objects optionalA list of configured log forwarding destinations.
Show child properties
namestring requiredExample:
my_log_destinationpapertrailobject optionalPapertrail configuration.
datadogobject optionalDataDog configuration.
logtailobject optionalLogtail configuration.
open_searchobject optionalOpenSearch configuration.
databasesarray of objects optionalDatabase instances which can provide persistence to workloads within the
application.Show child properties
cluster_namestring optionalExample:
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_namestring optionalExample:
my_dbThe name of the MySQL or PostgreSQL database to configure.
db_userstring optionalExample:
superuserThe name of the MySQL or PostgreSQL user to configure.
enginestring optional- MYSQL: MySQL
- PG: PostgreSQL
- REDIS: Caching
- MONGODB: MongoDB
- KAFKA: Kafka
- OPENSEARCH: OpenSearch
- VALKEY: ValKeynamestring requiredExample:
prod-dbThe database's name. The name must be unique across all components within the same app and cannot use capital letters.
productionboolean optionalExample:
TrueWhether this is a production or dev database.
versionstring optionalExample:
12The version of the database engine
ingressobject optionalSpecification for app ingress configurations.
Show child properties
rulesarray of objects optionalRules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
Show child properties
matchobject optionalThe match configuration for the rule.
corsobject optionalcomponentobject optionalThe component to route to. Only one of
componentorredirectmay be set.redirectobject optionalThe redirect configuration for the rule. Only one of
componentorredirectmay be set.
egressobject optionalSpecification for app egress configurations.
Show child properties
typestring optional
maintenanceobject optionalSpecification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
Show child properties
enabledboolean optionalExample:
TrueIndicates whether maintenance mode should be enabled for the app.
archiveboolean optionalExample:
TrueIndicates whether the app should be archived. Setting this to true implies that enabled is set to true.
offline_page_urlstring optionalExample:
https://example.com/offline.htmlA custom offline page to display when maintenance mode is enabled or the app is archived.
vpcobject optional read-onlyShow child properties
idstring optionalExample:
c22d8f48-4bc4-49f5-8ca0-58e7164427acegress_ipsarray of objects optionalShow child properties
ipstring optionalExample:
10.0.0.1
project_idstring optionalThe ID of the project the app should be assigned to. If omitted, it will be assigned to your default project.
Requiresproject:updatescope.
Request Sample
Response Example
More Information
See /v2/apps in the API reference for additional detail on responses, headers, parameters, and more.