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.
- Needs
deployas well: Always.
Path parameters
The id of a CoreStack Enterprise environment. Not the same number as a site row id. At least 1.
Body
True to deploy a commit. Without it the request is an archive upload.
The full commit id, 40 or 64 hexadecimal characters. A short id or a branch name is refused.
The id of one of the environment's repositories. The deployment runs on that repository's pipeline.
A name for the deployment. The commit id when left out. Up to 255 characters.
Up to 10,000 characters.
Returns
201 The new deployment, queued.
Fields of the 201 answer
A deployment of a CoreStack Enterprise environment. Ids are strings here, except attempt_id.
Fields
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.
The run the deployment is on now. A retry starts a new run with a new id. Null while the deployment has no run.
The pipeline the deployment runs on, as the pipelines list names it.
Why a failed deployment failed, as the last line of the step that stopped it. Null unless it failed.
The commit's author, when the push gave one.
The commit deployed. Null for an uploaded archive.
The commit's page at the git provider, when the push that started the deployment gave it.
The merge request or pull request of the commit, when the push gave one.
The deployment's own identifier.
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.
1234567The name of the status.
ScheduledRunningFailedSucceededCancelledPendingQueuednullIf it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | forbidden | The person is not allowed to do this. |
403 | scope_required | Use a token with the scope named in scope. |
404 | none | Check the id. You see only what your account can reach. |
409 | no_namespace | The environment is not set up on its cluster yet. Contact support. |
409 | stale | What you read has changed since you read it. Read it again, then send the change with its new version or quote. |
422 | none | Fix the field named in field; errors says why. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait 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"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/environments/1311/deployments', [
'git' => true,
'git_commit' => '93ac3ee17c1306a5c478c583f0946e40d2e291f0',
'git_repository' => 3301,
'name' => 'Release 2026.11.1',
'notes' => 'Checkout fixes',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/environments/1311/deployments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
git: true,
git_commit: '93ac3ee17c1306a5c478c583f0946e40d2e291f0',
git_repository: 3301,
name: 'Release 2026.11.1',
notes: 'Checkout fixes',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/environments/1311/deployments",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"git": True,
"git_commit": "93ac3ee17c1306a5c478c583f0946e40d2e291f0",
"git_repository": 3301,
"name": "Release 2026.11.1",
"notes": "Checkout fixes",
},
)
data = res.json() if res.content else None{
"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"
}
}{
"message": "Unauthenticated."
}{
"code": "forbidden",
"message": "You need the Create Deployments permission to do this. An owner of your company can grant it in Roles.",
"permission": "createDeployments",
"reason": "forbidden"
}{
"message": "Not found."
}{
"code": "no_namespace",
"message": "This environment has no namespace on its cluster, so there is nothing to deploy to.",
"reason": "no_namespace"
}{
"message": "That archive could not be accepted: only .tar, .tar.gz, .tar.xz, .tar.zst and .zip archives are supported. (unsupported_archive_type)"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it is off for this endpointIt runs commands on a live site. Copy the request and run it yourself when you are sure.