---
title: "Rollback App"
method: POST
path: "/v2/apps/{app_id}/rollback"
tags: ["DigitalOcean-public.v2-new_Apps"]
---

# Rollback App

`POST /v2/apps/{app_id}/rollback`

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` string, required

## Request body

- AppsRollbackAppRequest
  - `deployment_id` string — The ID of the deployment to rollback to.
  - `skip_pin` boolean — Whether 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.

## Response `200`

A JSON object with a `deployment` key.

- AppsDeploymentResponse
  - `deployment` AppsDeployment
    - `cause` string
    - `cloned_from` string
    - `created_at` string, date-time
    - `id` string
    - `jobs` AppsDeploymentJob[]
      - `name` string
      - `source_commit_hash` string
    - `functions` AppsDeploymentFunctions[]
      - `name` string
      - `source_commit_hash` string — The commit hash of the repository that was used to build this functions component.
      - `namespace` string — The namespace where the functions are deployed.
    - `phase` 'UNKNOWN' | 'PENDING_BUILD' | 'BUILDING' | 'PENDING_DEPLOY' | 'DEPLOYING' | 'ACTIVE' | 'SUPERSEDED' | 'ERROR' | 'CANCELED'
    - `phase_last_updated_at` string, date-time
    - `progress` AppsDeploymentProgress
      - `error_steps` integer
      - `pending_steps` integer
      - `running_steps` integer
      - `steps` AppsDeploymentProgressStep[]
        - `component_name` string
        - `ended_at` string, date-time
        - `message_base` string — The 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` string
        - `reason` AppsDeploymentProgressStepReason
          - `code` string
          - `message` string
        - `started_at` string, date-time
        - `status` 'UNKNOWN' | 'PENDING' | 'RUNNING' | 'ERROR' | 'SUCCESS'
        - `steps` object[]
      - `success_steps` integer
      - `summary_steps` AppsDeploymentProgressStep[]
        - `component_name` string
        - `ended_at` string, date-time
        - `message_base` string — The 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` string
        - `reason` AppsDeploymentProgressStepReason
          - `code` string
          - `message` string
        - `started_at` string, date-time
        - `status` 'UNKNOWN' | 'PENDING' | 'RUNNING' | 'ERROR' | 'SUCCESS'
        - `steps` object[]
      - `total_steps` integer
    - `services` AppsDeploymentService[]
      - `name` string
      - `source_commit_hash` string
    - `spec` AppSpec — The desired configuration of an application.
      - `name` string, required — The name of the app. Must be unique across all apps in the same account.
      - `region` 'atl' | 'nyc' | 'sfo' | 'tor' | 'ams' | 'fra' | 'lon' | 'blr' | 'sgp' | 'syd' — The slug form of the geographical origin of the app. Default: `nearest available`
      - `disable_edge_cache` boolean — 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](https://docs.digitalocean.com/products/app-platform/how-to/cache-content/#disable-cdn-cache).
      - `disable_email_obfuscation` boolean — 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).
      - `enhanced_threat_control_enabled` boolean — If set to `true`, suspicious requests will go through additional security checks to help mitigate layer 7 DDoS attacks.
      - `domains` AppDomainSpec[] — A set of hostnames where the application will be available.
        - `domain` string, required — The hostname for the domain
        - `type` 'UNSPECIFIED' | 'DEFAULT' | 'PRIMARY' | 'ALIAS' — - DEFAULT: The default `.ondigitalocean.app` domain 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` boolean — Indicates whether the domain includes all sub-domains, in addition to the given domain
        - `zone` string, hostname — Optional. 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`.
        - `minimum_tls_version` '1.2' | '1.3' — The 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"`.
      - `services` AppServiceSpec[] — Workloads which expose publicly-accessible HTTP services.
        - `name` string, required — The name. Must be unique across all components within the same app.
        - `git` AppsGitSourceSpec
          - `branch` string — The name of the branch to use
          - `repo_clone_url` string — The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git`
        - `github` AppsGithubSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `gitlab` AppsGitlabSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `bitbucket` AppsBitbucketSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `image` AppsImageSourceSpec
          - `registry` string — The registry name. Must be left empty for the `DOCR` registry type.
          - `registry_type` 'DOCKER_HUB' | 'DOCR' | 'GHCR' — - DOCKER_HUB: The DockerHub container registry type. - DOCR: The DigitalOcean container registry type. - GHCR: The Github container registry type.
          - `registry_credentials` string — The 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`.
          - `repository` string — The repository name.
          - `tag` string — The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
          - `digest` string — The image digest. Cannot be specified if tag is provided.
          - `deploy_on_push` object
            - `enabled` boolean — Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest.
        - `dockerfile_path` string — The 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_command` string — An optional build command to run while building this component from source.
        - `run_command` string — An optional run command to override the component's default.
        - `source_dir` string — An 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.
        - `envs` AppVariableDefinition[] — A list of environment variables made available to the component.
          - `key` string, required — The variable name
          - `scope` 'UNSET' | 'RUN_TIME' | 'BUILD_TIME' | 'RUN_AND_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` 'GENERAL' | 'SECRET' — - GENERAL: A plain-text environment variable - SECRET: A secret encrypted environment variable
          - `value` string — The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
        - `environment_slug` string — An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/).
        - `log_destinations` AppLogDestinationDefinition[] — A list of configured log forwarding destinations.
          - `name` string, required
          - `papertrail` AppLogDestinationPapertrailSpec — Papertrail configuration.
            - `endpoint` string, required — Papertrail syslog endpoint.
          - `datadog` AppLogDestinationDatadogSpec — DataDog configuration.
            - `endpoint` string — Datadog HTTP log intake endpoint.
            - `api_key` string, required — Datadog API key.
          - `logtail` AppLogDestinationLogtailSpec — Logtail configuration.
            - `token` string — Logtail token.
          - `open_search` AppLogDestinationOpenSearchSpec — OpenSearch configuration.
            - `endpoint` string — OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>. Cannot be specified if `cluster_name` is also specified.
            - `basic_auth` AppLogDestinationOpenSearchSpecBasicAuth — Configure Username and/or Password for Basic authentication.
              - …
            - `index_name` string — The index name to use for the logs. If not set, the default index name is "logs".
            - `cluster_name` string — The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
        - `instance_count` integer — The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
        - `instance_size_slug` union — The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb`
          - 'apps-s-1vcpu-0.5gb' | 'apps-s-1vcpu-1gb-fixed' | 'apps-s-1vcpu-1gb' | 'apps-s-1vcpu-2gb' | 'apps-s-2vcpu-4gb' | 'apps-d-1vcpu-0.5gb' | 'apps-d-1vcpu-1gb' | 'apps-d-1vcpu-2gb' | 'apps-d-1vcpu-4gb' | 'apps-d-2vcpu-4gb' | 'apps-d-2vcpu-8gb' | 'apps-d-4vcpu-8gb' | 'apps-d-4vcpu-16gb' | 'apps-d-8vcpu-32gb'
          - 'basic-xxs' | 'basic-xs' | 'basic-s' | 'basic-m' | 'professional-xs' | 'professional-s' | 'professional-m' | 'professional-1l' | 'professional-l' | 'professional-xl' — Deprecated size slugs for legacy plans. We strongly encourage customers to use the new plans when creating or upgrading apps.
        - `autoscaling` object — Configuration for automatically scaling this component based on metrics.
          - `min_instance_count` integer — The minimum amount of instances for this component. Must be less than max_instance_count.
          - `max_instance_count` integer — The maximum amount of instances for this component. Must be more than min_instance_count.
          - `metrics` object — The metrics that the component is scaled on.
            - `cpu` object — Settings for scaling the component based on CPU utilization.
              - …
        - `cors` object — (Deprecated - Use Ingress Rules instead).
          - `allow_origins` AppsStringMatch[] — The set of allowed CORS origins.
            - `exact` string — Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set.
            - `prefix` string — Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set.
            - `regex` string — RE2 style regex-based match. Only 1 of `exact`, `prefix`, or `regex` must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
          - `allow_methods` string[] — The set of allowed HTTP methods. This configures the `Access-Control-Allow-Methods` header.
          - `allow_headers` string[] — The set of allowed HTTP request headers. This configures the `Access-Control-Allow-Headers` header.
          - `expose_headers` string[] — The set of HTTP response headers that browsers are allowed to access. This configures the `Access-Control-Expose-Headers` header.
          - `max_age` string — An optional duration specifying how long browsers can cache the results of a preflight request. This configures the `Access-Control-Max-Age` header.
          - `allow_credentials` boolean — Whether 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-Credentials` header.
        - `health_check` AppServiceSpecHealthCheck
          - `failure_threshold` integer — The number of failed health checks before considered unhealthy.
          - `port` integer — The 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_path` string — The 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` integer — The number of seconds to wait before beginning health checks.
          - `period_seconds` integer — The number of seconds to wait between health checks.
          - `success_threshold` integer — The number of successful health checks before considered healthy.
          - `timeout_seconds` integer — The number of seconds after which the check times out.
        - `liveness_health_check` AppHealthCheckSpec
          - `failure_threshold` integer — The number of failed health checks before considered unhealthy.
          - `port` integer — The port on which the health check will be performed.
          - `http_path` string — The 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` integer — The number of seconds to wait before beginning health checks.
          - `period_seconds` integer — The number of seconds to wait between health checks.
          - `success_threshold` integer — The number of successful health checks before considered healthy.
          - `timeout_seconds` integer — The number of seconds after which the check times out.
        - `protocol` 'HTTP' | 'HTTP2' — The 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_port` integer — The 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` integer[] — The ports on which this service will listen for internal traffic.
        - `routes` AppRouteSpec[] — (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
          - `path` string — (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` boolean — An 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` AppServiceSpecTermination
          - `drain_seconds` integer — The 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` integer — The 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` AppStaticSiteSpec[] — Content which can be rendered to static web assets.
        - `name` string, required — The name. Must be unique across all components within the same app.
        - `git` AppsGitSourceSpec
          - `branch` string — The name of the branch to use
          - `repo_clone_url` string — The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git`
        - `github` AppsGithubSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `gitlab` AppsGitlabSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `bitbucket` AppsBitbucketSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `image` AppsImageSourceSpec
          - `registry` string — The registry name. Must be left empty for the `DOCR` registry type.
          - `registry_type` 'DOCKER_HUB' | 'DOCR' | 'GHCR' — - DOCKER_HUB: The DockerHub container registry type. - DOCR: The DigitalOcean container registry type. - GHCR: The Github container registry type.
          - `registry_credentials` string — The 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`.
          - `repository` string — The repository name.
          - `tag` string — The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
          - `digest` string — The image digest. Cannot be specified if tag is provided.
          - `deploy_on_push` object
            - `enabled` boolean — Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest.
        - `dockerfile_path` string — The 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_command` string — An optional build command to run while building this component from source.
        - `run_command` string — An optional run command to override the component's default.
        - `source_dir` string — An 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.
        - `envs` AppVariableDefinition[] — A list of environment variables made available to the component.
          - `key` string, required — The variable name
          - `scope` 'UNSET' | 'RUN_TIME' | 'BUILD_TIME' | 'RUN_AND_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` 'GENERAL' | 'SECRET' — - GENERAL: A plain-text environment variable - SECRET: A secret encrypted environment variable
          - `value` string — The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
        - `environment_slug` string — An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/).
        - `log_destinations` AppLogDestinationDefinition[] — A list of configured log forwarding destinations.
          - `name` string, required
          - `papertrail` AppLogDestinationPapertrailSpec — Papertrail configuration.
            - `endpoint` string, required — Papertrail syslog endpoint.
          - `datadog` AppLogDestinationDatadogSpec — DataDog configuration.
            - `endpoint` string — Datadog HTTP log intake endpoint.
            - `api_key` string, required — Datadog API key.
          - `logtail` AppLogDestinationLogtailSpec — Logtail configuration.
            - `token` string — Logtail token.
          - `open_search` AppLogDestinationOpenSearchSpec — OpenSearch configuration.
            - `endpoint` string — OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>. Cannot be specified if `cluster_name` is also specified.
            - `basic_auth` AppLogDestinationOpenSearchSpecBasicAuth — Configure Username and/or Password for Basic authentication.
              - …
            - `index_name` string — The index name to use for the logs. If not set, the default index name is "logs".
            - `cluster_name` string — The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
        - `index_document` string — The name of the index document to use when serving this static site. Default: index.html
        - `error_document` string — The 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_document` string — The 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.
        - `output_dir` string — 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`.
        - `cors` object — (Deprecated - Use Ingress Rules instead).
          - `allow_origins` AppsStringMatch[] — The set of allowed CORS origins.
            - `exact` string — Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set.
            - `prefix` string — Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set.
            - `regex` string — RE2 style regex-based match. Only 1 of `exact`, `prefix`, or `regex` must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
          - `allow_methods` string[] — The set of allowed HTTP methods. This configures the `Access-Control-Allow-Methods` header.
          - `allow_headers` string[] — The set of allowed HTTP request headers. This configures the `Access-Control-Allow-Headers` header.
          - `expose_headers` string[] — The set of HTTP response headers that browsers are allowed to access. This configures the `Access-Control-Expose-Headers` header.
          - `max_age` string — An optional duration specifying how long browsers can cache the results of a preflight request. This configures the `Access-Control-Max-Age` header.
          - `allow_credentials` boolean — Whether 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-Credentials` header.
        - `routes` AppRouteSpec[] — (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
          - `path` string — (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` boolean — An 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`.
      - `jobs` AppJobSpec[] — Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
        - `name` string, required — The name. Must be unique across all components within the same app.
        - `git` AppsGitSourceSpec
          - `branch` string — The name of the branch to use
          - `repo_clone_url` string — The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git`
        - `github` AppsGithubSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `gitlab` AppsGitlabSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `bitbucket` AppsBitbucketSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `image` AppsImageSourceSpec
          - `registry` string — The registry name. Must be left empty for the `DOCR` registry type.
          - `registry_type` 'DOCKER_HUB' | 'DOCR' | 'GHCR' — - DOCKER_HUB: The DockerHub container registry type. - DOCR: The DigitalOcean container registry type. - GHCR: The Github container registry type.
          - `registry_credentials` string — The 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`.
          - `repository` string — The repository name.
          - `tag` string — The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
          - `digest` string — The image digest. Cannot be specified if tag is provided.
          - `deploy_on_push` object
            - `enabled` boolean — Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest.
        - `dockerfile_path` string — The 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_command` string — An optional build command to run while building this component from source.
        - `run_command` string — An optional run command to override the component's default.
        - `source_dir` string — An 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.
        - `envs` AppVariableDefinition[] — A list of environment variables made available to the component.
          - `key` string, required — The variable name
          - `scope` 'UNSET' | 'RUN_TIME' | 'BUILD_TIME' | 'RUN_AND_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` 'GENERAL' | 'SECRET' — - GENERAL: A plain-text environment variable - SECRET: A secret encrypted environment variable
          - `value` string — The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
        - `environment_slug` string — An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/).
        - `log_destinations` AppLogDestinationDefinition[] — A list of configured log forwarding destinations.
          - `name` string, required
          - `papertrail` AppLogDestinationPapertrailSpec — Papertrail configuration.
            - `endpoint` string, required — Papertrail syslog endpoint.
          - `datadog` AppLogDestinationDatadogSpec — DataDog configuration.
            - `endpoint` string — Datadog HTTP log intake endpoint.
            - `api_key` string, required — Datadog API key.
          - `logtail` AppLogDestinationLogtailSpec — Logtail configuration.
            - `token` string — Logtail token.
          - `open_search` AppLogDestinationOpenSearchSpec — OpenSearch configuration.
            - `endpoint` string — OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>. Cannot be specified if `cluster_name` is also specified.
            - `basic_auth` AppLogDestinationOpenSearchSpecBasicAuth — Configure Username and/or Password for Basic authentication.
              - …
            - `index_name` string — The index name to use for the logs. If not set, the default index name is "logs".
            - `cluster_name` string — The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
        - `instance_count` integer — The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
        - `instance_size_slug` union — The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb`
          - 'apps-s-1vcpu-0.5gb' | 'apps-s-1vcpu-1gb-fixed' | 'apps-s-1vcpu-1gb' | 'apps-s-1vcpu-2gb' | 'apps-s-2vcpu-4gb' | 'apps-d-1vcpu-0.5gb' | 'apps-d-1vcpu-1gb' | 'apps-d-1vcpu-2gb' | 'apps-d-1vcpu-4gb' | 'apps-d-2vcpu-4gb' | 'apps-d-2vcpu-8gb' | 'apps-d-4vcpu-8gb' | 'apps-d-4vcpu-16gb' | 'apps-d-8vcpu-32gb'
          - 'basic-xxs' | 'basic-xs' | 'basic-s' | 'basic-m' | 'professional-xs' | 'professional-s' | 'professional-m' | 'professional-1l' | 'professional-l' | 'professional-xl' — Deprecated size slugs for legacy plans. We strongly encourage customers to use the new plans when creating or upgrading apps.
        - `autoscaling` object — Configuration for automatically scaling this component based on metrics.
          - `min_instance_count` integer — The minimum amount of instances for this component. Must be less than max_instance_count.
          - `max_instance_count` integer — The maximum amount of instances for this component. Must be more than min_instance_count.
          - `metrics` object — The metrics that the component is scaled on.
            - `cpu` object — Settings for scaling the component based on CPU utilization.
              - …
        - `kind` 'UNSPECIFIED' | 'PRE_DEPLOY' | 'POST_DEPLOY' | 'FAILED_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` AppJobSpecTermination
          - `grace_period_seconds` integer — The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120)
      - `workers` AppWorkerSpec[] — Workloads which do not expose publicly-accessible HTTP services.
        - `name` string, required — The name. Must be unique across all components within the same app.
        - `git` AppsGitSourceSpec
          - `branch` string — The name of the branch to use
          - `repo_clone_url` string — The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git`
        - `github` AppsGithubSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `gitlab` AppsGitlabSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `bitbucket` AppsBitbucketSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `image` AppsImageSourceSpec
          - `registry` string — The registry name. Must be left empty for the `DOCR` registry type.
          - `registry_type` 'DOCKER_HUB' | 'DOCR' | 'GHCR' — - DOCKER_HUB: The DockerHub container registry type. - DOCR: The DigitalOcean container registry type. - GHCR: The Github container registry type.
          - `registry_credentials` string — The 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`.
          - `repository` string — The repository name.
          - `tag` string — The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
          - `digest` string — The image digest. Cannot be specified if tag is provided.
          - `deploy_on_push` object
            - `enabled` boolean — Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest.
        - `dockerfile_path` string — The 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_command` string — An optional build command to run while building this component from source.
        - `run_command` string — An optional run command to override the component's default.
        - `source_dir` string — An 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.
        - `envs` AppVariableDefinition[] — A list of environment variables made available to the component.
          - `key` string, required — The variable name
          - `scope` 'UNSET' | 'RUN_TIME' | 'BUILD_TIME' | 'RUN_AND_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` 'GENERAL' | 'SECRET' — - GENERAL: A plain-text environment variable - SECRET: A secret encrypted environment variable
          - `value` string — The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
        - `environment_slug` string — An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/).
        - `log_destinations` AppLogDestinationDefinition[] — A list of configured log forwarding destinations.
          - `name` string, required
          - `papertrail` AppLogDestinationPapertrailSpec — Papertrail configuration.
            - `endpoint` string, required — Papertrail syslog endpoint.
          - `datadog` AppLogDestinationDatadogSpec — DataDog configuration.
            - `endpoint` string — Datadog HTTP log intake endpoint.
            - `api_key` string, required — Datadog API key.
          - `logtail` AppLogDestinationLogtailSpec — Logtail configuration.
            - `token` string — Logtail token.
          - `open_search` AppLogDestinationOpenSearchSpec — OpenSearch configuration.
            - `endpoint` string — OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>. Cannot be specified if `cluster_name` is also specified.
            - `basic_auth` AppLogDestinationOpenSearchSpecBasicAuth — Configure Username and/or Password for Basic authentication.
              - …
            - `index_name` string — The index name to use for the logs. If not set, the default index name is "logs".
            - `cluster_name` string — The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
        - `instance_count` integer — The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.
        - `instance_size_slug` union — The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb`
          - 'apps-s-1vcpu-0.5gb' | 'apps-s-1vcpu-1gb-fixed' | 'apps-s-1vcpu-1gb' | 'apps-s-1vcpu-2gb' | 'apps-s-2vcpu-4gb' | 'apps-d-1vcpu-0.5gb' | 'apps-d-1vcpu-1gb' | 'apps-d-1vcpu-2gb' | 'apps-d-1vcpu-4gb' | 'apps-d-2vcpu-4gb' | 'apps-d-2vcpu-8gb' | 'apps-d-4vcpu-8gb' | 'apps-d-4vcpu-16gb' | 'apps-d-8vcpu-32gb'
          - 'basic-xxs' | 'basic-xs' | 'basic-s' | 'basic-m' | 'professional-xs' | 'professional-s' | 'professional-m' | 'professional-1l' | 'professional-l' | 'professional-xl' — Deprecated size slugs for legacy plans. We strongly encourage customers to use the new plans when creating or upgrading apps.
        - `autoscaling` object — Configuration for automatically scaling this component based on metrics.
          - `min_instance_count` integer — The minimum amount of instances for this component. Must be less than max_instance_count.
          - `max_instance_count` integer — The maximum amount of instances for this component. Must be more than min_instance_count.
          - `metrics` object — The metrics that the component is scaled on.
            - `cpu` object — Settings for scaling the component based on CPU utilization.
              - …
        - `termination` AppWorkerSpecTermination
          - `grace_period_seconds` integer — The 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_check` AppHealthCheckSpec
          - `failure_threshold` integer — The number of failed health checks before considered unhealthy.
          - `port` integer — The port on which the health check will be performed.
          - `http_path` string — The 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` integer — The number of seconds to wait before beginning health checks.
          - `period_seconds` integer — The number of seconds to wait between health checks.
          - `success_threshold` integer — The number of successful health checks before considered healthy.
          - `timeout_seconds` integer — The number of seconds after which the check times out.
      - `functions` AppFunctionsSpec[] — Workloads which expose publicly-accessible HTTP services via Functions Components.
        - `cors` object — (Deprecated - Use Ingress Rules instead).
          - `allow_origins` AppsStringMatch[] — The set of allowed CORS origins.
            - `exact` string — Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set.
            - `prefix` string — Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set.
            - `regex` string — RE2 style regex-based match. Only 1 of `exact`, `prefix`, or `regex` must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
          - `allow_methods` string[] — The set of allowed HTTP methods. This configures the `Access-Control-Allow-Methods` header.
          - `allow_headers` string[] — The set of allowed HTTP request headers. This configures the `Access-Control-Allow-Headers` header.
          - `expose_headers` string[] — The set of HTTP response headers that browsers are allowed to access. This configures the `Access-Control-Expose-Headers` header.
          - `max_age` string — An optional duration specifying how long browsers can cache the results of a preflight request. This configures the `Access-Control-Max-Age` header.
          - `allow_credentials` boolean — Whether 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-Credentials` header.
        - `routes` AppRouteSpec[] — (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
          - `path` string — (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` boolean — An 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`.
        - `name` string, required — The name. Must be unique across all components within the same app.
        - `source_dir` string — An 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.
        - `alerts` AppAlertSpec[]
          - `rule` 'UNSPECIFIED_RULE' | 'CPU_UTILIZATION' | 'MEM_UTILIZATION' | 'RESTART_COUNT' | 'DEPLOYMENT_FAILED' | 'DEPLOYMENT_LIVE' | 'DOMAIN_FAILED' | 'DOMAIN_LIVE' | 'AUTOSCALE_FAILED' | 'AUTOSCALE_SUCCEEDED' | 'FUNCTIONS_ACTIVATION_COUNT' | 'FUNCTIONS_AVERAGE_DURATION_MS' | 'FUNCTIONS_ERROR_RATE_PER_MINUTE' | 'FUNCTIONS_AVERAGE_WAIT_TIME_MS' | 'FUNCTIONS_ERROR_COUNT' | 'FUNCTIONS_GB_RATE_PER_SECOND'
          - `disabled` boolean — Is the alert disabled?
          - `operator` 'UNSPECIFIED_OPERATOR' | 'GREATER_THAN' | 'LESS_THAN'
          - `value` number, float — Threshold value for alert
          - `window` 'UNSPECIFIED_WINDOW' | 'FIVE_MINUTES' | 'TEN_MINUTES' | 'THIRTY_MINUTES' | 'ONE_HOUR'
        - `envs` AppVariableDefinition[] — A list of environment variables made available to the component.
          - `key` string, required — The variable name
          - `scope` 'UNSET' | 'RUN_TIME' | 'BUILD_TIME' | 'RUN_AND_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` 'GENERAL' | 'SECRET' — - GENERAL: A plain-text environment variable - SECRET: A secret encrypted environment variable
          - `value` string — The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
        - `git` AppsGitSourceSpec
          - `branch` string — The name of the branch to use
          - `repo_clone_url` string — The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git`
        - `github` AppsGithubSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `gitlab` AppsGitlabSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `bitbucket` AppsBitbucketSourceSpec
          - `branch` string — The name of the branch to use
          - `deploy_on_push` boolean — Whether to automatically deploy new commits made to the repo
          - `repo` string — The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`
        - `log_destinations` AppLogDestinationDefinition[] — A list of configured log forwarding destinations.
          - `name` string, required
          - `papertrail` AppLogDestinationPapertrailSpec — Papertrail configuration.
            - `endpoint` string, required — Papertrail syslog endpoint.
          - `datadog` AppLogDestinationDatadogSpec — DataDog configuration.
            - `endpoint` string — Datadog HTTP log intake endpoint.
            - `api_key` string, required — Datadog API key.
          - `logtail` AppLogDestinationLogtailSpec — Logtail configuration.
            - `token` string — Logtail token.
          - `open_search` AppLogDestinationOpenSearchSpec — OpenSearch configuration.
            - `endpoint` string — OpenSearch API Endpoint. Only HTTPS is supported. Format: https://<host>:<port>. Cannot be specified if `cluster_name` is also specified.
            - `basic_auth` AppLogDestinationOpenSearchSpecBasicAuth — Configure Username and/or Password for Basic authentication.
              - …
            - `index_name` string — The index name to use for the logs. If not set, the default index name is "logs".
            - `cluster_name` string — The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
      - `databases` AppDatabaseSpec[] — Database instances which can provide persistence to workloads within the application.
        - `cluster_name` string — The 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` string — The name of the MySQL or PostgreSQL database to configure.
        - `db_user` string — The name of the MySQL or PostgreSQL user to configure.
        - `engine` 'UNSET' | 'MYSQL' | 'PG' | 'REDIS' | 'MONGODB' | 'KAFKA' | 'OPENSEARCH' | 'VALKEY' — - MYSQL: MySQL - PG: PostgreSQL - REDIS: Caching - MONGODB: MongoDB - KAFKA: Kafka - OPENSEARCH: OpenSearch - VALKEY: ValKey
        - `name` string, required — The database's name. The name must be unique across all components within the same app and cannot use capital letters.
        - `production` boolean — Whether this is a production or dev database.
        - `version` string — The version of the database engine
      - `ingress` AppIngressSpec — Specification for app ingress configurations.
        - `rules` AppIngressSpecRule[] — Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
          - `match` AppIngressSpecRuleMatch — The match configuration for the rule.
            - `path` AppIngressSpecRuleStringMatchPrefix — The path to match on.
              - …
            - `authority` AppIngressSpecRuleStringMatchExact — The authority to match on.
              - …
          - `cors` AppsCorsPolicy
            - `allow_origins` AppsStringMatch[] — The set of allowed CORS origins.
              - …
            - `allow_methods` string[] — The set of allowed HTTP methods. This configures the `Access-Control-Allow-Methods` header.
            - `allow_headers` string[] — The set of allowed HTTP request headers. This configures the `Access-Control-Allow-Headers` header.
            - `expose_headers` string[] — The set of HTTP response headers that browsers are allowed to access. This configures the `Access-Control-Expose-Headers` header.
            - `max_age` string — An optional duration specifying how long browsers can cache the results of a preflight request. This configures the `Access-Control-Max-Age` header.
            - `allow_credentials` boolean — Whether 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-Credentials` header.
          - `component` AppIngressSpecRuleRoutingComponent — The component to route to. Only one of `component` or `redirect` may be set.
            - `name` string, required — The name of the component to route to.
            - `preserve_path_prefix` string — An 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`. Note: this is not applicable for Functions Components and is mutually exclusive with `rewrite`.
            - `rewrite` string — An optional field that will rewrite the path of the component to be what is specified here. 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 you specified the rewrite to be `/v1/`, requests to `/api/list` would be rewritten to `/v1/list`. Note: this is mutually exclusive with `preserve_path_prefix`.
          - `redirect` AppIngressSpecRuleRoutingRedirect — The redirect configuration for the rule. Only one of `component` or `redirect` may be set.
            - `uri` string — An optional URI path to redirect to. Note: if this is specified the whole URI of the original request will be overwritten to this value, irrespective of the original request URI being matched.
            - `authority` string — The authority/host to redirect to. This can be a hostname or IP address. Note: use `port` to set the port.
            - `port` integer — The port to redirect to.
            - `scheme` string — The scheme to redirect to. Supported values are `http` or `https`. Default: `https`.
            - `redirect_code` integer — The redirect code to use. Defaults to `302`. Supported values are 300, 301, 302, 303, 304, 307, 308.
      - `egress` AppEgressSpec — Specification for app egress configurations.
        - `type` 'AUTOASSIGN' | 'DEDICATED_IP'
      - `maintenance` AppMaintenanceSpec — Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app.
        - `enabled` boolean — Indicates whether maintenance mode should be enabled for the app.
        - `archive` boolean — Indicates whether the app should be archived. Setting this to true implies that enabled is set to true.
        - `offline_page_url` string — A custom offline page to display when maintenance mode is enabled or the app is archived.
      - `vpc` AppsVpc
        - `id` string
        - `egress_ips` AppsVpcEgressIp[]
          - `ip` string
    - `static_sites` AppsDeploymentStaticSite[]
      - `name` string
      - `source_commit_hash` string
    - `tier_slug` string
    - `updated_at` string, date-time
    - `workers` AppsDeploymentWorker[]
      - `name` string
      - `source_commit_hash` string

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `404` — The resource was not found.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/versions/cb3bf9b21459/schema)
