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.
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
True to deploy every push to the branch.
The branch to deploy. No spaces, no .., and no - at the start. Up to 255 characters.
A connection from the settings' connections.
whole_site or site_content (WordPress only). Left out, the repository keeps what it has.
whole_sitesite_contentnullThe 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.
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.
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
How a site deploys, with its last 10 deployments.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
Whether something can be done now and, when it cannot, why not.
Fields
The repository connections you may use on this site.
Fields of each item
The connection's id. 0 when the repository's connection no longer exists or is not one of the site's company.
The provider and the account's username.
True when the provider no longer accepts the connection.
One of github, gitlab, bitbucket or gitlab_self_hosted.
The operation that is moving the site's files into the releases layout, while one is running.
The last 10 deployments, newest first.
Fields of each item
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.
manualwebhookapirollbackunknownreleases once the site's files are in the releases layout git deployments need. Otherwise plain.
releasesplainHow to change the site's files while it deploys by upload.
Fields
git deploys from a repository. manual deploys by upload.
gitmanualThe Node.js version the site's builds use, when one is set.
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.
The releases kept on the site.
Fields
The live release (id, deployed_at, ref).
How many releases are kept.
The release before it (id, deployed_at).
The connected repository. Null when none is connected.
Whether a repository of site content can be chosen on this site, and what a new connection starts from.
Fields
If 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 | 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. |
422 | invalid | Fix the field named in field; errors says why. |
422 | wrong_platform | This is not available for the site's platform. Use it on a site of the platform it is for. |
429 | rate_limited | Wait for the seconds in Retry-After. |
502 | none | Read 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"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->put('https://manage.corefinity.com/api/corestack/sites/1042/deployments/repository', [
'auto_deploy' => false,
'branch' => 'main',
'connection_id' => 4217,
'contents' => 'site_content',
'repo' => 'northwind-digital/harbourandfinch',
'target_path' => 'wp-content/themes',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/deployments/repository', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
auto_deploy: false,
branch: 'main',
connection_id: 4217,
contents: 'site_content',
repo: 'northwind-digital/harbourandfinch',
target_path: 'wp-content/themes',
}),
});
// 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.put(
"https://manage.corefinity.com/api/corestack/sites/1042/deployments/repository",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"auto_deploy": False,
"branch": "main",
"connection_id": 4217,
"contents": "site_content",
"repo": "northwind-digital/harbourandfinch",
"target_path": "wp-content/themes",
},
)
data = res.json() if res.content else None{
"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
}
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"message": "Not found."
}{
"code": "mode",
"message": "Switch this site to git deployments first",
"reason": "mode"
}{
"code": "invalid",
"errors": {
"repo": [
"Enter the repository as owner/name",
"or group/subgroup/name on GitLab"
]
},
"field": "repo",
"message": "Enter the repository as owner/name, or group/subgroup/name on GitLab",
"reason": "invalid"
}{
"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."
}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.