---
title: "Create A Site Variable"
description: "Create one site variable without starting a deployment."
type: "mcp_operation"
company: "RevCent"
operation_id: "CreateSiteVariable"
canonical: "https://revcent.com/documentation/markdown/mcp/operation/CreateSiteVariable.md"
api_schema: "https://revcent.com/documentation/files/api/operation/CreateSiteVariable.json"
---

# Create a Site Variable

> **MCP credential input:** The linked API operation schema also describes direct HTTP input. In MCP, use `secure_form_id` instead of `value`; never request or include the value in chat.
>
> Use [CreateSecureForm](CreateSecureForm.md) with `form_source: "site_environment"` and the site ID in `form_source_id`. Supply no action, name or version to the form. Check [GetSecureForm](GetSecureForm.md) for `completed: true`, then pass the form ID and variable name to this save operation. RevCent assigns the saved version.

Create a new environment variable in the site's shared saved settings. The name must not already exist. Requires permission to edit the site.

Site variables configure server-side behavior, such as a service endpoint or an API token. In Node.js, read a saved variable at runtime with `process.env.MY_VARIABLE`. Values are not available during install/build or in browser code. [GetSite](GetSite.md) and [GetSites](GetSites.md) return names and version metadata, never the values.

Completing a form only collects the value; it does not save or deploy. This operation saves it and returns a RevCent-assigned `saved_version`. Do not send an expected version or retry key. Create rejects an existing case-sensitive name on the same site, even if the value is identical. If a response is lost after the save, retrying create can return an already-exists error. Check the names in GetSite before deciding whether another action is needed; do not automatically switch to edit.

**Saving does not start a deployment or change a running site.** After the save succeeds, push a new commit to `dev` for development or `main` for live. The saved changes take effect only when the new deployment becomes active. Until then, running sites keep their previous values, including a variable that has been removed from saved settings.

Development and live share one saved variable set, but each applies it through its own deployment. A deployment already queued or in progress keeps the version selected for its commit. Save first, then push a new commit; retrying an earlier commit does not pick up later saved changes.

The save response includes the assigned shared-set version and a `variables` array. Each entry has a name, `saved_version`, a `removed` flag, and `environments.dev` / `environments.live` with `applied_version` and `status`. Changing one variable leaves other variables' revisions unchanged. Revision identifiers may have gaps. GetSite/GetSites return the same per-variable metadata, never values.

`applied` means that variable's saved revision is active. `pending` and `pending_removal` require a new deployment; they do not mean a deployment is queued. `not_deployed` means the environment has no active deployment. Historical revisions that cannot be established return null and `unknown` status rather than an invented revision. Removed entries remain visible until both environments confirm absence, then disappear. Recreating a name receives a new revision, distinct from its prior values.


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.