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

# Environment Variables

> Manage organization environment variables available to Spark jobs and scripts.

Organization environment variables are available to Spark jobs and scripts at runtime. Names must start with a letter or underscore, contain only letters, numbers, and underscores, and are normalized to uppercase server-side.

## `list_environment_variables()`

List all organization environment variables. Values are decrypted server-side.

```python theme={null}
all_vars = await client.list_environment_variables()
for variable in all_vars:
    print(variable.name, variable.value)
```

### Return type: `list[EnvironmentVariable]`

| Field                | Type            | Description                      |
| -------------------- | --------------- | -------------------------------- |
| `id`                 | `str`           | Variable ID                      |
| `name`               | `str`           | Variable name (stored uppercase) |
| `value`              | `str`           | Decrypted value                  |
| `organization_id`    | `str`           | Owning organization              |
| `created_by_user_id` | `Optional[str]` | User who created the variable    |
| `created_at`         | `str`           | ISO timestamp when created       |
| `updated_at`         | `str`           | ISO timestamp when last updated  |

***

## `get_environment_variable(name)`

Get a single environment variable by name. Lookup is case-insensitive since names are stored uppercase. Returns `None` when not set.

```python theme={null}
token = await client.get_environment_variable("MY_TOKEN")
if token is not None:
    print(token.value)
```

***

## `set_environment_variable(name, value)`

Create or update an environment variable. Setting an existing name overwrites its value.

```python theme={null}
variable = await client.set_environment_variable("MY_TOKEN", "secret-value")
print(variable.id, variable.name)  # name is uppercased
```

***

## `delete_environment_variable(*, id=None, name=None)`

Delete an environment variable by `id` or `name`. Provide exactly one, as a keyword argument.

```python theme={null}
await client.delete_environment_variable(name="MY_TOKEN")
# or by id:
await client.delete_environment_variable(id="env-var-id")
```

Raises `ValueError` if the named variable does not exist.
