deployments

Cancel deployment

Changed on

Cancel a deployment that has not finished yet: queued, waiting for approval, building, or deploying. Cancelling aborts its run and marks it cancelled.

Only in-progress deployments can be cancelled. To take a ready preview deployment offline, use stopDeployment instead.

Cancellation is asynchronous: this endpoint only enqueues it and returns immediately. Poll getDeployment until the status reaches cancelled.

Required Permissions

Your root key must have the following permission:

  • unkey:v1:<workspace_id>:projects/<project_id>/apps/<app_id>/environments/<environment_id>/deployments/<deployment_id>#write
post/v2/deployments.cancelDeployment

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/deployments.cancelDeployment
  • Auth
    HTTP bearer

Request body

deploymentIdstring required

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

Example request

{
  "deploymentId": "proj_1234abcd"
}

Response

Cancellation accepted and enqueued. The deployment moves to cancelled asynchronously; poll getDeployment to observe it.

dataEmptyResponse required

Empty response object by design. A successful response indicates this operation was successfully executed.

Example response

{
  "meta": {
    "requestId": "req_123"
  }
}

Changes