# `npx @sanity/cli functions env remove`

Delete one environment variable from a deployed Function. The command does not ask for confirmation and does not redeploy the Stack.

Run from the Blueprint directory or a subdirectory; the manifest is required even though the command only touches remote state.

## Required checks

1. Obtain authorization to remove the key.
2. Resolve the exact Function and Stack.
3. Run `functions env list` and confirm that the key is present.
4. Check whether the Function still requires the variable.

## Remove

```sh
npx @sanity/cli functions env remove process-order LEGACY_API_URL --json
```

Override the locally configured Stack with `--stack NAME_OR_ID`.

The JSON result contains the Function name and removed key, not the old value. If the value may be needed again, arrange a user-approved backup before removal; this command cannot retrieve it.
