# API Endpoint Map Mapping of Frontend features to Backend API endpoints. ## Shared / Common | Feature | Method | Endpoint | Description | |---------|--------|----------|-------------| | Cache Stats | GET | `/v1/metrics/cache-stats` | Get model cache hit rate and load times | | Health Check | GET | `/health` | System health status | ## Tenant API (Requires `X-Tenant-ID` header) | Feature | Method | Endpoint | Payload / Params | |---------|--------|----------|------------------| | Login | POST | `/v1/auth/login` | `{tenant_id, username, password}` | | Register | POST | `/v1/auth/tenants` | `{name, admin_email, admin_password}` | | Ask/Chat | POST | `/v1/ask/` | `{query, top_k}` | | Active Sources | GET | `/v1/sources/active` | - | | List Sources | GET | `/v1/sources/` | - | | Add URL | POST | `/v1/ingest/url` | `{url, name}` | | Upload Doc | POST | `/v1/ingest/upload` | Multipart: `file` | | Add YouTube | POST | `/v1/sources/youtube` | Form: `youtube_url`, `name`, `owner_attestation`, `transcript_file` | | Delete Source | DELETE | `/v1/sources/{id}` | - | | Toggle Source | PUT | `/v1/sources/{id}/toggle` | `?enabled=bool` | | Tenant Metrics | GET | `/v1/tenants/{tid}/metrics` | `?hours=int` | | Cloud Connectors | GET | `/v1/connectors/` | `?tenant_id=tid` | | Connect Start | GET | `/v1/connectors/{prov}/oauth/start` | `?tenant_id=tid` | | Sync Connector | POST | `/v1/connectors/{id}/sync` | - | | List Roots | GET | `/v1/connectors/{id}/roots` | - | | Update Targets | POST | `/v1/connectors/{id}/targets` | `?tenant_id=tid`, Body: `[{"id", "type"}]` | ## Admin API (Requires `Authorization: Bearer ` header) | Feature | Method | Endpoint | Payload / Params | |---------|--------|----------|------------------| | Admin Login | POST | `/v1/admin/auth/login` | `{username, password}` | | Admin Register | POST | `/v1/admin/auth/register` | `{username, email, password, registration_secret}` | | List Tenants | GET | `/v1/admin/tenants` | `?status_filter=pending/approved/rejected` | | Get Tenant | GET | `/v1/admin/tenants/{id}` | - | | Approve Tenant | POST | `/v1/admin/tenants/{id}/approve` | - | | Reject Tenant | POST | `/v1/admin/tenants/{id}/reject` | `{rejection_reason}` | | Global Metrics | GET | `/v1/admin/metrics` | - | | Audit Logs | GET | `/v1/admin/audit-logs` | `?limit=int&actor_type=str&action=str` |