Caddy
Use these endpoints to manage Caddy operations on a Crate Operator host. The reference below includes request attributes, response shapes, and executable request examples.
The Caddy object
Optional attributes
@id stringhandle array<CaddyRouteHandle>match array<CaddyRouteMatch>terminal boolean/v1/caddy/routesGet current Caddy routes
Responses
200 OK503 Caddy unavailable/v1/caddy/routesCreate a new Caddy route
Creates a new Caddy reverse-proxy route. The route @id is derived from the provided domain. If a route with the same @id already exists, a 409 Conflict is returned.
Request attributes
Required attributes
domain stringHostname this route matches.
upstreams array<object>Optional attributes
callback_url string<uri> | nullOptional callback URL to receive a route_backup event before mutation.
strategy stringLoad-balancing selection policy.
terminal booleanWhether the route is terminal.
Responses
201 Created400 Bad Request409 Route already exists503 Caddy unavailable/v1/caddy/routes/{route_id}Replace a Caddy route
Fully replaces an existing Caddy route. The previous route state is captured before mutation and used for automatic rollback if the operation fails. If callback_url is provided, the previous state is also sent to the main app for durability.
Parameters
route_id string path requiredThe Caddy route @id.
Request attributes
Required attributes
domain stringHostname this route matches.
upstreams array<object>Optional attributes
callback_url string<uri> | nullOptional callback URL to receive a route_backup event before mutation.
strategy stringLoad-balancing selection policy.
terminal booleanWhether the route is terminal.
Responses
200 OK400 Bad Request403 Operator route is immutable404 Route not found503 Caddy unavailable or rollback failed/v1/caddy/routes/{route_id}Delete a Caddy route
Deletes a Caddy route. The route state is captured before deletion and used for automatic rollback if the deletion fails. If callback_url is provided, the captured state is also sent to the main app for durability.
Parameters
route_id string path requiredThe Caddy route @id.
Request attributes
Optional attributes
callback_url string<uri> | nullOptional callback URL to receive a route_backup event before mutation.
Responses
204 No Content400 Bad Request403 Operator route is immutable404 Route not found503 Caddy unavailable or rollback failed