CorefinityCorefinityDocs
Open the Control PanelControl Panel
Variables and secrets · 6 of 8

Update a site's deployment variable

Creates the variable when the environment does not have it and changes it otherwise, then answers the whole list with each value masked. A new variable needs a value, and making a stored value shown in deployment logs needs the value sent with it.

PUT/api/corestack/sites/{site}/deployments/variables/{name}

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.

namestringRequired

The variable's name, without the CF_ prefix builds see it with: letters, digits and underscores, starting with a letter or underscore, at most 64 characters. Any other name is refused 422 invalid on name.

Body

log_visibilitystring

Whether the value may appear in deployment logs. hidden, the default, masks it there.

hiddenshown
valuestring

The value, kept exactly as sent: at most 2,048 characters, with no line breaks, control or invisible formatting characters. Leave out to change only log_visibility.

Returns

200 The environment's variables after the change.

Fields of the 200 answer
dataarray of objectsRequired
Fields of each item
log_visibilitystring or nullRequired

Whether the value may appear in deployment logs. hidden masks it there.

hiddenshownnull
maskedstringRequired

The mask shown in place of the value. A value of 16 characters or more also shows its last four.

namestringRequired

The name, without the CF_ prefix builds see it with.

overridesobject or any or null

The company whose variable of the same name this one takes the place of. Null when there is none.

replaces_platformbooleanRequired

Whether the name is one CoreStack sets itself, so this value replaces the platform's.

tool_credentialstring or nullRequired

A sentence saying the build tool named never reads this variable, when the name is one a build tool reads its own credentials from and no stage reads it. Null otherwise.

updated_atstring or nullRequired

When the variable last changed, in UTC. Format: date-time.

updated_byany or null

Always null at present.

used_inarray of stringsRequired

The deployment stages whose commands read the variable.

builddatabasepost_deploy
inheritedarray of objects

The company variables that reach this environment. Present while deployment templates are on for your company.

Fields of each item
companyobjectRequired
Fields
idintegerRequired

At least 1.

namestringRequired
levelstringRequired

Whose variable it is, such as owner for the company that owns the site.

namestringRequired
overriddenbooleanRequired

Whether the environment has a variable of its own with this name, whose value is used instead.

sharedbooleanRequired

Whether an agency shares it with the companies it manages.

used_byarray of stringsRequired

The deployment stages whose commands read it.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
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.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
422invalidFix the field named in field; errors says why.
422variable_invalidUse letters, digits and underscores, starting with a letter or underscore, without the CF_ prefix (CoreStack adds it).
422variable_reservedCF_DOMAIN is set by CoreStack. Choose another name.
422too_many_variablesThis environment already has the most variables it can hold.
422variable_tool_credentialBuilds see the variable under another name, so the tool it is meant for never reads it. Add the credentials under Deployments, Private registries, instead.
429rate_limitedWait for the seconds in Retry-After.

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/variables/API_TOKEN \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "example-value-not-a-real-secret"
  }'
{
  "data": [
    {
      "log_visibility": "hidden",
      "masked": "••••••••cret",
      "name": "API_TOKEN",
      "overrides": null,
      "replaces_platform": false,
      "tool_credential": null,
      "updated_at": "2026-11-09T10:42:07Z",
      "updated_by": null,
      "used_in": []
    },
    {
      "log_visibility": "shown",
      "masked": "••••••••.com",
      "name": "API_URL",
      "overrides": null,
      "replaces_platform": false,
      "tool_credential": null,
      "updated_at": "2026-11-09T10:42:07Z",
      "updated_by": null,
      "used_in": []
    }
  ],
  "inherited": []
}
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