caddy_config_by_id
Manage Caddy config objects by their @id tag instead of full paths. Get, set, or delete any object with @id; deletion requires explicit confirmation.
Instructions
Access config by @id tag. Any config object with an '@id' field can be read, updated, or deleted by its ID instead of needing its full path. This is the recommended way to manage individual routes and config objects. The 'delete' action requires confirm=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The @id value of the config object | |
| mode | No | For 'set' action: 'overwrite' = PATCH (replace existing, default), 'append' = POST (add to arrays, create on objects), 'insert' = PUT (insert at array index) | overwrite |
| value | No | New value (required for 'set' action) | |
| action | No | Action to perform | get |
| confirm | No | Must be true to actually delete (only enforced for action='delete') | |
| subpath | No | Optional sub-path within the identified object |