Documentation

api

Environment Variables API

Manage environment variables for your deployments.

Environment Variables#

Environment variables are injected into your container at runtime. They are never baked into the Docker image, so your secrets stay safe.


GET/deployments/{id}/env

List all environment variables for a deployment. Values are returned in full.

🔒 Auth: Bearer token required

Parameters
iduuidrequiredDeployment ID
Response
[
  { "key": "DATABASE_URL", "value": "postgresql://..." },
  { "key": "NODE_ENV", "value": "production" }
]

Example: list env vars

bash
curl https://api.runix.dev/deployments/a1b2c3d4-.../env \
  -H "Authorization: Bearer $TOKEN"

POST/deployments/{id}/env

Set or update environment variables. If a key already exists, its value is replaced. New keys are added. Existing keys not included in the request are left unchanged.

🔒 Auth: Bearer token required

Parameters
iduuidrequiredDeployment ID
varsobjectrequiredKey-value pairs of environment variables

Example: set env vars

bash
curl -X POST https://api.runix.dev/deployments/a1b2c3d4-.../env \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vars": {
      "DATABASE_URL": "postgresql://user:pass@host:5432/db",
      "REDIS_URL": "redis://host:6379"
    }
  }'

Changing environment variables does NOT automatically restart your service. You need to redeploy for changes to take effect.


DELETE/deployments/{id}/env/{key}

Remove a single environment variable by key.

🔒 Auth: Bearer token required

Parameters
iduuidrequiredDeployment ID
keystringrequiredThe environment variable key to remove

Example: delete an env var

bash
curl -X DELETE https://api.runix.dev/deployments/a1b2c3d4-.../env/OLD_SECRET \
  -H "Authorization: Bearer $TOKEN"