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

# List environment variables

> Read an application's environment variables as a key-value object with GET /v2/apps/{app_id}/envs. Returns an empty object when none are set.

<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:read` [scope](/en/api-reference/authentication#scopes).

Returns the application's current environment variables as a flat key-value object, read directly from its `.env` file on the cluster. If no variables have been set yet, the response is a success with an empty object rather than an error.

Static applications don't support environment variables and return an error instead. On workspace-shared applications, the caller needs the `admin` [role](/en/api-reference/endpoint/workspace/members/invite#roles) or ownership.

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

## Parameters

<ParamField path="app_id" type="string" placeholder="App ID" required>
  The application ID.
</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 environment variables you defined.
</ResponseField>

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

## Common errors

| Code | HTTP | Meaning |
| - | - | - |
| `STATIC_APP_ENV_NOT_SUPPORTED` | 400 | The application is static; static apps don't support environment variables. |
| `READ_FAILED` | 400 | The `.env` file could not be read from the cluster. |

## Related

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


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