Enter your admin credentials to view the internal API reference.
Endpoint catalogue for integrations and operations. Base URL:
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /health | None | Service and database health |
| GET | /api/products | None | Public product catalog for subscribe page |
Called from SharePoint web parts. CORS enabled for SharePoint Online origins when APP_ORIGIN includes sharepoint-online.
| Method | Path | Notes |
|---|---|---|
| GET | /api/subscription/status | tenantId, siteUrl, siteId?, productSlug? — creates site on first call |
| POST | /api/subscription/activate | licenseKey, tenantId, siteUrl, siteId?, productSlug? |
| POST | /api/subscription/checkout | tenantId, siteUrl, userEmail, successUrl, cancelUrl |
| POST | /api/subscription/portal | tenantId, siteUrl, returnUrl |
| POST | /api/subscription/webhook | Stripe webhook (raw body, Stripe signature) |
Same operations as v1 with Entra ID token required on every request. See SPFx guide for AadHttpClient setup.
| Method | Path |
|---|---|
| GET | /api/v2/subscription/status |
| POST | /api/v2/subscription/activate |
| POST | /api/v2/subscription/checkout |
| POST | /api/v2/subscription/portal |
| Method | Path | Auth | Notes |
|---|---|---|---|
| POST | /api/notifications/send | Active subscription | SPFx public send — requires trial/active access |
| POST | /api/v2/notifications/send | AAD + subscription | v2 send with Entra token |
| POST | /api/logs | None | Client log ingest → spfx_app_logs |
POST /api/notifications/send
{
"tenantId": "00000000-0000-0000-0000-000000000000",
"productSlug": "people-hub",
"appName": "People Hub",
"to": ["user@contoso.com"],
"subject": "Action required",
"html": "<p>Message body</p>"
}
Customer-facing quiz generation powered by Gemini. Requires Authorization: Bearer <LFLEX-api-key>. Issue keys from the admin route below.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/learnflex/quizzes | Service info (requires API key) |
| POST | /api/learnflex/quizzes | Generate quiz from text or topic |
POST /api/learnflex/quizzes
{
"sourceType": "text",
"content": "Photosynthesis converts light energy into chemical energy...",
"settings": {
"questionCount": 10,
"difficulty": "medium",
"questionTypes": ["multiple_choice"],
"language": "en"
}
}
All routes require Authorization: Bearer <admin token> from POST /api/admin/login.
| Method | Path | Purpose |
|---|---|---|
| POST | /api/admin/login | Issue admin bearer token |
| GET | /api/admin/stats | Tenant subscription summary |
| GET/PATCH | /api/admin/tenants | List or update tenant subscriptions |
| GET/PATCH | /api/admin/sites | Site installations (?stats=1 for counts) |
| GET/POST/PATCH | /api/admin/products | Product catalog management |
| GET/POST/PATCH | /api/admin/license-keys | Offline license keys |
| GET/POST/PATCH | /api/admin/learnflex-api-keys | LearnFlex customer API keys (?stats=1) |
| GET | /api/admin/analytics | Install and usage analytics |
| GET/POST/PATCH/DELETE | /api/admin/email-templates | Email template CRUD |
| GET/DELETE | /api/admin/email-notifications | Email delivery history and preview (?id=, ?stats=1). Delete one with ?id= or clear with ?all=1 |
| POST | /api/admin/notifications/send | Admin send (optional skipAccessCheck) |
| GET/PATCH/POST | /api/admin/cron/trial-follow-up | Trial follow-up cron settings & manual run |
| GET | /api/admin/cron/jobs | All scheduled cron jobs |
| GET | /api/admin/cron/runs | Cron job history (?stats=1, ?report=1 for yesterday, filters: jobId, source, status, hideChecks=1) |
| GET | /api/admin/requests | API request log (?stats=1) |
| DELETE | /api/admin/requests | Delete by ?id= or purge with ?olderThanDays=30|90|180|365 (optional ?app=) |
| GET/DELETE | /api/admin/logs | App log viewer |
| GET | /api/admin/events | Subscription events for a tenant |
| GET | /api/admin/settings/status | Settings store availability |
| Schedule | Path | Auth |
|---|---|---|
| Hourly poll | /api/cron/trial-follow-up | CRON_SECRET |
| Hourly poll | /api/cron/trial-welcome | CRON_SECRET |
| Hourly poll | /api/cron/trial-expiring-soon | CRON_SECRET |
| Hourly poll | /api/cron/trial-ended | CRON_SECRET |
| Hourly poll | /api/cron/subscription-thank-you | CRON_SECRET |
Configure jobs in Cron jobs and review invocations on Cron history. Vercel cron definitions live in vercel.json.