API Endpoints π‘ BETA
Check that the API exposes only the routes the source declares and that every state-changing call is authenticated and protected.
Admin guide Β· API exposure runbook
| When to use | Before you start | Steps | Verify | Roll back |
|---|---|---|---|---|
| Before taking traffic, after a route change, during an audit | Running server, generated reference available | Probe headers, auth, CSRF and limits | Routes match source, no anonymous admin | Restore the previous config or binary |
When to use
Use this runbook when a release changes routes, when an audit asks for the exposed surface, or when an unauthenticated call unexpectedly succeeds.
Before you start
- The route list is generated from the source into
08-rest-api-tools/generated/; do not maintain a parallel hand-written list. Start with the generated auth reference and generated admin reference. - Authentication is resolved by the directory service; a Bearer token is required on API calls. State-changing methods require CSRF except for Bearer-token API endpoints.
- Security headers must be present on every response, and rate-limit defaults are 100 req/s general, 10 req/s auth and 50 req/s API per token.
- Health is served by the API process, not by a complete HTML page; botserver never serves full HTMX pages.
Steps
# 1. Headers and health on the API process.
curl -sI http://localhost:8080/health
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/health
# 2. An unauthenticated call must not return an admin payload.
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/api/product
# 3. A state-changing call without CSRF or Bearer token must be refused.
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://localhost:8080/api/auth/logout
# 4. Compare the live surface with the generated reference.
# Every route in the generated pages must come from the source; a route
# found in prose but absent there is not implemented.
Verify
| Check | Command / surface | Pass condition |
|---|---|---|
| Headers | curl -sI http://localhost:8080/health |
all six IMP-09 headers present |
| Health | curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health |
200 |
| Anonymous access | unauthenticated admin call | refused, no admin data |
| CSRF | state-changing call without token | refused |
| Route parity | generated API reference | route set matches source |
| Limits | system limits | 100 / 10 / 50 req/s defaults in force |
Do not trust a 200 alone on a proxied host: a missing page can return the home page with status 200. Compare the response body or a checksum.
Roll back
π΄ Undo the route or configuration change through version control and redeploy via the deploy runbook. Restore the previous policy from Vault if the exposure came from a configuration value; then repeat the table above.