deployments
Cancel deployment
Changed onCancel 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 URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/deployments.cancelDeployment
- AuthHTTP bearer
Request body
Example request
{
"deploymentId": "proj_1234abcd"
}Response
Cancellation accepted and enqueued. The deployment moves to cancelled asynchronously; poll getDeployment to observe it.
Example response
{
"meta": {
"requestId": "req_123"
}
}Changes
- info
added the non-success response with the status
- info
- info
endpoint added
- info