Skip to main content

Get deployment

Retrieve a single deployment by its id.

Use this to check a deployment's status after creating it, or to inspect the
runtime configuration of an existing deployment.

Required Permissions

Your root key must have one of the following permissions:

  • environment.*.read_deployment (to read deployments in any environment)
  • environment.<environment_id>.read_deployment (to read deployments in a specific environment)
1 min read
post/v2/deployments.getDeployment
Request example
Response
post/v2/deployments.getDeployment

Authorization

Authorizationstringheaderrequired#

Unkey uses bearer tokens for authentication. Public integrations use root keys, while the dashboard proxy uses short-lived JWTs.
To authenticate, include the token in the Authorization header of each request:

Root keys have specific permissions attached to them, controlling what operations they can perform. Legacy permissions use tuple strings like api.*.create_key; resource permissions use Unkey Resource Names plus actions, like unkey:v1:ws_123:keyspaces/*#create_key.
Security best practices:

  • Keep root keys secure and never expose them in client-side code
  • Use different root keys for different environments
  • Rotate keys periodically, especially after team member departures
  • Create keys with minimal necessary permissions following least privilege principle
  • Monitor key usage with audit logs.

Body

application/json
deploymentIdstringrequired#

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

Length: 3–255Pattern: ^[a-zA-Z0-9_-]+$

Responses

application/json
Successfully retrieved the deployment.
metaobjectrequired#
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.
Show child attributes
requestIdstringrequired#
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.
dataobjectrequired#
Show child attributes
idstringrequired#
The unique identifier of the deployment, generated by Unkey.
statusenum<string>required#

Current lifecycle status of the deployment. Poll until it reaches a
terminal state: ready (serving), failed, skipped, superseded, stopped,
or cancelled.

Options:pendingstartingbuildingdeployingnetworkfinalizingreadyfailedskippedawaiting_approvalstoppedsupersededcancelled
isCurrentbooleanrequired#

True when this is the production deployment currently serving traffic, i.e.
on api.acme.com. Only production deployments can be current, and at most one
deployment is current. Rollbacks and promotions change which deployment is
current and serves requests to api.acme.com.

environmentstringrequired#
Slug of the environment this deployment belongs to.
appstringrequired#
Slug of the app this deployment belongs to.
projectstringrequired#
Slug of the project this deployment belongs to.
gitobject#
Show child attributes
commitShastringrequired#
The git commit SHA this deployment was built from.
branchstring#
The git branch this deployment was built from. Omitted when unknown.
dockerobject#
Show child attributes
imagestringrequired#
The Docker image this deployment runs.
availableActionsenum<string>[]required#

Lifecycle operations you are allowed to call on this deployment right now.
Empty when none apply (e.g. while building or in a terminal state).

regionsstring[]required#

Regions this deployment is configured to run in. Empty while the deployment
has no scheduled regions yet.

errorobject#
Show child attributes
codeenum<string>required#

The reason a deployment failed. unknown means Unkey could not classify the
failure; see message for details.

Options:no_schedulable_regionsinvalid_runtime_settingscpu_quota_exceededmemory_quota_exceededstorage_quota_exceededbuild_failedunknown
stepstringrequired#
The pipeline step that failed (e.g. building, deploying, starting).
messagestringrequired#

Human-readable description of why the deployment failed. For programmatic
handling, use code.

domainsstring[]#
Public hostnames this deployment is reachable at.
runtimeobjectrequired#
Show child attributes
vCpusnumberrequired#
CPU allocation in vCPUs (1 = one vCPU, 0.5 = half a vCPU).
memoryMibintegerrequired#
Memory allocation in mebibytes.
storageMibintegerrequired#
Ephemeral storage allocation in mebibytes.
portintegerrequired#
Port the container listens on.
commandstring[]required#
Container entrypoint command override. Empty when none is set.
shutdownSignalenum<string>required#
Signal sent to the container on shutdown.
Options:SIGTERMSIGINTSIGQUITSIGKILL
upstreamProtocolenum<string>required#
Protocol used to reach the container.
Options:http1h2c
healthcheckobject#
Show child attributes
methodenum<string>required#
HTTP method used to probe the container.
Options:GETPOST
pathstringrequired#
HTTP path probed on the container. Must start with a slash.

Length: 1–512Pattern: ^(/[\w\-]+)+(\.[\w]+)?$

intervalSecondsinteger#
How often the probe runs, in seconds. Defaults to 10 when omitted.

Range: 1–3600

timeoutSecondsinteger#
Per-probe timeout, in seconds. Defaults to 5 when omitted.

Range: 1–3600

failureThresholdinteger#
Consecutive failures before the container is restarted. Defaults to 3 when omitted.

Range: 1–100

initialDelaySecondsinteger#
Delay before the first probe runs, in seconds. Defaults to 0 when omitted.

Range: 0–3600

createdAtintegerrequired#
Unix timestamp in milliseconds when the deployment was created.

Range: 0–9223372036854776000

updatedAtinteger#

Unix timestamp in milliseconds when the deployment was last updated.
Omitted if the deployment has never been updated.

Range: 0–9223372036854776000