CorefinityCorefinityDocs
Open the Control PanelControl Panel
Enterprise deployments · 3 of 17

Update an environment's deployment settings

Changes the settings you send and answers them all as they are now. Moving the source off git removes the environment's repositories, so it needs confirm_remove_repositories true when there are any. To change a pipeline's folders or build switches, send its pipeline_id with them; a refused folder refuses the whole request.

PATCH/api/environments/{environment}/deployment-settings

Path parameters

environmentintegerRequired

The id of a CoreStack Enterprise environment. Not the same number as a site row id. At least 1.

Body

confirm_remove_repositoriesboolean

True to move an environment that has repositories off git, which removes them and their webhooks.

deployment_sourcestring

manual or git. sftp is accepted only for an environment that already uses it.

manualgitsftp
git_deploysstring

Whether a push deploys on its own. Applies only while the pipeline is on and the source is git.

manualautomatic
isolate_build_varboolean

Whether a build keeps its own var folder. Only on a pipeline it applies to.

pause_crons_during_buildboolean

Whether scheduled tasks pause while a build runs. Only on a pipeline it applies to.

pipeline_enabledboolean

Turn the deployment pipeline on or off.

pipeline_idinteger

The pipeline whose folders or build switches change. Goes with at least one of them. At least 1.

root_directorystring

The pipeline's web folder: an absolute path that starts and ends with a slash, of letters, digits, ., _, - and /, with no .. part, at most 255 characters, under /var/www/, /var/www_m2/, /var/www_vsf/ or /var/www_blog/, and never one of those itself.

root_storagestring

The pipeline's storage folder, held to the same rule as root_directory. Up to 255 characters.

Returns

200 The deployment settings after the change.

Fields of the 200 answer
deployment_settingsobjectRequired
Fields
deployment_sourcestring or nullRequired

Where deployments come from.

manualsftpgitnull
deployment_sourcesarray of stringsRequired

The sources the environment may be set to. sftp is listed only for an environment that still uses it.

manualsftpgit
enterprise_env_idintegerRequired

The environment's id.

git_deploysstring or nullRequired

automatic deploys every push on its own. manual leaves each push waiting to be deployed. Null unless the pipeline is on and the source is git.

manualautomaticnull
pipeline_enabledbooleanRequired

Whether the deployment pipeline is on.

pipelinesarray of objectsRequired
Fields of each item
build_switches_editablebooleanRequired

Whether you may change the pipeline's build switches.

folders_editablebooleanRequired

Whether you may change the pipeline's folders.

isolate_build_varboolean or nullRequired

Whether a build keeps its own var folder. Null on a pipeline it does not apply to.

namestringRequired
notesarray of stringsRequired

What to know about the build switches as they are set. Empty when nothing.

pause_crons_during_buildboolean or nullRequired

Whether scheduled tasks pause while a build runs. Null on a pipeline it does not apply to.

pipeline_idintegerRequired
root_directorystringRequired

The pipeline's web folder.

root_storagestringRequired

The pipeline's storage folder.

repositoriesintegerRequired

How many repositories the environment has.

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.
409not_availableThe tool does not apply to this object.
422confirmThe action needs an explicit confirmation field. Ask the person, then send it.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X PATCH https://manage.corefinity.com/api/environments/1311/deployment-settings \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "git_deploys": "automatic"
  }'
{
  "deployment_settings": {
    "deployment_source": "git",
    "deployment_sources": [
      "manual",
      "git"
    ],
    "enterprise_env_id": 1311,
    "git_deploys": "automatic",
    "pipeline_enabled": true,
    "pipelines": [
      {
        "build_switches_editable": false,
        "folders_editable": true,
        "isolate_build_var": null,
        "name": "Storefront (Wordpress)",
        "notes": [],
        "pause_crons_during_build": null,
        "pipeline_id": 2210,
        "root_directory": "/var/www/harbourandfinch.example.com/",
        "root_storage": "/var/www/harbourandfinch.example.com/shared/"
      }
    ],
    "repositories": 1
  }
}
Try it

Try it is off for this endpointIt deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT