CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployments · 6 of 10

Update a site's repository

Sets the repository and branch the site deploys, through one of the connections the settings list, and whether a push to the branch deploys. The site must deploy from git. Your role needs the Manage Deployment Repositories permission, Manage Deployment Source to change auto_deploy, and Create Deployments to turn it on or to change the repository while it is on.

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

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

auto_deploybooleanRequired

True to deploy every push to the branch.

branchstringRequired

The branch to deploy. No spaces, no .., and no - at the start. Up to 255 characters.

connection_idintegerRequired

A connection from the settings' connections.

contentsstring or null

whole_site or site_content (WordPress only). Left out, the repository keeps what it has.

whole_sitesite_contentnull
repostringRequired

The repository as owner/name, or group/subgroup/name on GitLab: two or more parts of letters, digits, ., _ and -, each starting with a letter or a digit, at most 200 characters in all. Spaces around it are dropped and it is stored in lower case.

root_directorystring or null

The folder of the repository that holds the site, relative to the repository's root, such as web or apps/site: letters, digits, _, ., - and /, starting with a letter or a digit, at most 121 characters, with no leading /, no empty part and no . or .. part. Spaces around it and a closing / are dropped, and it is stored in lower case. Null, empty or left out for the repository's root. A repository of site content always uses its root.

target_pathstring or null

Where a repository of site content goes, relative to the site's root, such as wp-content/themes. Null for the default. Left out, the repository keeps what it has. Up to 255 characters.

Returns

200 The settings as they are now.

Fields of the 200 answer
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.
404noneCheck the id. You see only what your account can reach.
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.
422invalidFix the field named in field; errors says why.
422wrong_platformThis is not available for the site's platform. Use it on a site of the platform it is for.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.

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/repository \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_deploy": false,
    "branch": "main",
    "connection_id": 4217,
    "contents": "site_content",
    "repo": "northwind-digital/harbourandfinch",
    "target_path": "wp-content/themes"
  }'
{
  "settings": {
    "can_change_mode": {
      "available": true,
      "reason": null
    },
    "can_change_repository": {
      "available": true,
      "reason": null
    },
    "can_deploy": {
      "available": true,
      "reason": null
    },
    "can_retry_deployments": {
      "available": true,
      "reason": null
    },
    "can_rollback": {
      "available": true,
      "reason": null
    },
    "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": [
      {
        "attempt_id": 8035,
        "binding": {
          "id": 2211,
          "label": "Default pipeline"
        },
        "can_retry": false,
        "can_rollback": false,
        "can_stop": false,
        "crons_paused": null,
        "duration_seconds": 131,
        "error": null,
        "finished_at": "2026-11-09T09:18:55Z",
        "git_author": {
          "avatar_url": null,
          "name": "Daniel Reyes"
        },
        "git_commit_url": "https://gitlab.example.com/northwind-digital/harbourandfinch/-/commit/9730595c6ec7aa59b77674ada74e30d961b1817c",
        "git_merge_request": null,
        "href": "/resources/deployments/5127",
        "id": 5127,
        "is_current": true,
        "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": "10f3c268-99c9-4c4e-9e8c-d467a321b123",
        "requested_by": null,
        "retry_warning": null,
        "stage": null,
        "stage_label": null,
        "started_at": "2026-11-09T09:16:44Z",
        "status": "succeeded",
        "status_label": "Succeeded",
        "stop_termination": null,
        "task": null,
        "trigger": "webhook"
      },
      {
        "attempt_id": 7990,
        "binding": {
          "id": 2211,
          "label": "Default pipeline"
        },
        "can_retry": false,
        "can_rollback": true,
        "can_stop": false,
        "crons_paused": null,
        "duration_seconds": 136,
        "error": null,
        "finished_at": "2026-11-02T14:07:31Z",
        "git_author": null,
        "git_commit_url": null,
        "git_merge_request": null,
        "href": "/resources/deployments/5098",
        "id": 5098,
        "is_current": false,
        "maintenance_lift": null,
        "queued_at": "2026-11-02T14:05:12Z",
        "ref": {
          "branch": "main",
          "message": "Update the header",
          "sha": "f7ba9cd79a612311f0487855eb0d96839161550e",
          "short_sha": "f7ba9cd"
        },
        "release_id": "2245ae09-7793-49fa-850b-225c62855fce",
        "requested_by": {
          "id": 3301,
          "name": "Daniel Reyes"
        },
        "retry_warning": null,
        "stage": null,
        "stage_label": null,
        "started_at": "2026-11-02T14:05:15Z",
        "status": "succeeded",
        "status_label": "Succeeded",
        "stop_termination": null,
        "task": null,
        "trigger": "manual"
      }
    ],
    "layout": "releases",
    "manual": {
      "note": "Files you change over SFTP or in the terminal are live on refresh",
      "sftp_command": "sftp -P 20001 [email protected]"
    },
    "mode": "git",
    "mode_label": "Git",
    "node": {
      "adopted": false,
      "major": null
    },
    "pipeline": {
      "bindings": [
        {
          "id": 2211,
          "is_default": true,
          "label": "Default pipeline",
          "tag": null
        }
      ],
      "version": 3
    },
    "releases": {
      "count": 2,
      "current": {
        "deployed_at": "2026-11-09T09:18:55Z",
        "id": "10f3c268-99c9-4c4e-9e8c-d467a321b123",
        "ref": {
          "branch": "main",
          "message": "Fix the basket count in the mobile header",
          "sha": "9730595c6ec7aa59b77674ada74e30d961b1817c",
          "short_sha": "9730595"
        }
      },
      "keep": 5,
      "previous": {
        "deployed_at": "2026-11-02T14:07:31Z",
        "id": "2245ae09-7793-49fa-850b-225c62855fce"
      }
    },
    "repository": {
      "auto_deploy": true,
      "branch": "main",
      "connection": {
        "id": 4217,
        "label": "GitLab (self-hosted) · daniel-reyes",
        "needs_reauth": false,
        "provider": "gitlab_self_hosted",
        "provider_label": "GitLab (self-hosted)"
      },
      "contents": "whole_site",
      "effective_target_path": null,
      "repo": "northwind-digital/harbourandfinch",
      "root_directory": "",
      "target_path": null,
      "url": "https://gitlab.example.com/northwind-digital/harbourandfinch",
      "webhook": {
        "error": null,
        "last_received_at": "2026-11-09T09:16:38Z",
        "state": "active"
      }
    },
    "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 has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT