Use the balenaCloud API to perform a fleet-wide environment variable update and trigger device updates

domain: docs.balena.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Authenticate with the balenaCloud API using a session token or API key obtained from the balenaCloud console (Preferences > Access tokens); include it as Authorization: Bearer YOUR_TOKEN in all requests
  2. List current fleet environment variables: GET https://api.balena-cloud.com/v6/application_environment_variable?$filter=application/app_name eq '<fleet_name>'
  3. Create a new fleet-wide variable: POST https://api.balena-cloud.com/v6/application_environment_variable with body {"application": <app_id>, "name": "CONFIG_KEY", "value": "config_value"}
  4. Update an existing variable: PATCH https://api.balena-cloud.com/v6/application_environment_variable(<var_id>) with the new value; the supervisor on each device will detect the change and restart affected services
  5. For device-specific overrides, create a device_environment_variable record linked to the device's id instead of the application; device-level variables shadow fleet-level ones with the same name
  6. Verify the variable is visible inside the container by exec-ing into a running service and running printenv <VAR_NAME>

Known gotchas

Related routes

Deploy container-based OTA updates to a device fleet using balenaCloud
balena · 6 steps · unrated
Pin a balenaCloud fleet to a specific release and use the Supervisor API to control service restarts on individual devices
docs.balena.io · 6 steps · unrated
Push a new release to a balena fleet and pin a canary group of devices to a draft release before promoting it fleet-wide
docs.balena.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans