REST API endpoints for license management, policy distribution, and audit collection.
| Method | Path | Description |
|---|---|---|
| GET | /api/license | Get or issue license |
| POST | /api/license/refresh | Force-refresh license |
| GET | /api/policy | List policies |
| POST | /api/policy | Create policy |
| GET | /api/policy/:id | Get policy by ID |
| PUT | /api/policy/:id | Update policy |
| DELETE | /api/policy/:id | Soft-delete policy |
| GET | /api/policy/fetch | Fetch active YAML |
| GET | /api/audit | Query audit events |
| POST | /api/audit/ingest | Ingest audit events |
| GET | /api/keys | List API keys |
| POST | /api/keys | Create API key |
| DELETE | /api/keys/:id | Revoke API key |
| GET | /api/admin/members | List members |
| PATCH | /api/admin/members/:id | Change member role |
API requests are authenticated with Bearer tokens. Web dashboard uses session cookies. CLI uses API keys with the Authorization: Bearer tirith_... header.
/api/licenseGet or issue a license key for the authenticated user's org.
Returns the signed license token and expiry. Creates a new one if none exists or the current one is expired.
/api/license/refreshForce-refresh the license key for the org.
/api/policyList all policies for the org.
/api/policyCreate a new policy.
/api/policy/:idGet a specific policy including YAML content.
/api/policy/:idUpdate a policy. Increments version automatically.
/api/policy/:idSoft-delete a policy (sets active=false).
/api/policy/fetchFetch the active policy YAML for CLI consumption.
/api/auditQuery audit events with pagination and filtering.
Query params: since, until, action, rule_id, session_id, page, limit (max 200).
/api/audit/ingestIngest audit events from CLI clients.
/api/keysList all non-revoked API keys for the org (prefix only, never the hash).
/api/keysCreate a new API key. Returns the raw key once. Max 10 per org.
/api/keys/:idRevoke an API key (soft-delete). Must belong to your org.
/api/admin/membersList org members.
/api/admin/members/:idChange a member's role. Only owners can change roles.