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

Create an environment deployment

Starts a deployment and answers it with status 7 (Queued): send JSON with git true to deploy a commit of one of the environment's repositories, or multipart/form-data to deploy a release archive you upload through the pipeline pipeline_id names. Your role needs the Create Deployments permission, and the token the deploy ability as well as the write scope.

POST/api/environments/{environment}/deployments
  • 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.

Body

gitbooleanRequired

True to deploy a commit. Without it the request is an archive upload.

git_commitstringRequired

The full commit id, 40 or 64 hexadecimal characters. A short id or a branch name is refused.

git_repositoryintegerRequired

The id of one of the environment's repositories. The deployment runs on that repository's pipeline.

namestring or null

A name for the deployment. The commit id when left out. Up to 255 characters.

notesstring or null

Up to 10,000 characters.

Returns

201 The new deployment, queued.

Fields of the 201 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

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.
409no_namespaceThe environment is not set up on its cluster yet. Contact support.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
422noneFix the field named in field; errors says why.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/environments/1311/deployments \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "git": true,
    "git_commit": "93ac3ee17c1306a5c478c583f0946e40d2e291f0",
    "git_repository": 3301,
    "name": "Release 2026.11.1",
    "notes": "Checkout fixes"
  }'
{
  "deployment": {
    "artifact_pruned_at": null,
    "attempt_id": 190417,
    "environment_deployment_pipeline_id": "2210",
    "environment_id": "1311",
    "error": null,
    "git_author": null,
    "git_commit": "93ac3ee17c1306a5c478c583f0946e40d2e291f0",
    "git_commit_url": null,
    "git_merge_request": null,
    "hash": "8697839e-ee34-4255-8328-61f0651f63b4",
    "id": "88231",
    "name": "Release 2026.11.1",
    "notes": "Checkout fixes",
    "status": "7",
    "status_description": "Queued"
  }
}
Try it

Try it is off for this endpointIt runs commands on a live site. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT