Skip to main content
Environment variables are stored encrypted at rest and injected into the server process at runtime. Variable values are never returned via the API — only the variable names (keys) are exposed. Required scope: servers:read (list), servers:write (set/delete)

List env var names

GET /v1/servers/:serverId/env
Returns the names of all environment variables set on the server. Values are not returned. Response 200:
{
  "data": ["DATABASE_URL", "API_SECRET", "LOG_LEVEL"]
}

Set env var

POST /v1/servers/:serverId/env
Creates or updates an environment variable. The variable is available on the next deployment. Request body:
{
  "name": "DATABASE_URL",
  "value": "postgres://user:pass@host:5432/db"
}
FieldTypeRequiredDescription
namestringVariable name — uppercase letters, digits, or underscores; must start with a letter or underscore (e.g. DATABASE_URL)
valuestringVariable value (stored encrypted)
Response 201 (new variable) or 200 (updated variable):
{
  "data": {
    "id": "env_abc123",
    "serverId": "srv_xyz789",
    "name": "DATABASE_URL",
    "createdAt": "2026-01-15T10:00:00Z",
    "updatedAt": "2026-01-15T10:00:00Z"
  }
}

Set env var by name

PUT /v1/servers/:serverId/env/:name
Creates or updates the env var identified by :name in the URL path. Request body:
{
  "value": "postgres://user:pass@host:5432/db"
}
Response 201 (new) or 200 (updated): Env var object (same shape as above).

Delete env var

DELETE /v1/servers/:serverId/env/:name
Removes the named environment variable. The change takes effect on the next deployment. Response 204: No content.