API reference
Base URL: http://localhost:8040 (local) or https://executor-api.planningpowertools.com. Consequential endpoints (marked 🔒) require the X-Approval-PIN header when the server sets POWEREXECUTOR_PIN.
Health & status
| Method | Path | Purpose |
| GET | /health | {"status":"healthy"} — liveness. |
| GET | /api/admin/status | Kill-switch, degraded reason, actions used today. |
Cycles & reports
| Method | Path | Purpose |
| POST | /api/cycle/run?product=… | Run one operating cycle now. Returns the report. |
| GET | /api/reports/latest?product=… | The most recent cycle report (404 if none). |
Approvals
| Method | Path | Purpose |
| GET | /api/approvals?product=…&status=pending | List approvals by status. |
| POST 🔒 | /api/approvals/{id}/approve?product=… | Execute the action. 503 if the safety envelope blocks (stays pending). |
| POST 🔒 | /api/approvals/{id}/reject?product=… | Discard the approval. |
Autonomy
| Method | Path | Purpose |
| GET | /api/autonomy?product=… | Per-capability level, streak, and last-change reason. |
| POST 🔒 | /api/autonomy/set | Body {product, capability_id, level} (level 1–3). |
Safety
| Method | Path | Purpose |
| POST 🔒 | /api/admin/kill-switch | Body {on: true|false}. |
| POST 🔒 | /api/admin/degraded/clear | Clear degraded mode. |
Example
curl "http://localhost:8040/api/approvals?product=powermarketing"
curl -X POST "http://localhost:8040/api/approvals/<id>/approve?product=powermarketing" \
-H "X-Approval-PIN: 1234"
curl -X POST "http://localhost:8040/api/autonomy/set" \
-H "Content-Type: application/json" -H "X-Approval-PIN: 1234" \
-d '{"product":"powermarketing","capability_id":"update_post","level":2}'
Interactive OpenAPI docs are also served by the API at /docs.