apps

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)
post/v2/apps.updateApp

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/apps.updateApp
  • Auth
    HTTP bearer

Request body

projectstring required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

appstring required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

namestring

New human-readable name for the app. Omit this field to leave the current name unchanged.

slugstring

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

deleteProtectionboolean

Enable or disable delete protection for the app. Omit this field to leave the current setting unchanged.

Example request

{
  "project": "proj_1234abcd",
  "app": "proj_1234abcd",
  "name": "Payments API",
  "slug": "proj_1234abcd",
  "git": {
    "repository": "unkeyed/unkey",
    "defaultBranch": "main"
  },
  "oci": {
    "image": "ghcr.io/acme/api:v1.2.3"
  },
  "deleteProtection": true
}

Response

Successfully updated the app.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "id": "app_1234abcd",
    "name": "Payments API",
    "slug": "payments-api",
    "sourceType": "oci",
    "git": {
      "repository": "unkeyed/unkey",
      "defaultBranch": "main"
    },
    "oci": {
      "image": "ghcr.io/acme/api:v1.2.3"
    },
    "currentDeploymentId": "d_1234abcd",
    "createdAt": 1704067200000,
    "updatedAt": 1704153600000
  }
}

Changes

    • info

      added the new optional request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status