---
title: "Update app"
method: POST
path: "/v2/apps.updateApp"
tags: ["apps"]
---

# Update app

`POST /v2/apps.updateApp`

Update an existing app, identified by its id.

The app name, slug, default branch, and delete protection setting can be changed. Omitted fields are left unchanged. Changing the slug affects the deployment domains generated for this app.

**Important**: The slug cannot collide with an existing app in the same project. A duplicate slug returns a 409 conflict.

**Required Permissions**

Your root key must have one of the following permissions:
- `app.*.update_app` (to update any app)
- `app.<app_id>.update_app` (to update a specific app)

## Request body

- V2AppsUpdateAppRequestBody
  - `project` string, required — Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.
  - `app` string, required — Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.
  - `name` string — New human-readable name for the app. Omit this field to leave the current name unchanged.
  - `slug` string — Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.
  - `git` AppGitUpdateInput
    - `repository` string — The GitHub repository to connect, as "owner/repo". Omit to change only the tracked branch of the already-connected repository. The workspace must have the Unkey GitHub App installed with access to it.
    - `defaultBranch` string — The branch this app's deployments track. Omit to adopt the repository's GitHub default branch on a new connection, keep the current branch when replacing an already-connected repository, or set it alone to retarget the branch of the connected repository.
  - `deleteProtection` boolean — Enable or disable delete protection for the app. Omit this field to leave the current setting unchanged.

## Response `200`

Successfully updated the app.

- V2AppsUpdateAppResponseBody
  - `meta` Meta, required — Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team.
    - `requestId` string, required — A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
  - `data` App, required
    - `id` string, required — The unique identifier of the app, generated by Unkey.
    - `name` string, required — Human-readable name for this app.
    - `slug` string, required — URL-safe handle for this app, unique within its project. Chosen at creation time.
    - `git` AppGit
      - `repository` string, required — The connected GitHub repository, as "owner/repo".
      - `defaultBranch` string — The branch this app's deployments track.
    - `currentDeploymentId` string — The identifier of the deployment currently serving this app. Omitted if the app has no active deployment yet.
    - `isRolledBack` boolean, required — Whether the app is currently serving a rolled-back deployment rather than its latest one.
    - `deleteProtection` boolean, required — Whether delete protection is enabled for this app. When true, the app cannot be deleted until protection is disabled.
    - `createdAt` integer, required — Unix timestamp in milliseconds when the app was created.
    - `updatedAt` integer — Unix timestamp in milliseconds when the app was last updated. Omitted if the app has never been updated.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden - Insufficient permissions (requires `app.*.update_app`)
- `404` — Not Found - The requested app does not exist in your workspace
- `409` — Conflict - App with this slug already exists in the project
- `429` — Too Many Requests
- `500` — Internal server error

---

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