deploy

Create deployment

Changed on

INTERNAL - This endpoint is internal and may change without notice. Not recommended for production use.

Creates a new deployment for a project using either a pre-built Docker image or build context.

Authentication: Requires a valid root key with appropriate permissions.

post/v2/deploy.createDeployment

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/deploy.createDeployment
  • Auth
    HTTP bearer

Request body

projectstring required

Project slug

appstring required

App slug within the project

keyspaceIdstring

Optional keyspace ID for authentication context

branchstring required

Git branch name

environmentSlugstring required

Environment slug (e.g., "production", "staging")

dockerImagestring required

Deprecated. Use oci.image in v3 instead. This field is the full image reference to deploy. Qualify the version with a tag (ghcr.io/user/app:v1.0.0) or a digest (ghcr.io/user/app@sha256:...). Without either, the registry serves the latest tag.

Example request

{
  "project": "my-project",
  "app": "default",
  "keyspaceId": "key_abc123",
  "branch": "main",
  "environmentSlug": "production",
  "dockerImage": "ghcr.io/user/app:v1.0.0",
  "gitCommit": {
    "commitSha": "a1b2c3d4e5f6",
    "commitMessage": "feat: add new feature",
    "authorHandle": "johndoe",
    "authorAvatarUrl": "https://avatars.githubusercontent.com/u/123456",
    "timestamp": 1704067200000
  }
}

Response

Deployment created successfully

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "deploymentId": "d_abc123xyz"
  }
}

Changes