Module api_config
Expand description
Per-property CRUD endpoints for /api/config/*.
Structs§
- Alias
Source Query - Channel
Bind Body POST /api/channels/bindrequest body. The GUI/HTTP equivalent ofzeroclaw channel bind-<type> <identity> --alias <alias>: authorize an operator-named identity on one channel alias without the in-chat/bind <code>round trip.- Delete
Plan Response - Dry-run impact of deleting an aliased entry — the cascade preview a surface
renders before confirming. Pure/read-only: computed from
plan_delete(the same reference walk the real delete uses) plus the live-ACP gate for agents. - Drift
Entry - One drift entry surfaced when in-memory Config diverges from the on-disk file.
- Drift
Response - Init
Query - Init
Response - List
Entry - Single entry in the list response for configuration properties.
- List
Query ?prefix=...query parameter for list.- List
Response - MapKey
Query - MapKey
Response - MapPath
Query - Migrate
Response - PatchOp
- One JSON Patch operation. Supports
add,remove,replace,test, and ZeroClaw’scommentextension. Every operation requirespath;add,replace, andtestrequirevalue, whilecommentrequirescomment. - Patch
OpResult - Single result entry in a successful PATCH response, one per applied op.
- Patch
Response - Prop
PutBody - PUT body. Value is
serde_json::Valueso typed values (booleans, arrays, numbers) round-trip correctly without going through the CLI’s comma-delimited string parser. - Prop
Query ?path=...query parameter shared by GET / DELETE / OPTIONS-with-path.- Prop
Response - Response for a non-secret GET / PUT / DELETE.
- RefSite
Dto - A single config reference site to an aliased entry, for the delete preview.
- Reload
Status Response - Rename
MapKey Body - Rename
MapKey Response - Secret
Response - Response for a secret GET / PUT / DELETE — never carries the value or its
length.
populated: truemeans the secret has a non-empty value on disk;populated: falsemeans the field is unset or empty. - Template
Entry - Templates
Response
Functions§
- compute_
drift - handle_
api_ channel_ bind - POST /api/channels/bind — add an inbound identity to a pairing channel’s
allowlist. Shares the exact bind core the CLI uses
(
bind_channel_identity_into), writes ONLY topeer_groups.<type>_<alias>.external_peers, and is gated by the same bearer auth as every other config write. Because the gateway and the running channels share oneArc<RwLock<Config>>, the swap makes the new peer live immediately — no daemon restart, and no/bindmessage. - handle_
config_ get - GET /api/config — compatibility whole-config read for older bundled dashboard pages. New clients should prefer the per-property API, but returning a masked snapshot here avoids a hard 405 when an older page is served by a newer gateway.
- handle_
delete_ map_ key DELETE /api/config/map-key?path=<section>&key=<alias>— remove an alias from a map-keyed section. Aliased config sections with executable delete support route through the same cascade engine as the delete preview; non-aliased sections keep the generic raw key removal. Persists on success.- handle_
delete_ plan GET /api/config/delete-plan?path=<section>&key=<alias>— dry-run the delete cascade for an aliased entry. Read-only; never mutates.- handle_
drift GET /api/config/drift— explicit drift summary for clients that want just the diff. SameDriftEntryshape used inListResponse.drifted.- handle_
get_ map_ keys GET /api/config/map-keys?path=<section>— list the current alias keys at a map-keyed section path, e.g.channels.discord→["default","work"].- handle_
init - POST /api/config/init?section=model_providers — instantiate
Nonenested sections with defaults, and only those: dynamic-map aliases are created throughPOST /api/config/map-key. When every requested section is already configured, returns{initialized: []}. - handle_
list - handle_
map_ key - handle_
migrate - handle_
options_ config - handle_
options_ prop - handle_
patch - handle_
prop_ delete - handle_
prop_ get - handle_
prop_ put - handle_
refresh_ context_ window - handle_
reload_ status GET /api/config/reload-status— pending-reload flag for the dashboard’s reload banner. Goes true on any config write, false on/admin/reload.- handle_
rename_ map_ key - handle_
resolve_ alias_ source GET /api/config/resolve-alias-source?source=<source>— list the configured alias values valid for an alias-reference field, resolved from the live config via the sharedConfig::resolve_alias_source.- handle_
templates