CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployments · 2 of 10

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 /corestack/sites/{site}/deployments. Your role needs the Create Deployments permission.

POST/api/corestack/sites/{site}/deployments
  • Needs deploy as well: Always.

Path parameters

siteintegerRequired

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

binding_idinteger or null

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.

refstring or null

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
deploymentobjectRequired

One deployment of a site.

Fields
attempt_idinteger or null

The deployment's current attempt. A retry moves it on.

bindingobject or any or null

The pipeline the deployment ran with.

can_retrybooleanRequired

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.

can_rollbackbooleanRequired

True when the site can roll back to this deployment's release.

can_stopbooleanRequired

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.

crons_pausedobject or null

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.

duration_secondsinteger or nullRequired
errorstring or nullRequired

Why a failed deployment failed, or what a queued one waits for.

finished_atstring or nullRequired
git_authorobject or null

The commit's author (name, avatar_url), when the push said.

git_commit_urlstring or null

The commit's page at the provider, when the push said.

git_merge_requestobject or null

The commit's merge request or pull request (ref, kind, url), when the push said.

hrefstringRequired

The path of the deployment's page in the Control Panel.

idintegerRequired
is_currentbooleanRequired

True for the deployment whose release is live.

maintenance_liftobject or null

On a failed deployment that switched maintenance mode on, whether it was switched off again (state, message).

queued_atstring or nullRequired
refobjectRequired

The branch and commit a deployment deploys.

Fields
branchstring or nullRequired
messagestring or nullRequired

The first line of the commit's message.

shastring or nullRequired
short_shastring or nullRequired
release_idstring or nullRequired

The id of the release the deployment made. Null until its release goes live.

requested_byobject or any or nullRequired

Who started it. Null for a push.

retry_warningstring or null

What a retry would do when this is not the site's newest deployment. Such a retry needs confirm_older.

stagestring or nullRequired

The stage a running deployment is at, or a failed one stopped at.

stage_labelstring or nullRequired
started_atstring or nullRequired
statusstringRequired

waiting is a push that arrived while deploy on push is off; skipped is a waiting deployment that a later one overtook.

waitingqueuedrunningsucceededfailedcancelledskipped
status_labelstringRequired
stop_terminationobject or null

On a stopped deployment whose running step could not be confirmed ended (state, checked_at).

taskstring or nullRequired

The step a running deployment is at, or a failed one stopped at.

triggerstringRequired

What started it. manual is Deploy now, webhook a push, rollback a rollback.

manualwebhookapirollbackunknown

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403forbiddenThe person is not allowed to do this.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404noneCheck the id. You see only what your account can reach.
409busyAnother operation is running on the site. Wait for it to finish.
409deployment_runningA deployment of the environment is running, or a stopped one is still being cleaned up. Wait for it to finish, then try again.
409modeThe 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.
409needs_reauthThe repository's connection is gone or needs authorising again. Reconnect the repository.
409pipeline_untranslatedThis pipeline came from CoreStack Enterprise and has not been translated yet. Open the deployment settings to review it.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
422feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
422no_repositoryThe site has no repository connected. Connect one first.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.
503noneTry 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 '{}'
{
  "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"
  }
}
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