CorefinityCorefinityDocs
Open the Control PanelControl Panel
Enterprise deployments · 7 of 17

Cancel a deployment

Cancels a deployment that has not finished: one that is scheduled, queued, waiting to be deployed or running, which stops at its current step. Your role needs the Cancel Deployments permission. A deployment of a CoreStack or CoreCluster site is stopped from the site instead.

POST/api/environments/{environment}/deployments/{deployment}/cancel
  • Needs deploy as well: Always.

Path parameters

environmentintegerRequired

The id of a CoreStack Enterprise environment. Not the same number as a site row id. At least 1.

deploymentintegerRequired

The id of a deployment of the environment. A deployment of another environment is not found. At least 1.

Idempotency-Keystring

A UUID you choose, to make the request safe to repeat. Only the endpoints that list this header read it; each says what a repeated key answers. Format: uuid.

Body

expected_action_idinteger or null

The attempt_id you read. If the deployment has moved on since, the answer is 409 stale and nothing happens. Left out, the deployment's current run is used. At least 1.

Returns

200 The deployment, cancelled. replayed is true when the Idempotency-Key was used before.

Fields of the 200 answer
deploymentobjectRequired

A deployment of a CoreStack Enterprise environment. Ids are strings here, except attempt_id.

Fields
artifact_pruned_atstring or nullRequired

When the deployment's release archive was removed. A deployment with one cannot be retried or rolled back to. Null while the archive is kept.

attempt_idinteger or nullRequired

The run the deployment is on now. A retry starts a new run with a new id. Null while the deployment has no run.

environment_deployment_pipeline_idstringRequired

The pipeline the deployment runs on, as the pipelines list names it.

environment_idstringRequired
errorstring or nullRequired

Why a failed deployment failed, as the last line of the step that stopped it. Null unless it failed.

git_authorobject or any or nullRequired

The commit's author, when the push gave one.

git_commitstring or nullRequired

The commit deployed. Null for an uploaded archive.

git_commit_urlstring or nullRequired

The commit's page at the git provider, when the push that started the deployment gave it.

git_merge_requestobject or any or nullRequired

The merge request or pull request of the commit, when the push gave one.

hashstring or nullRequired

The deployment's own identifier.

idstringRequired
namestring or nullRequired
notesstring or nullRequired
statusstringRequired

The status as a number in a string: 1 Scheduled, 2 Running, 3 Failed, 4 Succeeded, 5 Cancelled, 6 Pending (waiting to be deployed by hand), 7 Queued.

1234567
status_descriptionstring or nullRequired

The name of the status.

ScheduledRunningFailedSucceededCancelledPendingQueuednull
replayedbooleanRequired

True when this answer repeats the outcome of an earlier request with the same Idempotency-Key.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403forbiddenThe person is not allowed to do this.
403scope_requiredUse a token with the scope named in scope.
404noneCheck the id. You see only what your account can reach.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
409conflictThe action conflicts with the object's present state. Read the message.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.
500internal_errorSomething went wrong on our side. Quote the trace id to support.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/environments/1311/deployments/4410/cancel \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "deployment": {
    "artifact_pruned_at": null,
    "attempt_id": 190419,
    "environment_deployment_pipeline_id": "2210",
    "environment_id": "1311",
    "error": null,
    "git_author": null,
    "git_commit": "5c1d0e9a7b3f42d68a0c9e1f7b2d4a6c8e0f1a3b",
    "git_commit_url": null,
    "git_merge_request": null,
    "hash": "71a7eaca-89a7-4a5f-a7af-17d38ca685e6",
    "id": "4410",
    "name": "Release 2026.10.4",
    "notes": null,
    "status": "5",
    "status_description": "Cancelled"
  },
  "replayed": false
}
Try it

Try it is off for this endpointIt can need a stronger scope, depending on what you send. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT