caddy_config_by_id
Access Caddy config objects by their @id tag to read, update, or delete individual routes without needing full paths. Set mode controls overwrite, append, or insert; confirm=true is required for deletion.
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 |