CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployments · 4 of 10

Update how a site deploys

Switches the site between deploying from git (git) and by upload (manual). Switching to git answers 201 with the operation that moves the site's files into the releases layout; switching to manual answers 200 with the command that moves them back, or null when the site already deploys by upload. Your role needs the Manage Deployment Source permission.

PUT/api/corestack/sites/{site}/deployments/mode

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

modestringRequired
gitmanual
reconvertboolean

With mode git on a site whose conversion is pending, converts again.

Returns

200 The settings, and the command that switches the site to manual deployments, if one was started.

201 The settings, and the operation that moves the site's files into the releases layout.

Fields of the 200 answer
commandobject or any or nullRequired

The command that switches the site to manual deployments. Null when the site already deploys by upload.

settingsobjectRequired

How a site deploys, with its last 10 deployments.

Fields
can_change_modeobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_change_repositoryobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_deployobjectRequired

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_retry_deploymentsobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_rollbackobjectRequired

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_stop_deploymentsobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_switch_to_gitobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_turn_off_auto_deployobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_turn_on_auto_deployobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
connectionsarray of objectsRequired

The repository connections you may use on this site.

Fields of each item
idintegerRequired

The connection's id. 0 when the repository's connection no longer exists or is not one of the site's company.

labelstringRequired

The provider and the account's username.

needs_reauthbooleanRequired

True when the provider no longer accepts the connection.

providerstringRequired

One of github, gitlab, bitbucket or gitlab_self_hosted.

provider_labelstringRequired
conversionobject or any or nullRequired

The operation that is moving the site's files into the releases layout, while one is running.

deploymentsarray of objectsRequired

The last 10 deployments, newest first.

Fields of each item
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
layoutstringRequired

releases once the site's files are in the releases layout git deployments need. Otherwise plain.

releasesplain
manualobjectRequired

How to change the site's files while it deploys by upload.

Fields
notestringRequired
sftp_commandstring or nullRequired
modestringRequired

git deploys from a repository. manual deploys by upload.

gitmanual
mode_labelstringRequired
nodeobject

The Node.js version the site's builds use, when one is set.

pipelineobject or nullRequired

A summary of the site's deployment pipeline. bindings lists the pipelines a deployment can choose with binding_id (id, label, is_default). The deployment pipeline endpoints answer the rest.

releasesobjectRequired

The releases kept on the site.

Fields
countintegerRequired
currentobject or nullRequired

The live release (id, deployed_at, ref).

keepintegerRequired

How many releases are kept.

previousobject or nullRequired

The release before it (id, deployed_at).

repositoryobject or any or nullRequired

The connected repository. Null when none is connected.

repository_optionsobject or nullRequired

Whether a repository of site content can be chosen on this site, and what a new connection starts from.

Fields
default_contentsstring
default_target_pathstring or null
layout_target_pathstring or null
site_contentboolean
Fields of the 201 answer
operationobjectRequired

A change the Control Panel is making or has made. A save or an action that starts work answers one in operation; read it again by id with GET /corestack/operations/{operation} until status is completed or failed. Both answers have this shape; the few endpoints that answer a different one say so.

Fields
applied_atstring or null
can_retryboolean or null
clusterobject or any or null

The cluster the operation runs on.

committed_atstring or null
completed_atstring or nullRequired
created_atstring or nullRequired
environmentobject or any or null
errorstring or nullRequired

Why the operation failed, in plain words. Null unless status is failed.

failure_reasonstring or null

A stable code for the failure.

from_versionstring or null
hotboolean or null

True when the change applies without a maintenance window.

idintegerRequired
installobject or null
labelstring or null
notesarray of objects

What the operation did differently on purpose. Empty when nothing.

Fields of each item
codestringRequired
textstringRequired
parent_operation_idinteger or null
requested_byany

Who asked for the change.

reset_targetany

Present on some site creations and copies.

resultany

Always null here. A one-time result is read once with the reveal endpoint.

result_statestring
nonependingavailableviewed
retried_by_operation_idinteger or null
retries_operation_idinteger or null
retry_requiresany

What a retry needs first, if anything.

revealedany

Who revealed a one-time result and when, when there was one.

scopestringRequired
siteclusterbatch
siteobject or any or null

The website the operation belongs to. Null for a cluster's own operation.

statusstringRequired

Where a change is. completed and failed are final; every other status means the change is still running and blocks another change to the same site.

pendingcommittedrolling_outexecutingcompletedfailed
status_labelstringRequired
stepstring or null

The key of the step the operation is at. Null once it has completed.

stepsarray of objectsRequired
Fields of each item
keystring
labelstring
statestring

