---
title: "Update app"
method: PATCH
path: "/v2/apps/{app}"
tags: ["apps"]
---

# Update app

`PATCH /v2/apps/{app}`

All fields are optional. `labels` and `layers` replace the entire value. `env_vars` performs a deep merge with existing variables. `config` replaces the entire deploy config (no deep merge).

Updating `layers` or `env_vars` will restart running isolates.

## Path parameters

- `app` string, required

## Request body

- object
  - `slug` string — New app slug. App slugs must be 3–32 characters long, may contain only lowercase letters, numbers, and hyphens, cannot contain underscores, must not start or end with a hyphen, must not have consecutive hyphens in positions 3 and 4, and cannot be a reserved slug.
  - `labels` Labels
  - `layers` LayerRefInput[] — Replace all layer references
    - union
      - string — Layer ID to reference
      - string — Layer slug to reference
  - `env_vars` EnvVarUpdate[] — Deep merge with existing environment variables
    - `id` string — ID of the existing variable to update or delete
    - `key` string — Variable name. Used for matching when `id` is not provided
    - `value` string — New value for the variable
    - `secret` boolean — Whether to mask the value in API responses
    - `contexts` union — Deployment contexts this variable applies to
      - 'all'
      - string[]
    - `delete` boolean — Set to true to remove this variable
  - `config` Config
    - `framework` '' | 'nextjs' | 'astro' | 'nuxt' | 'remix' | 'solidstart' | 'tanstackstart' | 'sveltekit' | 'fresh' | 'lume' — Framework preset. Mutually exclusive with `runtime`
    - `install` string, nullable — Custom install command. Omit to skip the install step
    - `build` string, nullable — Custom build command. Omit to skip the build step
    - `predeploy` string, nullable — Command to run before each deployment (e.g. database migrations). Omit to skip
    - `runtime` Runtime
      - `type` 'dynamic' | 'static', required — `dynamic` runs a Deno process; `static` serves pre-built files
      - `entrypoint` string — Main module path. Required when `type` is `dynamic`
      - `args` string[] — Additional CLI arguments passed to the entrypoint
      - `cwd` string — Working directory or static file root. Required when `type` is `static`
      - `spa` boolean — Enable single-page application mode (fallback to index.html). Only for `static` type
    - `crons` boolean — Whether cron jobs are enabled for revisions of the app. When false, revisions that register cron jobs using Deno.cron fail to build. Defaults to true

## Response `200`

OK

- App
  - `id` string, uuid, required — Unique app identifier (UUID)
  - `slug` string, required — Human-readable app slug. App slugs must be 3–32 characters long, may contain only lowercase letters, numbers, and hyphens, cannot contain underscores, must not start or end with a hyphen, must not have consecutive hyphens in positions 3 and 4, and cannot be a reserved slug.
  - `labels` Labels
  - `layers` LayerRef[], required — Layers referenced by this app, in priority order (later overrides earlier)
    - `id` string, required — Unique layer identifier
    - `slug` string, required — Human-readable layer slug
  - `env_vars` EnvVar[] — App-specific environment variables
    - `id` string, required — Unique identifier for the environment variable
    - `key` string, required — The environment variable name
    - `value` string — The value. Omitted when `secret` is true
    - `secret` boolean, required — Whether the value is masked in API responses
    - `contexts` union, required — Deployment contexts this variable applies to. `"all"` means every context.
      - 'all'
      - string[]
  - `config` ConfigOutput
    - `framework` '' | 'nextjs' | 'astro' | 'nuxt' | 'remix' | 'solidstart' | 'tanstackstart' | 'sveltekit' | 'fresh' | 'lume' — Framework preset used for this build
    - `install` string, nullable — Install command. Null if skipped
    - `build` string, nullable — Build command. Null if skipped
    - `predeploy` string, nullable — Pre-deploy command. Null if skipped
    - `runtime` Runtime
      - `type` 'dynamic' | 'static', required — `dynamic` runs a Deno process; `static` serves pre-built files
      - `entrypoint` string — Main module path. Required when `type` is `dynamic`
      - `args` string[] — Additional CLI arguments passed to the entrypoint
      - `cwd` string — Working directory or static file root. Required when `type` is `static`
      - `spa` boolean — Enable single-page application mode (fallback to index.html). Only for `static` type
    - `crons` boolean — Whether cron jobs are enabled for revisions of the app. When false, revisions that register cron jobs using Deno.cron fail to build. Defaults to true
  - `updated_at` string, required — ISO 8601 timestamp of last modification
  - `created_at` string, required — ISO 8601 timestamp of creation

---

[API](https://skmtc.net/deno/apis/deploy.md) · [All operations](https://skmtc.net/deno/apis/deploy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deno/deploy/revisions/5a56038d108e/schema)
