> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove environment variables

> Delete one or more environment variables by key with DELETE /v2/apps/{app_id}/envs. Missing keys are ignored and the remaining variables are returned.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Requires an API key with the `envs:write` [scope](/en/api-reference/authentication#scopes).

Deletes one or more environment variables by key, leaving every other variable untouched. Keys that don't currently exist are silently ignored, so it's safe to call with a list that mixes valid and already-removed names.

Static applications don't support environment variables and return an error. On workspace-shared applications, the caller needs the `admin` [role](/en/api-reference/endpoint/workspace/members/invite#roles) or ownership. The response returns the full set of remaining variables, so you can confirm the removal without a separate [List Variables](/en/api-reference/endpoint/apps/envs/get) call.

To add variables back or replace the whole set, see [Add/Edit Variables](/en/api-reference/endpoint/apps/envs/add_n_edit) and [Overwrite Variables](/en/api-reference/endpoint/apps/envs/overwrite).

## Parameters

<ParamField path="app_id" type="string" placeholder="App ID" required>
  The application ID.
</ParamField>

<ParamField body="envs" type="string[]" required>
  The array containing the keys to remove.
</ParamField>

## Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful: `success` if it was, `error` if not.
</ResponseField>

<ResponseField name="response" type="object">
  The key and value of all remaining environment variables.
</ResponseField>

<ResponseExample>
  ```json theme={"system"}
  {
    "status": "success",
    "response": {
      "REMAINING": "secret"
    }
  }
  ```
</ResponseExample>

## Common errors

| Code | HTTP | Meaning |
| - | - | - |
| `STATIC_APP_ENV_NOT_SUPPORTED` | 400 | The application is static; static apps don't support environment variables. |
| `INVALID_ENV_CONTENT` | 400 | `envs` is missing, not an array, or empty. |
| `ENV_NAME_TOO_LONG` | 400 | A key in `envs` is not a string or exceeds 1024 characters. |

## Related

* CLI: [`squarecloud app env remove`](/en/cli-reference/environment-variables#squarecloud-app-env-remove)
* SDKs: [`api.apps.envs.delete()`](/en/sdks/js/environment_variables) (JavaScript), [`client.apps.envs.delete()`](/en/sdks/py/environment_variables) (Python), [`c.Apps.Envs.Delete()`](/en/sdks/go/environment_variables) (Go)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.