Config Storage API
REST endpoints for database-backed configuration management with hot-reload support
Config Storage API
Store, retrieve, and manage configuration in the database with CRUD operations and hot-reload
Authentication Required
Config storage endpoints are protected by API key authentication (X-API-Key header, Authorization: Bearer header, or api_key query parameter). Configure with the API.Auth.APIKey setting.
Overview
The Config Storage API allows you to store configuration files (e.g., agentfield.yaml) in the database instead of on disk. This enables remote configuration management, especially useful when combined with the Connector API for SaaS-managed deployments.
Config precedence: environment variables > database config > file config > defaults
Bootstrap Safety
The storage section is never overridden from the database — database connection settings cannot come from the database itself. Similarly, connector config (token, capabilities) is always read from file/env for security.
List Configs
Get Config
Set Config
The maximum config body size is 1 MB.
Delete Config
Reload Config
Requires AGENTFIELD_CONFIG_SOURCE=db
The reload endpoint only works when the server was started with AGENTFIELD_CONFIG_SOURCE=db. Otherwise it returns 503.
Loading Config from Database
To use database-backed configuration at startup:
- Store your config via the API:
curl -X PUT http://localhost:8080/api/v1/configs/agentfield.yaml \
-H "X-API-Key: $API_KEY" \
-H "X-Updated-By: admin" \
--data-binary @agentfield.yaml- Start the server with the environment variable:
AGENTFIELD_CONFIG_SOURCE=db af server- Hot-reload after updating config in the database:
curl -X POST http://localhost:8080/api/v1/configs/reload \
-H "X-API-Key: $API_KEY"Connector Access
These endpoints are also available through the Connector API when the config_management capability is enabled. The connector routes mirror the API routes at /connector/configs/* with connector token authentication.
See the Connector API — Config Management section for details.
Related
- Connector API — Remote management via connector token
- Configuration Reference — File-based configuration options
- Environment Variables —
AGENTFIELD_CONFIG_SOURCEand other settings