caddy_load
Replace the entire Caddy configuration atomically with a JSON object or Caddyfile string. Requires confirm=true to discard the running config; a snapshot is saved for rollback via caddy_revert.
Instructions
Replace the entire Caddy configuration atomically. Accepts a JSON config object, or a Caddyfile string with format='caddyfile'. This is the safest way to make large config changes. Runs on CADDY_LOAD_TIMEOUT (55 s by default), like every config change; a load that times out is not retried and may still apply, so re-read the config before loading again. Requires confirm=true: this DISCARDS the entire running config, including servers and routes not present in the supplied config. The prior config is snapshotted first and can be restored with caddy_revert.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | Yes | Full config — JSON object or Caddyfile text string | |
| format | No | Config format: 'json' (default) or 'caddyfile' | json |
| confirm | No | Must be true to replace the running configuration (safety) |