Create a site deployment
Deploys the connected branch, or the branch or commit named in ref, and answers the new deployment with status queued. Follow it with GET /. Your role needs the Create Deployments permission.
- Needs
deployas well: Always.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
Another pipeline of the same site, by its id in the settings' pipeline.bindings. Refused 422 feature_off while choosing a pipeline is not on for your company. At least 1.
A branch name or a 40-character commit SHA. Left out, the connected branch is deployed. Up to 255 characters.
Returns
201 The new deployment, queued.
Fields of the 201 answer
One deployment of a site.
Fields
The deployment's current attempt. A retry moves it on.
The pipeline the deployment ran with.
True for a failed deployment, and for one stopped in its after-deploy commands once its release was live, unless it is a rollback, a stop of it is still putting the earlier release back, or its release archive was removed.
True when the site can roll back to this deployment's release.
True for a running deployment, and for a failed one whose scheduled tasks and queues stay paused after its database stage failed (crons_paused.state database_failed) while no other deployment of the site is in progress.
On a failed or stopped deployment whose crons and queues stay paused: state (database_failed or revert_unfinished) and message. A stop or a retry resumes them.
Why a failed deployment failed, or what a queued one waits for.
The commit's author (name, avatar_url), when the push said.
The commit's page at the provider, when the push said.
The commit's merge request or pull request (ref, kind, url), when the push said.
The path of the deployment's page in the Control Panel.
True for the deployment whose release is live.
On a failed deployment that switched maintenance mode on, whether it was switched off again (state, message).
The branch and commit a deployment deploys.
Fields
The first line of the commit's message.
The id of the release the deployment made. Null until its release goes live.
Who started it. Null for a push.
What a retry would do when this is not the site's newest deployment. Such a retry needs confirm_older.
The stage a running deployment is at, or a failed one stopped at.
waiting is a push that arrived while deploy on push is off; skipped is a waiting deployment that a later one overtook.
waitingqueuedrunningsucceededfailedcancelledskippedOn a stopped deployment whose running step could not be confirmed ended (state, checked_at).
The step a running deployment is at, or a failed one stopped at.
What started it. manual is Deploy now, webhook a push, rollback a rollback.
manualwebhookapirollbackunknownIf it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | forbidden | The person is not allowed to do this. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | none | Check the id. You see only what your account can reach. |
409 | busy | Another operation is running on the site. Wait for it to finish. |
409 | deployment_running | A deployment of the environment is running, or a stopped one is still being cleaned up. Wait for it to finish, then try again. |
409 | mode | The site deploys another way than this needs, by upload where Git is needed or the reverse, or its files are not in the releases layout yet. Switch its deployment mode first. |
409 | needs_reauth | The repository's connection is gone or needs authorising again. Reconnect the repository. |
409 | pipeline_untranslated | This pipeline came from CoreStack Enterprise and has not been translated yet. Open the deployment settings to review it. |
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 | feature_off | This feature is not on for your organisation yet. |
422 | invalid | Fix the field named in field; errors says why. |
422 | no_repository | The site has no repository connected. Connect one first. |
429 | rate_limited | Wait for the seconds in Retry-After. |
502 | none | Read the message; it says what happened. |
503 | none | Try again shortly. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/deployments \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/deployments', (object) []);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/deployments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
// 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/corestack/sites/1042/deployments",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={},
)
data = res.json() if res.content else None{
"deployment": {
"attempt_id": 8035,
"binding": {
"id": 2211,
"label": "Default pipeline"
},
"can_retry": false,
"can_rollback": false,
"can_stop": false,
"crons_paused": null,
"duration_seconds": null,
"error": null,
"finished_at": null,
"git_author": null,
"git_commit_url": null,
"git_merge_request": null,
"href": "/resources/deployments/5127",
"id": 5127,
"is_current": false,
"maintenance_lift": null,
"queued_at": "2026-11-09T09:16:40Z",
"ref": {
"branch": "main",
"message": "Fix the basket count in the mobile header",
"sha": "9730595c6ec7aa59b77674ada74e30d961b1817c",
"short_sha": "9730595"
},
"release_id": null,
"requested_by": {
"id": 3301,
"name": "Daniel Reyes"
},
"retry_warning": null,
"stage": null,
"stage_label": null,
"started_at": null,
"status": "queued",
"status_label": "Queued",
"stop_termination": null,
"task": null,
"trigger": "manual"
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"message": "Not found."
}{
"code": "busy",
"message": "Another change to this site is in progress. Wait for it to finish.",
"reason": "busy"
}{
"code": "feature_off",
"field": "binding_id",
"message": "Choosing a pipeline binding is not available yet. Deploy without binding_id to use the repository's.",
"reason": "feature_off"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "GitLab did not answer. Try again."
}{
"message": "The deployment could not be started. Try again in a moment."
}Try it is off for this endpointIt runs commands on a live site. Copy the request and run it yourself when you are sure.