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

# Set Environment Variable

> Create or update an environment variable

Sets an environment variable for the specified project. Creates the variable if it does not exist, or updates it if it does.

## Authentication

Requires a valid Bearer token.

## Path Parameters

<ParamField path="id" type="string" required>
  Project ID (UUID).
</ParamField>

<ParamField path="key" type="string" required>
  Environment variable name.
</ParamField>

## Request Body

<ParamField body="value" type="string" required>
  The value to set for the environment variable.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "value": "postgresql://user:pass@host:5432/db"
  }
  ```
</RequestExample>

## Response

Returns `200 OK` on success.

## Errors

| Status | Description                                                  |
| ------ | ------------------------------------------------------------ |
| `400`  | Bad Request — missing `value`                                |
| `401`  | Unauthorized — missing or invalid token                      |
| `404`  | Not Found — project does not exist or you do not have access |
