> ## 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 Variables

> Remove a environment variable.

<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>

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 Administrator role 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 successful, `error` if not.
</ResponseField>

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

<ResponseExample>
  ```json theme={null}
  {
    "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.                 |
