-
-
Notifications
You must be signed in to change notification settings - Fork 23
Feature Guide REST API
Programmatic access to all Caddy Proxy Manager resources via a REST API.
A full REST API is available under /api/v1/. It supports the same operations as the web UI: managing proxy hosts, certificates, access lists, settings, users, and more.
The interactive OpenAPI 3.1.0 specification is available at /api-docs in the web UI, or as raw JSON at /api/v1/openapi.json.
The API supports two authentication methods:
curl -H "Authorization: Bearer <your-api-token>" \
https://your-instance:3000/api/v1/proxy-hostsIf you are already logged in via the web UI, API requests from the same browser session are authenticated automatically.
Manage tokens from the API Tokens page (/api-tokens) or the Profile page.
- Go to API Tokens or Profile.
- Enter a name and optional expiration date.
- Click Create.
- Copy the token immediately -- it is shown only once.
| Property | Description |
|---|---|
| Name | Human-readable label |
| Expiration | Optional future date after which the token stops working |
| Last used | Updated automatically (debounced to 60 seconds) |
Tokens are stored as SHA-256 hashes in the database. The raw token cannot be recovered after creation.
Admin users can view and delete any token. Non-admin users can only manage their own tokens.
| Resource | Methods | Path |
|---|---|---|
| Health | GET | /api/v1/health |
| Tokens | GET, POST, DELETE | /api/v1/tokens |
| Proxy Hosts | GET, POST, PUT, DELETE | /api/v1/proxy-hosts |
| L4 Proxy Hosts | GET, POST, PUT, DELETE | /api/v1/l4-proxy-hosts |
| Certificates | GET, POST, PUT, DELETE | /api/v1/certificates |
| CA Certificates | GET, POST, PUT, DELETE | /api/v1/ca-certificates |
| Client Certificates | GET, POST, DELETE | /api/v1/client-certificates |
| Client Cert Roles | GET | /api/v1/client-certificates/:id/roles |
| Access Lists | GET, POST, PUT, DELETE | /api/v1/access-lists |
| Access List Entries | GET, POST, DELETE | /api/v1/access-lists/:id/entries |
| Settings | GET, POST | /api/v1/settings/:group |
| Instances | GET, POST, PUT, DELETE | /api/v1/instances |
| Instance Sync | POST | /api/v1/instances/sync |
| Users | GET, POST, PUT, DELETE | /api/v1/users |
| Groups | GET, POST, PATCH, DELETE | /api/v1/groups |
| Group Members | POST, DELETE | /api/v1/groups/:id/members |
| mTLS Roles | GET, POST, PUT, DELETE | /api/v1/mtls-roles |
| mTLS Role Certs | POST, DELETE | /api/v1/mtls-roles/:id/certificates |
| mTLS Access Rules | GET, POST, PUT, DELETE | /api/v1/proxy-hosts/:id/mtls-access-rules |
| Forward Auth Access | GET, PUT | /api/v1/proxy-hosts/:id/forward-auth-access |
| Forward Auth Sessions | GET, DELETE | /api/v1/forward-auth-sessions |
| Audit Log | GET | /api/v1/audit-log |
| DNS Providers | GET | /api/v1/dns-providers |
| OAuth Providers | GET, POST, PUT, DELETE | /api/v1/oauth-providers |
| Caddy Apply | POST | /api/v1/caddy/apply |
All endpoints return JSON. Error responses use standard HTTP status codes (400, 401, 403, 404, 500) with a JSON body containing a message field.
The interactive API docs are available at /api-docs in the web UI. This page renders the full OpenAPI 3.1.0 specification with:
- Try-it-out functionality for all endpoints
- Request/response schema documentation
- Authentication configuration
The raw spec is also available at /api/v1/openapi.json for code generation tools.
curl -s -H "Authorization: Bearer $TOKEN" \
https://your-instance:3000/api/v1/proxy-hosts | jqcurl -s -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My App",
"domains": ["app.example.com"],
"upstreams": ["10.0.0.5:8080"],
"ssl_forced": true,
"enabled": true
}' \
https://your-instance:3000/api/v1/proxy-hosts | jqcurl -s -X POST -H "Authorization: Bearer $TOKEN" \
https://your-instance:3000/api/v1/caddy/apply | jqcurl -s -H "Authorization: Bearer $TOKEN" \
https://your-instance:3000/api/v1/settings/general | jq- Environment Variables Reference
- Feature Guide Proxy Hosts
- Feature Guide Forward Auth - Forward auth session and access endpoints
- Feature Guide User Management - User and group management endpoints
- Feature Guide mTLS RBAC - mTLS role and access rule endpoints
- Security Configuration
Need help? Open an issue with the request/response details (redact tokens and sensitive data).