apps

Create an app within a project. The app is created with default production and preview environments.

Set exactly one source. Use git to create a GitHub-sourced app and connect its repository. Use oci to create an app from a prebuilt OCI image.

The slug you provide is the stable, caller-defined handle used to reference this app. It must be unique within the project.

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:

  • project.*.create_app (to create apps in any project)
  • project.<project_id>.create_app (to create apps in a specific project)
post/v2/apps.createApp

Request

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

Request body

OR

Example request

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

Response

App created successfully. The response contains the app id used to reference it in subsequent operations.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "appId": "app_1234abcd"
  }
}

Changes

    • info

      added the new optional request property

    • info

      added subschema #1 subschema #2 to the request body oneOf list

    • info

      the request property / became optional

    • info

      added the new optional request property