set_app_config
Update a deployed app's deploy, AI, or database config sections with validation and optional dry runs. Restart the service to apply changes or get a report on whether a restart is needed.
Instructions
Write an app's deploy or ai config section (admin/owner-scoped).
Writing the ``ai`` section re-wires the app's bindings: on the next
launch/restart each ``[ai.<name>]`` binding is injected as
``NERDIT_AI_<NAME>_URL/_KEY/_MODEL``, and the ``default`` binding also
sets ``OPENAI_BASE_URL/OPENAI_API_KEY/OPENAI_MODEL`` — pass
``restart=True`` to apply it immediately. A dry run needs neither an
``If-Match`` nor an idempotency key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of a deployed app (``kind=service``). A served model or a managed database is a 404 ``config.not_an_app``; an unknown name a 404 ``not_found``. | |
| values | Yes | Keys to merge into that section: an omitted key keeps its value, a null deletes it (a whole binding, or a ``deploy`` key back to its default). In ``ai``/``db`` the unit is the binding — each ``[ai.<name>]``/``[db.<name>]`` table REPLACES the stored one wholesale, so send the whole binding. In ``deploy`` name and port are immutable (422); ``get_app_config`` lists the writable keys. | |
| dry_run | No | true = validate and return the plan (what would change) with zero writes; nothing is built, deployed or audited as a change. | |
| restart | No | true = restart the service right after a real write, whether or not the change needed one. false leaves the running container alone and the response's ``requires_restart`` says whether it should be restarted. No effect when ``dry_run`` is true. | |
| section | Yes | Section to write: ``deploy``, ``ai`` or ``db`` (anything else is a 422 ``config.unknown_section``). ``env`` is not writable here — it belongs to the deploy tools and ``set_secret``. | |
| if_match | No | ETag from a previous read of this app's config, sent as ``If-Match`` (409 ``config.stale`` when it no longer matches). Omit and the current ETag is read and used for you; ``*`` matches unconditionally. | |
| idempotency_key | No | Caller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts. |