---
title: "Environment variables"
url: https://docs.corefinity.com/guides/corestack-enterprise/environment-variables
type: guide
last_updated: 2026-11-13
feature: enterprise-variables
related:
  - https://docs.corefinity.com/api/reference/enterprise/list-enterprise-variables.md
  - https://docs.corefinity.com/api/reference/enterprise/update-enterprise-variable.md
  - https://docs.corefinity.com/api/reference/enterprise/delete-enterprise-variable.md
  - https://docs.corefinity.com/api/reference/enterprise/reveal-enterprise-variable.md
  - https://docs.corefinity.com/mcp/tools/corestack_enterprise_variables_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_enterprise_variable_set.md
  - https://docs.corefinity.com/mcp/tools/corestack_enterprise_variable_delete.md
  - https://docs.corefinity.com/mcp/tools/corestack_enterprise_variable_reveal.md
---
# Environment variables

Add, change and remove the variables a CoreStack Enterprise environment's deployments read.

## Before you start

- You can open the environment: see [Websites and environments](/guides/corestack-enterprise/websites-and-environments).
- Each environment has its own variables, up to 100.
- The deployment pipeline reads a variable under its name with `CF_` in front: `NPM_TOKEN` is read as `CF_NPM_TOKEN`.

## Add a variable

1. **Open Environment Variables**

   Open the environment, choose **Deployments** and find **Environment Variables**.

   _Screenshot: Environment Variables on the Deployments tab: three variables with a key and a value each, the line Injected as CF_ and the key under each, the buttons Save and Remove, and Add environment variable.\_

2. **Enter the key and value**

   Choose **Add environment variable**. Enter the key, using letters, digits and underscores and starting with a letter or an underscore, then the value, of up to 2,048 characters.

   _Screenshot: A new row in Environment Variables with the key MAPS_API_KEY and a value, the line Injected as CF_MAPS_API_KEY, and its Save button._

3. **Save**

   Choose **Save** on the row.

The next deployment reads the variable. A saved value is masked: choose **Show** to read it.

## Change or remove a variable

1. **Edit the row**

   Change the key or enter a new value, then choose **Save** on the row. To delete the variable, choose **Remove** and confirm.

The change takes effect from the next deployment.

## Automate this

**API:** [Update an environment's variable](https://docs.corefinity.com/api/reference/enterprise/update-enterprise-variable.md), scope `write`

```bash
curl -X PUT https://manage.corefinity.com/api/environments/1311/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"
  }'
```

**MCP:** [`corestack_enterprise_variable_set`](https://docs.corefinity.com/mcp/tools/corestack_enterprise_variable_set.md), scope `write`

```json
{
  "name": "corestack_enterprise_variable_set",
  "arguments": {
    "enterprise_env_id": 1530,
    "name": "API_URL",
    "value": "https://api.example.com"
  }
}
```

**Control Panel:** Managed Websites › your Enterprise website › Deployments

## Related

- [Deployments and pipelines](/guides/corestack-enterprise/deployments-and-pipelines): Deploy a commit and follow it.
- [Repositories and webhooks](/guides/corestack-enterprise/repositories-and-webhooks): Choose the repository an environment deploys from.
- [Variables](/guides/sites/code-and-deployments/variables-and-secrets): Give deployment commands a value.
