Set app variables
set_app_variablesAdd, change or remove environment variables of a hosted app or bot. Pass set as a map of NAME to value for the ones to write, and unset as a list of names to remove. Everything not named is left exactly as it is, values included. The response never contains a value, only the names that were written and removed: pass a value in, never expect one back. Saving environment recreates the container, so the app restarts and is offline for about a minute. Removing DISCORD_TOKEN from a Discord bot is refused, because it would take the bot down for good. A changed DISCORD_TOKEN is checked with Discord first and refused if Discord rejects it. The credentials of a bundled one-click database are written by FadeHost and are put back on every save, so they cannot be changed or removed here. Refuses a paused app and a suspended owner. Needs full access to the app, the same as the panel Environment tab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | The app id (bot_...) from list_bots. | |
| set | No | The variables to write, as a map of NAME to value, for example {"LOG_LEVEL": "debug"}. A name that already exists is overwritten. Names are variable names: letters, digits and underscores, not starting with a digit. | |
| unset | No | The variable names to remove, for example ["OLD_API_KEY"]. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kept | Yes | Names asked to be removed that are still set, because FadeHost manages them. | |
| count | Yes | How many variables the app holds now. | |
| status | Yes | The app status after the save, usually deploying. | |
| removed | Yes | The names that were removed. | |
| written | Yes | The names that were written. Values are never returned. |