caddy_load
Atomically replace the entire Caddy configuration using a JSON object or Caddyfile, with the previous configuration snapshotted for rollback. Requires explicit confirmation before applying.
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. Has a 60-second timeout to allow for TLS provisioning. 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) |