One of done, current, todo, failed or skipped.

subjectobject or null
summarystring or null
to_versionstring or null
typestringRequired

The kind of change, such as crons_change or redirects_change.

type_labelstringRequired
settingsobjectRequired

How a site deploys, with its last 10 deployments.

Fields
can_change_modeobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_change_repositoryobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_deployobjectRequired

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_retry_deploymentsobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_rollbackobjectRequired

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_stop_deploymentsobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_switch_to_gitobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_turn_off_auto_deployobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
can_turn_on_auto_deployobject

Whether something can be done now and, when it cannot, why not.

Fields
availablebooleanRequired
reasonstring or nullRequired
connectionsarray of objectsRequired

The repository connections you may use on this site.

Fields of each item
idintegerRequired

The connection's id. 0 when the repository's connection no longer exists or is not one of the site's company.

labelstringRequired

The provider and the account's username.

needs_reauthbooleanRequired

True when the provider no longer accepts the connection.

providerstringRequired

One of github, gitlab, bitbucket or gitlab_self_hosted.

provider_labelstringRequired
conversionobject or any or nullRequired

The operation that is moving the site's files into the releases layout, while one is running.

deploymentsarray of objectsRequired

The last 10 deployments, newest first.

Fields of each item
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
layoutstringRequired

releases once the site's files are in the releases layout git deployments need. Otherwise plain.

releasesplain
manualobjectRequired

How to change the site's files while it deploys by upload.

Fields
notestringRequired
sftp_commandstring or nullRequired
modestringRequired

git deploys from a repository. manual deploys by upload.

gitmanual
mode_labelstringRequired
nodeobject

The Node.js version the site's builds use, when one is set.

pipelineobject or nullRequired

A summary of the site's deployment pipeline. bindings lists the pipelines a deployment can choose with binding_id (id, label, is_default). The deployment pipeline endpoints answer the rest.

releasesobjectRequired

The releases kept on the site.

Fields
countintegerRequired
currentobject or nullRequired

The live release (id, deployed_at, ref).

keepintegerRequired

How many releases are kept.

previousobject or nullRequired

The release before it (id, deployed_at).

repositoryobject or any or nullRequired

The connected repository. Null when none is connected.

repository_optionsobject or nullRequired

Whether a repository of site content can be chosen on this site, and what a new connection starts from.

Fields
default_contentsstring
default_target_pathstring or null
layout_target_pathstring or null
site_contentboolean

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.
404feature_offThis feature is not on for your organisation yet.
409bedrock_layoutThe WordPress site is built with Bedrock, so it cannot switch to manual deployments yet. Keep deploying it with Git.
409busyAnother operation is running on the site. Wait for it to finish.
409layout_unknownThe Control Panel could not confirm whether this WordPress site is built with Bedrock, so it stays on Git deployments. Try again in a minute.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.
503noneTry again shortly.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/mode \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "git"
  }'
{
  "command": null,
  "settings": {
    "can_change_mode": {
      "available": true,
      "reason": null
    },
    "can_change_repository": {
      "available": true,
      "reason": null
    },
    "can_deploy": {
      "available": false,
      "reason": "Switch this site to git deployments first"
    },
    "can_retry_deployments": {
      "available": true,
      "reason": null
    },
    "can_rollback": {
      "available": false,
      "reason": "Switch this site to git deployments first"
    },
    "can_stop_deployments": {
      "available": true,
      "reason": null
    },
    "can_switch_to_git": {
      "available": true,
      "reason": null
    },
    "can_turn_off_auto_deploy": {
      "available": true,
      "reason": null
    },
    "can_turn_on_auto_deploy": {
      "available": true,
      "reason": null
    },
    "connections": [
      {
        "id": 4217,
        "label": "GitLab (self-hosted) · daniel-reyes",
        "needs_reauth": false,
        "provider": "gitlab_self_hosted",
        "provider_label": "GitLab (self-hosted)"
      }
    ],
    "conversion": null,
    "deployments": [],
    "layout": "plain",
    "manual": {
      "note": "Files you change over SFTP or in the terminal are live on refresh",
      "sftp_command": "sftp -P 20001 [email protected]"
    },
    "mode": "manual",
    "mode_label": "Manual",
    "node": {
      "adopted": false,
      "major": null
    },
    "pipeline": {
      "bindings": [],
      "version": 3
    },
    "releases": {
      "count": 0,
      "current": null,
      "keep": 5,
      "previous": null
    },
    "repository": null,
    "repository_options": {
      "default_contents": "whole_site",
      "default_target_path": null,
      "layout_target_path": "wp-content",
      "release_root": "",
      "site_content": true
    }
  }
}
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