Docs web SCREENS.md
Web (PWA) — Screen Specs
All 75 screens, plus the 12 console screens (§ C), with the native Web (PWA) container and controls for each element. Behavior, data and copy are identical to ../00-shared/SCREEN-SPECS.md; construction rules for this platform are in PLATFORM-SPEC.md.
Container per archetype
| Archetype | Container |
|---|---|
| auth | Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone |
| grid | Main pane, CSS grid (auto-fill minmax 160px) |
| list | List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px |
| table | Virtualized grid table ≥ 1024 px; card rows below |
| detail | Detail pane with header, tablist, toolbar; full page < 768 px |
| tab | tabpanel (route segment) |
| form | Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px |
| settings | Grouped settings rows in main pane |
| confirm | <dialog role=alertdialog>; bottom sheet < 768 px |
| secret | Modal <dialog>, cancel prevented, no Esc |
| wizard | Dialog/sheet with step indicator; each step a URL hash |
| popover | Popover ≥ 1024 px; side panel 768–1023; bottom sheet < 768 |
| handoff | window.open (new tab) / same-tab redirect for PKCE |
| overlay | Top-layer <dialog> / popover |
| hub | Bottom-nav destination list < 768 px |
D1 · Sign-in & Identity
AUTH-01 — Sign in
Domain: D1 Sign-in & Identity · Route: /sign-in · Archetype: auth · Phase: MVP
Who: Unauthenticated
Purpose: Exchange email + password for a session, or start an MFA challenge.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
Entry points: App launch with no stored session; Session expired / revoked (preserves ?next= destination); Sign out
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| email-field | body.email | required; RFC 5322; trim; autofill username | ||
| Password | password-field | + reveal | body.password | required; reveal toggle; autofill current-password |
| Sign in | primary-button | POST /auth/login | disabled until both fields non-empty | |
| Forgot password? | link | / | → AUTH-05 | |
| Create an account | link | / | → AUTH-03 | |
| Continue with SSO | button | POST /auth/sso/{provider}/callback | hidden behind flag sso (API returns 501 today) |
|
| Sign in with a passkey | button | — | hidden behind flag passkeys; reserved for when the API supports WebAuthn |
| Action | Call | Result handling |
|---|---|---|
| Sign in | POST /auth/login |
200 AuthSession → store tokens → go to next or APP-01. 200 MfaChallenge → AUTH-02 with mfa_token. |
| — | 401 → inline form error "Email or password is incorrect." (never reveal which). 403 → account suspended/locked message; test_user_expired → "This test account has expired." 429 → disable button, countdown from Retry-After. |
States: Submitting: button spinner, fields read-only; Locked out (5 failures / 15 min): explain wait time
Notes: test_mode is never exposed in end-user UI; developer builds may show a hidden toggle (long-press logo / ⌥-click) for test-mode sign-in. The horizontal logo lockup (BrandLockup, brand/BRAND.md) sits above the form.
AUTH-02 — Two-factor challenge
Domain: D1 Sign-in & Identity · Route: /sign-in/mfa · Archetype: auth · Phase: MVP
Who: Holder of mfa_token
Purpose: Complete sign-in with a passkey, a TOTP code or a recovery code.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
Entry points: AUTH-01 returned MfaChallenge
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Use a passkey | primary-button | POST /auth/mfa/passkey-options {mfa_token} → platform passkey prompt → POST /auth/mfa/verify {mfa_token, passkey} |
shown first when methods includes passkey and the platform supports passkeys (CLIENT-ARCHITECTURE §4.4); cancelling the OS prompt falls back to the code field |
|
| Code | otp-field | body.code | only if methods includes totp; 6 digits; paste fills all; auto-submit on 6th digit; OS one-time-code autofill |
|
| Use a recovery code | link | / | swaps to Recovery code field | only if methods includes recovery_code |
| Recovery code | text-field | body.recovery_code | format xxxx-xxxx; case-insensitive | |
| Expiry countdown | caption | MfaChallenge.expires_in | announce at 60 s and 10 s | |
| Verify | primary-button | POST /auth/mfa/verify |
| Action | Call | Result handling |
|---|---|---|
| Verify | POST /auth/mfa/verify |
200 → same as AUTH-01 success. 401 → "That code didn't work." clear field. 401 passkey_invalid / 404 passkey_not_registered → "That passkey didn't work. Try another, or use a code." Expired → back to AUTH-01 with message. 429 → countdown. |
States: Challenge expired
AUTH-03 — Create account
Domain: D1 Sign-in & Identity · Route: /sign-up · Archetype: auth · Phase: MVP
Who: Unauthenticated
Purpose: Self-service signup with email and password.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
Entry points: AUTH-01 link; Marketing/app deep link with optional application_id
Loads: GET /platform/settings (no sign-in needed) → signup_open, announcement. When signup_open is false, hide the form and say "Sign-up is closed right now. If you were invited, use the link in your invitation email."
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Display name | text-field | body.display_name | optional; ≤ 100 | |
| email-field | body.email | required | ||
| Password | password-field | password-field | body.password | required; strength meter; autofill new-password; show policy hint |
| Create account | primary-button | POST /auth/signup | ||
| Terms / Privacy | links | Terms of Service · Privacy Policy | "By creating an account you agree to the Terms of Service and Privacy Policy." Opens in the system browser |
| Action | Call | Result handling |
|---|---|---|
| Create account | POST /auth/signup |
403 signup_closed → the closed state above. 201 AuthSession → AUTH-04 (verify pending) then APP-01. 409 email_taken → "An account with this email may already exist. Sign in or reset your password." (with details.reason invitation_pending the API re-sends the invitation: say "Check your email for your invitation.") 422 → field errors. |
Notes: Pass application_id through when signup started from an app's link; it is recorded as signup_application_id. Every new User starts on the Free plan and receives platform-managed free Entitlements to every free Application, including the Hub itself (app_hub). No plan choice at signup; upgrading is BIL-01.
AUTH-04 — Verify your email
Domain: D1 Sign-in & Identity · Route: /verify-email · Archetype: auth · Phase: MVP
Who: Signed in (unverified) or token holder
Purpose: Tell the user to check email; complete verification from the emailed link.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
Entry points: After signup; Persistent banner on APP-01 while email_verified is false; Deep link /verify-email?token=…
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Instruction | text | User.email | "We sent a link to {email}." | |
| Resend email | button | POST /auth/email/verify/resend | 30 s cooldown after each send | |
| Continue to Substratal | button | → APP-01 | unverified users may continue | |
| Change email | link | / | → ACC-02 |
| Action | Call | Result handling |
|---|---|---|
| Deep link opened | POST /auth/email/verify {token} |
204 → success state, refresh User. 400 → "This link has expired." + Resend. |
| Resend email | POST /auth/email/verify/resend |
Always 202 → toast "If that address needs verifying, we sent a new link." |
AUTH-05 — Forgot password
Domain: D1 Sign-in & Identity · Route: /forgot-password · Archetype: auth · Phase: MVP
Who: Unauthenticated
Purpose: Request a password-reset email.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| email-field | body.email | prefilled from AUTH-01 | ||
| Send reset link | primary-button | POST /auth/password/forgot |
| Action | Call | Result handling |
|---|---|---|
| Send reset link | POST /auth/password/forgot |
Always 202 → confirmation "If an account exists for {email}, we sent a reset link." 429 → countdown. |
AUTH-06 — Set a new password
Domain: D1 Sign-in & Identity · Route: /reset-password · Archetype: auth · Phase: MVP
Who: Reset-token holder
Purpose: Choose a new password from the emailed reset link.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
Entry points: Deep link /reset-password?token=…
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| New password | password-field | + reveal | body.new_password | strength meter; autofill new-password |
| Confirm password | password-field | + reveal | client only | must match |
| Notice | caption | "You'll be signed out on all devices." | ||
| Save password | primary-button | POST /auth/password/reset |
| Action | Call | Result handling |
|---|---|---|
| Save password | POST /auth/password/reset |
204 → clear local session → AUTH-01 with success banner. 400 → expired link + link to AUTH-05. 422 → field errors. |
AUTH-07 — Accept invitation
Domain: D1 Sign-in & Identity · Route: /invite · Archetype: auth · Phase: MVP
Who: Invitation-token holder
Purpose: Activate an account an admin created: set password and sign in.
Web (PWA) container: Standalone route outside the app shell, centered card ≥ 768 px, full-bleed on phone
Entry points: Deep link /invite?token=… from the invitation email
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Display name | text-field | body.display_name | optional | |
| Password | password-field | + reveal | body.password | strength meter |
| Accept and continue | primary-button | POST /auth/invitations/accept |
| Action | Call | Result handling |
|---|---|---|
| Accept and continue | POST /auth/invitations/accept |
200 AuthSession → APP-01. 400 → "This invitation is no longer valid. Ask your admin to resend it." |
D2 · Account & Security
ACC-01 — Account & profile
Domain: D2 Account & Security · Route: /account · Archetype: settings · Phase: MVP
Who: Self
Purpose: View and edit the signed-in user's global profile.
Web (PWA) container: Grouped settings rows in main pane
Loads: GET /users/me · GET /users/me/profile
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Avatar | image-picker | + paste + drop | Profile.avatar_url (hosted at https://assets.substratalapps.com) |
camera / photo library / file / paste; crop square; PNG, JPEG or WebP, ≤ 2 MB, ≤ 2048 × 2048; upload flow in CLIENT-ARCHITECTURE §4.3. Remove photo → initials |
| Display name | text-field | Profile.display_name | required; ≤ 100; save on blur/Return | |
| row → ACC-02 | row link | User.email + email_verified + pending_email | shows "Pending: {pending_email}" when set | |
| User ID | id-chip | + copy button |
User.id | copy |
| Contact email | email-field | Profile.contact_email | optional | |
| Contact phone | phone-field | Profile.contact_phone | optional; E.164 formatting by locale | |
| Plan | row → BIL-01 | row link | User.plan free|standard + plan_sources | "Free" or "Standard · via {org}" / "Standard · your subscription" |
| Member since / last sign-in | caption | User.created_at, last_login_at | locale formatted | |
| Sign out | button | POST /auth/logout | always visible at the bottom of Account (mobile) / account menu (desktop) |
| Action | Call | Result handling |
|---|---|---|
| Edit field | PATCH /users/me/profile (If-Match) |
Save per field; 409 version_conflict → reload prompt; 422 → field error. |
| Change photo | POST /users/me/avatar/uploads {content_type, content_length} → POST the file to url with fields → POST /users/me/avatar/uploads/{uploadId}/complete |
progress on the avatar; 200 Profile → new avatar_url. 422 invalid_image (details.reason) → "That image can't be used: {reason}."; 404 upload_not_found → start again; 429 → 10 uploads an hour |
| Remove photo | DELETE /users/me/avatar |
204 → initials |
| Sign out | POST /auth/logout |
best effort; always wipe local credentials and cache → AUTH-01 |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
Notes: The API hosts the image; the client never chooses a storage location. PATCH still accepts an external https avatar URL, but the Hub always uploads.
ACC-02 — Change email
Domain: D2 Account & Security · Route: /account/email · Archetype: form · Phase: MVP
Who: Self
Purpose: Start an email change; the new address must be verified.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| New email | email-field | body.email | required; differs from current | |
| Save | primary-button | PATCH /users/me |
| Action | Call | Result handling |
|---|---|---|
| Save | PATCH /users/me {email} |
200 → User.pending_email set; show AUTH-04-style "check your new inbox". 409 not_unique → "That email is already in use." |
ACC-03 — Change password
Domain: D2 Account & Security · Route: /account/security/password · Archetype: form · Phase: MVP
Who: Self
Purpose: Change password knowing the current one.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Current password | password-field | + reveal | body.current_password | autofill current-password |
| New password | password-field | + reveal | body.new_password | strength meter; autofill new-password |
| Save | primary-button | POST /users/me/password |
| Action | Call | Result handling |
|---|---|---|
| Save | POST /users/me/password |
204 → toast "Password changed". 401 → "Current password is incorrect." 422 → policy errors. |
ACC-04 — Security
Domain: D2 Account & Security · Route: /account/security · Archetype: settings · Phase: MVP
Who: Self
Purpose: Password, two-factor and active sessions in one place.
Web (PWA) container: Grouped settings rows in main pane
Loads: GET /users/me · GET /users/me/sessions
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Password | row → ACC-03 | row link | "Change…" | |
| Passkeys | list | virtualized list | GET /users/me/mfa/passkeys: name, created_at, last_used_at, synced (backup_state) |
Add passkey → POST /users/me/mfa/passkeys/registration-options → platform prompt → POST /users/me/mfa/passkeys {attestation, name}; Rename → PATCH …/{passkeyId} (If-Match); Remove → DELETE …/{passkeyId} (step-up; removing the last method turns two-step off). Up to 10 (409 passkey_limit_reached). Hidden where the platform has no passkey support |
| Two-factor authentication | toggle | User.mfa_enabled (TOTP or a passkey) | on → ACC-05; off → ACC-06 (off needs step-up). When mfa_enrollment_required is true, a banner above: "Your staff role needs two-step verification. Turn it on to keep using admin features." (required from 5 Nov 2026) |
|
| Sessions | list | virtualized list | Session[]: user_agent → device name/icon, ip_address → approximate location*, last_seen_at, current | current session marked "This device" and not revocable here |
| Sign out | row-button | trailing button | DELETE /users/me/sessions/{sessionId} | per non-current row |
| Sign out of all other sessions | destructive-button | POST /users/me/sessions/revoke-all {keep_current: true} | confirm first; also stops push to those sessions' devices | |
| Devices & notifications | row → NTF-03 | row link | count of active devices |
| Action | Call | Result handling |
|---|---|---|
| Revoke one | DELETE /users/me/sessions/{sessionId} |
Optimistic remove; 404 → already gone, refresh. |
| Sign out everywhere else | POST /users/me/sessions/revoke-all {keep_current: true} |
Confirm first (COPY). keep_current keeps this device signed in (logout all_sessions would sign it out too). 200 {revoked} → toast "Signed out of {n} other sessions", refresh the list. Revoking a session deactivates the push devices it registered. |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
Notes: *IP → city lookup is client-side/optional; never show the raw IP to non-staff unless the user expands details.
ACC-05 — Turn on two-factor
Domain: D2 Account & Security · Route: /account/security/2fa/enable · Archetype: wizard · Phase: MVP
Who: Self
Purpose: Turn on two-step verification with a passkey (recommended) or an authenticator app (TOTP), and save recovery codes.
Web (PWA) container: Dialog/sheet with step indicator; each step a URL hash
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Step 0 — Method | radio-group | Passkey (recommended) · Authenticator app | passkey: registration-options → platform prompt → POST /users/me/mfa/passkeys; recovery codes come with the first method |
|
| Step 1 — Scan | qr + secret | POST /users/me/mfa/totp → otpauth_uri, secret | QR, "Copy setup key", "Open in authenticator" (otpauth:// link on mobile) | |
| Step 2 — Confirm | otp-field | body.code | 6 digits | |
| Step 3 — Recovery codes | secret-list | SecretReveal + download/print/share | confirm response: 10 recovery codes | Copy all · Save as file · Print · Share (mobile); "I've saved these" checkbox gates Done |
| Action | Call | Result handling |
|---|---|---|
| Start | POST /users/me/mfa/totp |
409 → already enabled; close. 403 recent_sign_in_required (a first method needs a password sign-in in the last 10 minutes) → "Sign in again to turn on two-step verification." → AUTH-01, then back here. Adding a second method needs step-up instead |
| Confirm | POST /users/me/mfa/totp/confirm |
200 → step 3. 401 → wrong code. |
States: Cancel before confirm leaves MFA off (no server cleanup needed)
ACC-06 — Turn off two-factor
Domain: D2 Account & Security · Route: /account/security/2fa/disable · Archetype: confirm · Phase: MVP
Who: Self
Purpose: Disable TOTP with a current code or a recovery code.
Web (PWA) container: <dialog role=alertdialog>; bottom sheet < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Code or recovery code | otp-field / text-field | body.code | body.recovery_code | ||
| Turn off | destructive-button | POST /users/me/mfa/totp/disable |
| Action | Call | Result handling |
|---|---|---|
| Turn off | POST /users/me/mfa/totp/disable |
204 → toggle off, toast. 401 → wrong code. 429 → countdown. |
ACC-07 — Privacy
Domain: D2 Account & Security · Route: /account/privacy · Archetype: settings · Phase: MVP
Who: Self
Purpose: Export personal data and delete the account.
Web (PWA) container: Grouped settings rows in main pane
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Download my data | button | GET /users/me/export | saves substratal-export-{date}.json via save dialog / share sheet / download |
|
| Delete account | destructive-row → ACC-08 | row button (destructive) |
| Action | Call | Result handling |
|---|---|---|
| Download | GET /users/me/export |
200 → save file. 429 → "You can export again in {n} minutes." |
ACC-08 — Delete account
Domain: D2 Account & Security · Route: /account/privacy/delete · Archetype: confirm · Phase: MVP
Who: Self
Purpose: Request erasure: deactivate now, erase after 7 days.
Web (PWA) container: <dialog role=alertdialog>; bottom sheet < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| What happens | text | list: signed out everywhere; apps lose access; erased on {date}; support can cancel within 7 days. Link: Account and Data Deletion | ||
| Reason | text-area | body.reason | optional | |
| Type DELETE | text-field | client only | must equal localized confirm word | |
| Delete account | destructive-button | POST /users/me/erasure-requests |
| Action | Call | Result handling |
|---|---|---|
| Delete account | POST /users/me/erasure-requests |
202 ErasureRequest → clear local data → AUTH-01 with "Your account is scheduled for deletion on {scheduled_for}." |
Notes: If the User has an individual Standard subscription, warn first and link to "Manage billing" (BIL-03) — erasure doesn't cancel the subscription by itself (see OPEN-QUESTIONS).
D3 · My Apps
APP-01 — Home — My Apps
Domain: D3 My Apps · Route: / · Archetype: grid · Phase: MVP
Who: Signed in
Purpose: See every app you can use, its access status, and launch it.
Web (PWA) container: Main pane, CSS grid (auto-fill minmax 160px)
Loads: GET /applications (catalog the caller can see; each has access_tier free|standard) · GET /users/me/entitlements?include_inactive=true · GET /users/me (plan, plan_sources) · GET /organizations?status=active (for pending invites) · GET /users/me/notifications/unread-count (bell badge)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Search | search | client filter on name/description | ||
| Grid / List | segmented | role=radiogroup segmented buttons | client preference | persisted locally |
| Invitation banner | banner | role=region banner | Organization.my_membership_status = pending | "{org} invited you…" → ORG-09 |
| Verify-email banner | banner | role=region banner | User.email_verified = false | → AUTH-04 |
| Your apps | tile-grid | CSS grid of tiles (role=list) | join Application × resolved entitlement per app | tile = icon, name, StatusBadge, helper text (COPY); order: recently launched, then A–Z; pin to top (local) |
| Included with Standard | tile-grid | CSS grid of tiles (role=list) | standard apps with status none while User.plan = free | badge "Standard"; tap → upsell sheet → BIL-01 ("Get every app for $6/month") |
| Available | tile-grid | CSS grid of tiles (role=list) | other public apps with status none | "Get access" → app support/launch page |
| Inbox bell | toolbar button + count | toolbar (role=toolbar) | NotificationUnreadCount.unread_count | → NTF-01 |
| Past apps | row → APP-05 | row link | count of revoked/expired |
| Action | Call | Result handling |
|---|---|---|
| Open tile (active) | → APP-03 |
Launch |
| Open tile (other status) | → APP-02 |
Explain status |
| Context menu / long-press | Open · App settings (SET-02) · App profile (APP-04) · Pin · Copy app ID |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES; Empty: "No apps yet" (COPY); Offline: show cached grid read-only, launch disabled
Notes: Resolved status per app: if any path active → Active; else precedence scheduled > disabled > expired > revoked > none (matches the API's resolved_entitlement_status). Use GET /users/me/apps/{appId}/effective-permissions for the authoritative answer when the user opens APP-02. Tile helper text by source of the active path: free → "Free"; subscription → "Standard" (or "Standard · via {org}"); developer grants as before. The Hub itself (app_hub) is hidden from the grid.
APP-02 — App info
Domain: D3 My Apps · Route: /apps/:appId · Archetype: popover · Phase: MVP
Who: Signed in
Purpose: Explain an app's access status and how the user has access.
Web (PWA) container: Popover ≥ 1024 px; side panel 768–1023; bottom sheet < 768
Loads: GET /applications/{appId} · GET /users/me/apps/{appId}/effective-permissions
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Header | icon + name + StatusBadge | img + heading + badge | Application, EffectivePermissions.entitlement_status | |
| Description | text | Application.description | ||
| Access paths | list | virtualized list | EffectivePermissions.access_paths[]: source, status, organization_id, member_decision | "Free", "Standard · your subscription", "Standard · via Northwind", "Personal · Granted by admin", "Via Northwind (seat)"; member_decision excluded explained |
| Tier | badge | StatusBadge pill | Application.access_tier | "Free", "Standard" (Substratal's own apps) or "Invite only" (restricted: the developer grants access, and may charge for it themselves) |
| Your roles | chips | toggle-button chip row | EffectivePermissions.roles | Phase 2 |
| Primary action | button | Active → Open; none + standard tier + plan free → Upgrade to Standard (BIL-01); none+public → Get access; disabled/expired/revoked → Contact support (support_url); none + restricted tier → "Ask {developer} for access" (support_url), never Upgrade |
||
| Notification settings | row → SET-02 | row link | resolved notifications.push for this app | "Push notifications: On/Off" |
| App settings / App profile | rows | list rows | → SET-02, APP-04 | only when active |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
APP-03 — Launch app
Domain: D3 My Apps · Route: /apps/:appId/launch · Archetype: handoff · Phase: MVP
Who: Active entitlement
Purpose: Mint an app token (or authorization code) and open the app.
Web (PWA) container: window.open (new tab) / same-tab redirect for PKCE
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Progress | inline spinner on tile | spinner on tile (aria-busy) | ≤ 1 s target | |
| Organization picker | menu | menu button (role=menu) | body.organization_id | only when the user has access via >1 org and the app needs org context |
| Action | Call | Result handling |
|---|---|---|
| Embedded launch | POST /auth/app-tokens {application_id, organization_id?} |
200 AppToken (5-min JWT) → open launch_url with token per app contract; never cache the token. 403 → refresh status, show APP-02; embedded_login_not_allowed (a third-party, self-registered app) → hosted launch below, or open launch_url without a token while hosted_launch is off. 409 → choose org. |
| Hosted launch (Phase 3) | POST /auth/oauth/authorization-codes (PKCE S256) |
201 → open redirect_uri?code=…&state=… in system browser / auth session |
Notes: Record launch time locally for "recently launched" ordering.
APP-04 — App profile
Domain: D3 My Apps · Route: /apps/:appId/profile · Archetype: form · Phase: Phase 2
Who: Self, active entitlement
Purpose: Per-app display handle and custom profile fields.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
Loads: GET /users/me/apps/{appId}/profile
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Display handle | text-field | AppProfile.display_handle | optional; shows effective_display_name as placeholder | |
| Custom fields | key/value editor | repeating key/value inputs + Add | AppProfile.custom | only keys the app documents; null removes a key |
| Action | Call | Result handling |
|---|---|---|
| Save | PATCH /users/me/apps/{appId}/profile (If-Match) |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
APP-05 — Past apps
Domain: D3 My Apps · Route: /apps/past · Archetype: list · Phase: MVP
Who: Signed in
Purpose: Apps whose access was revoked or expired.
Web (PWA) container: List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px
Loads: GET /users/me/entitlements?include_inactive=true&status=revoked,expired
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Rows | list | virtualized list | Application name/icon, status, ended/revoked date, source | tap → APP-02 |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
D4 · Settings
SET-01 — Settings — Global
Domain: D4 Settings · Route: /settings · Archetype: settings · Phase: MVP
Who: Self
Purpose: Preferences that apply to every app.
Web (PWA) container: Grouped settings rows in main pane
Loads: GET /users/me/settings · GET /users/me/apps/app_hub/settings (theme choices)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Language | select | Settings.locale | BCP 47; default = OS language; changing re-localizes the UI live | |
| Time zone | searchable select | combobox with filter | Settings.timezone | IANA; default = OS zone; "Use device time zone" option |
| Appearance | segmented | role=radiogroup segmented buttons | Settings.theme light/dark/system | Light · Dark · Match system (default). Applies instantly; Match system follows OS changes live. See THEMES.md |
| Light theme | swatch picker | role=radiogroup grid of swatch radios (arrow keys move, Space selects) | app_hub setting light_theme |
5 themes: Teal Ledger, Indigo Root, Moss Paper (default), Coral Clay, Spore Pink. Each swatch previews background, sidebar, accent and text; selected swatch shows a check and accent ring; accessible name "{name} light theme, selected" |
| Dark theme | swatch picker | role=radiogroup grid of swatch radios (arrow keys move, Space selects) | app_hub setting dark_theme |
5 themes: Night Soil, Deep Teal, Graphite Spore, Forest Floor (default), Ember Clay. Same behaviour as Light theme |
| Push notifications | toggle | Settings.notifications.push (missing = on) | global master switch for push from every app; inbox still fills (NTF-01). Shows OS permission state beneath: "Allowed in system settings" / "Blocked — Open system settings" | |
| Email notifications | toggle | Settings.notifications.email | ||
| SMS notifications | toggle | Settings.notifications.sms | disabled until Profile.contact_phone set | |
| Share usage analytics | toggle | client preference | default per platform policy; see CLIENT-ARCHITECTURE §10 | |
| Scope list | list | virtualized list | Global + each app with active access | → SET-02 (desktop: middle column) |
| About & legal | link list | link list | app version, API version (Substratal-Version and the openapi.yaml revision the build was generated from); Terms, Privacy, EULA, Cookie Notice (web only), Licenses |
Substratal Apps is operated by Composite Code LLC; links open in the system browser |
| Action | Call | Result handling |
|---|---|---|
| Change any row | PATCH /users/me/settings (If-Match) |
Optimistic; revert + toast on error. |
| Choose a light or dark theme | PATCH /users/me/apps/app_hub/settings (If-Match) with light_theme / dark_theme |
Apply instantly, cache locally, then sync; 409 → refetch and re-apply; 422 → revert + toast "Couldn't save your theme. Try again." |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
SET-02 — Settings — Per app
Domain: D4 Settings · Route: /settings/apps/:appId · Archetype: settings · Phase: Phase 2
Who: Self, active entitlement
Purpose: Override global settings and set app-specific preferences from the app's settings_schema.
Web (PWA) container: Grouped settings rows in main pane
Loads: GET /applications/{appId} (settings_schema) · GET /users/me/apps/{appId}/settings
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Schema form | generated rows | SchemaForm | settings_schema properties × AppSettingsResolved.resolved | string+enum → select; string → text; string date-time → date-time picker; boolean → toggle; integer/number with min/max → stepper/number; object/array → read-only JSON preview |
| Source caption | caption per row | AppSettingsResolved.sources[key] | app_override → "Changed for this app · Reset"; global → "Using your global setting"; app_default → "App default" | |
| Reset | link per overridden row | row link | PATCH overrides {key:null} | |
| Push notifications for this app | toggle | resolved notifications.push; override via overrides.notifications.push | source caption as other rows; Reset clears the override | |
| Stale overrides | banner | role=region banner | AppSettingsResolved.stale_overrides | "Some saved settings no longer apply" → Clear |
| Action | Call | Result handling |
|---|---|---|
| Change row | PATCH /users/me/apps/{appId}/settings {overrides:{key:value}} (If-Match) |
422 → field error from details (enum_mismatch, out_of_range, undeclared_key). |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
D5 · Organizations
ORG-01 — Organizations
Domain: D5 Organizations · Route: /orgs · Archetype: list · Phase: MVP
Who: Signed in (all orgs with organizations.manage)
Purpose: Organizations you belong to, plus pending invitations.
Web (PWA) container: List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px
Loads: GET /organizations?include=total
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Count | caption | caption |
page.total / page.total_capped |
"{n} organizations"; capped → "10,000+ organizations"; follows the filters |
| Pending invitations | section | my_membership_status = pending | Accept / Decline inline → ORG-09 | |
| Rows | list | virtualized list | Organization: name, member_count, my_role, status | suspended orgs show badge |
| Search | search | q | server-side when > 50 | |
| New organization | primary-button | → ORG-02 |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ORG-02 — New organization
Domain: D5 Organizations · Route: /orgs/new · Archetype: form · Phase: MVP
Who: Any active user
Purpose: Create an organization; creator becomes org admin.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Name | text-field | body.name | required; ≤ 100 |
| Action | Call | Result handling |
|---|---|---|
| Create | POST /organizations (Idempotency-Key) |
201 → ORG-03. 429 → rate limited. |
ORG-03 — Organization — Members
Domain: D5 Organizations · Route: /orgs/:orgId/members · Archetype: detail · Phase: MVP
Who: Member (read), org_admin / organizations.manage (write)
Purpose: See and manage members and pending invitations.
Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px
Loads: GET /organizations/{id} · GET /organizations/{id}/members?include=total
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Count | caption | caption |
page.total / page.total_capped |
"{n} members"; capped → "10,000+ members"; follows the filters |
| Header | avatar + name + id-chip + status | + copy button |
Organization | my_role shown as caption |
| Tabs | tabs | role=tablist | Members · Apps & seats · Subscription · Activity · Settings | Subscription tab = BIL-02 (org_admin / billing.manage only) |
| Filter | chips | toggle-button chip row | role, membership_status | |
| Rows | list | virtualized list | OrganizationMember: display_name/email, role, membership_status, joined_at/invited_at | pending rows show Invited badge + invited date |
| Invite | primary-button | → ORG-04 | org_admin only |
| Action | Call | Result handling |
|---|---|---|
| Row menu | → ORG-05 |
Change role · Remove · Withdraw invitation |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ORG-04 — Invite member
Domain: D5 Organizations · Route: /orgs/:orgId/members/invite · Archetype: form · Phase: MVP
Who: org_admin; organizations.manage may add by user_id
Purpose: Invite people by email (or add an existing user, staff only).
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Emails | token-field | token input (chips in input) | body.email (one request per address) | paste a list separated by commas/newlines |
| Role | radio-group | body.role org_admin | member | default member | |
| Add existing user | user-picker | combobox multi-select | body.user_id | organizations.manage only |
| Action | Call | Result handling |
|---|---|---|
| Send invitations | POST /organizations/{id}/members × n |
Per-address results summary; 409 → "already a member" per address. Responses look identical whether or not the address has an account (by design). |
Notes: Existing Users also receive an account.organization_invitation platform alert (NTF-01, and a push where the Hub has a device).
ORG-05 — Member actions
Domain: D5 Organizations · Route: /orgs/:orgId/members/:userId · Archetype: confirm · Phase: MVP
Who: org_admin / organizations.manage
Purpose: Change a member's role or remove them.
Web (PWA) container: <dialog role=alertdialog>; bottom sheet < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Role | radio-group | body.role | ||
| Remove from organization | destructive-button | DELETE …/members/{userId} | COPY confirm |
| Action | Call | Result handling |
|---|---|---|
| Change role | PATCH /organizations/{id}/members/{userId} |
409 → last admin can't be demoted (explain). |
| Remove | DELETE /organizations/{id}/members/{userId} |
409 → last admin can't leave/remove. |
ORG-06 — Organization — Apps & seats
Domain: D5 Organizations · Route: /orgs/:orgId/apps · Archetype: tab · Phase: Phase 2
Who: Member (read), org_admin (write)
Purpose: Org-wide app grants and who they include.
Web (PWA) container: tabpanel (route segment)
Loads: GET /organizations/{id}/entitlements
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Rows | list | virtualized list | Entitlement (org): app, status, source (org_seat | subscription), member_scope, included_member_count, starts_at/ends_at | AccessSwitch for status (org_admin with rights); subscription rows read "Included with the organization's Standard subscription" and their scope is edited in BIL-02 |
| Grant app | button | → ORG-07 |
| Action | Call | Result handling |
|---|---|---|
| Toggle | PATCH /entitlements/{id} {status} |
Off requires confirm (COPY). On platform-managed rows only active ⇄ disabled is allowed; anything else 409 entitlement_platform_managed. |
| Edit scope | → ORG-07 (org_seat) / BIL-02 (subscription) |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ORG-07 — Grant app to organization / member scope
Domain: D5 Organizations · Route: /orgs/:orgId/apps/grant · Archetype: form · Phase: Phase 2
Who: entitlements.manage or app owner; scope edits by org_admin
Purpose: Create an org-wide grant or change who it includes.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| App | select | body.application_id | create only | |
| Who gets access | radio-group | member_scope all_members | allowlist | denylist | COPY labels | |
| Members | member-picker | combobox multi-select | member_overrides | visible for allowlist/denylist |
| Starts / Ends | date-fields | starts_at, ends_at | optional | |
| Order ID | text-field | order_id | optional; staff/app owner |
| Action | Call | Result handling |
|---|---|---|
| Grant | POST /organizations/{id}/entitlements (Idempotency-Key) |
409 entitlement_already_exists → already granted (view it). 422 → field errors. |
| Save scope | PATCH /entitlements/{id} {member_scope, member_overrides} |
ORG-08 — Organization — Settings
Domain: D5 Organizations · Route: /orgs/:orgId/settings · Archetype: settings · Phase: MVP
Who: org_admin (rename, SCIM), organizations.manage (suspend, SCIM), any member (leave)
Purpose: Rename, leave, set up SCIM provisioning, or (staff) suspend the organization.
Web (PWA) container: Grouped settings rows in main pane
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Name | text-field | Organization.name | ||
| Leave organization | destructive-row | row button (destructive) | DELETE …/members/me | |
| SCIM provisioning | section | settings group ( |
GET …/scim-token → created_at, created_by, last_used_at, base_url |
org_admin or organizations.manage; behind scim flag; 404 scim_token_not_found = "Not set up" |
| Set up / Rotate token | button | POST …/scim-token → token + base_url | rotate confirms first ("Your identity provider stops syncing until you paste the new token"); secret shown once (KEY-03 pattern) | |
| Turn off SCIM | destructive-row | row button (destructive) | DELETE …/scim-token | confirm; members already provisioned stay |
| Suspend / Reactivate | destructive-row | row button (destructive) | PATCH {status, reason} | staff only; reason required |
| Action | Call | Result handling |
|---|---|---|
| Rename | PATCH /organizations/{id} {name} |
|
| Leave | DELETE /organizations/{id}/members/me |
409 last admin |
| Load SCIM status | GET /organizations/{id}/scim-token |
404 scim_token_not_found → "Not set up" with a Set up button |
| Create / rotate SCIM token | POST /organizations/{id}/scim-token |
201 → one-time secret sheet showing base_url and token with Copy; the previous token stops working at once |
| Turn off SCIM | DELETE /organizations/{id}/scim-token |
204 → "Not set up" |
Notes: SCIM provisioning invites people (they join when they accept, via ORG-09) and deprovisioning removes the membership, never the account. Provisioned members show in ORG-03 like any invitation. SCIM itself (/scim/v2) is called by the identity provider, never by the Hub.
ORG-09 — Invitation
Domain: D5 Organizations · Route: /orgs/:orgId/invitation · Archetype: confirm · Phase: MVP
Who: Invited user
Purpose: Accept or decline an organization invitation.
Web (PWA) container: <dialog role=alertdialog>; bottom sheet < 768 px
Entry points: Invitation banner on APP-01; ORG-01 pending section; account.organization_invitation notification (NTF-01 / push action "Accept")
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Org name | text | Organization.name | The API doesn't record who sent an invitation, so don't name an inviter | |
| Accept | primary-button | |||
| Decline | button |
| Action | Call | Result handling |
|---|---|---|
| Accept | POST /organizations/{id}/members/me/accept |
200 → ORG-03; apps granted via org (and the org's Standard subscription, if it covers the member) appear on APP-01. Mark the related notification read. |
| Decline | DELETE /organizations/{id}/members/me |
D6 · Users
USR-01 — Users
Domain: D6 Users · Route: /admin/users · Archetype: table · Phase: MVP
Who: users.list (write actions need users.manage)
Purpose: Find and manage user accounts.
Web (PWA) container: Virtualized grid table ≥ 1024 px; card rows below
Loads: GET /users?limit=50&cursor&status&q&application_id&organization_id&role_id&created_after&created_before&include=total
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Search | search | q (name, email, ID prefix usr_) | debounced 300 ms; exact ID jumps to USR-03 | |
| Status filter | chips | toggle-button chip row | status active | invited | suspended | deleted | deleted visible to users.manage only |
| More filters | menu | menu button (role=menu) | application_id, organization_id, role_id, created range | role_id: explicit assignments (ROL-02 Holders links here) |
| Count | caption | caption |
page.total / page.total_capped |
"1,204 users"; capped → "10,000+ users"; follows the filters |
| Columns | table | role=grid virtualized table | display name + email, status, id, last_login_at, created_at | sortable client-side within loaded page; server order = created_at desc |
| Multi-select | selection | bulk: Suspend (POST /users/bulk-suspend, up to 25 per call, step-up, per-row results), Resend invitation (one request per row), Export CSV (client-side of loaded rows) |
||
| Invite user | primary-button | → USR-02 | users.manage |
| Action | Call | Result handling |
|---|---|---|
| Open row | → USR-03 |
|
| Row menu | Suspend · Reactivate · Resend invitation · Copy ID · Copy email |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
USR-02 — Invite user
Domain: D6 Users · Route: /admin/users/new · Archetype: form · Phase: MVP
Who: users.manage
Purpose: Create a user and send an invitation (or create active).
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| email-field | body.email | required; pasting several addresses (comma or newline) switches to Invite several: POST /users/bulk-invite {emails[], application_id?} (up to 25, Idempotency-Key), then a per-address result list |
||
| Display name | text-field | body.display_name | optional; hidden for Invite several | |
| Send invitation email | toggle | body.send_invitation | default on | |
| Create as active | toggle | body.status active|invited | default off (invited) |
| Action | Call | Result handling |
|---|---|---|
| Invite | POST /users (Idempotency-Key) |
201 → USR-03. 409 → "A user with that email exists" + link. |
USR-03 — User — Overview
Domain: D6 Users · Route: /admin/users/:userId · Archetype: detail · Phase: MVP
Who: users.list (read), users.manage (write)
Purpose: One user's account state and administrative actions.
Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px
Loads: GET /users/{id} · GET /users/{id}/profile · GET /users/{id}/subscription (billing.manage only) · GET /users/{id}/erasure-requests/current (users.manage, when the User is deleted; 404 erasure_not_scheduled = none pending)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Header | avatar, display name, email, id-chip, StatusBadge | + copy button |
User + Profile | |
| Tabs | tabs | role=tablist | Overview · Access · Roles · Sessions · Notifications · Activity | Activity = AUD-01 filtered target_user_id; Notifications = NTF-05 |
| Facts | key-value list | email_verified, pending_email, mfa_enabled, plan, plan_sources, created_at, last_login_at, signup_application_id, test_mode, expires_at (test-mode Users only: "Expires in 3 h" / "Expired"), mfa_enrollment_required (staff without two-step: "Staff access starts once they turn on two-step verification"), erasure scheduled_for ("Erased on {date}") |
plan_sources link to the org or to BIL-01 subscription view (billing.manage) | |
| Actions | toolbar/menu | menu button (role=menu) | Suspend (USR-05) · Reactivate · Resend invitation · Reset two-factor · Export data · Delete · Restore · Cancel scheduled erasure |
| Action | Call | Result handling |
|---|---|---|
| Reactivate / Restore | PATCH /users/{id} {status:active} (If-Match) |
|
| Resend invitation | POST /users/{id}/invitation |
202 toast; 409 → not in invited state |
| Reset two-factor | DELETE /users/{id}/mfa/totp |
confirm: "This removes their authenticator app and every passkey." 409 mfa_not_enabled → already off |
| Export | GET /users/{id}/export |
save file |
| Delete | DELETE /users/{id} |
confirm. Step-up: 403 reauthentication_required → GLB-03 Confirm it's you, then retry. |
| Cancel erasure | DELETE /users/{id}/erasure-requests/current |
shown only while GET …/erasure-requests/current returns a scheduled request (the 7-day window) |
| Extend (test-mode) | PATCH /users/{id} {expires_at} (If-Match) |
users.manage; at least 15 min from now, at most 30 days after created_at (422 expires_at_out_of_range). Extending an expired User brings them back. |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
USR-04 — User — Sessions
Domain: D6 Users · Route: /admin/users/:userId/sessions · Archetype: tab · Phase: MVP
Who: users.manage
Purpose: See and revoke a user's sessions.
Web (PWA) container: tabpanel (route segment)
Loads: GET /users/{id}/sessions
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Rows | list | virtualized list | Session: user_agent, ip_address, amr, created_at, last_seen_at, expires_at | staff see full IP |
| Action | Call | Result handling |
|---|---|---|
| Revoke | DELETE /users/{id}/sessions/{sessionId} |
|
| Sign out everywhere | POST /users/{id}/sessions/revoke-all |
Confirm (COPY "Sign out everywhere (staff)"). 200 {revoked} → toast; the list empties. Their account stays active. |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
USR-05 — Suspend user
Domain: D6 Users · Route: /admin/users/:userId/suspend · Archetype: confirm · Phase: MVP
Who: users.manage
Purpose: Suspend an account (signs them out everywhere).
Web (PWA) container: <dialog role=alertdialog>; bottom sheet < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Reason | text-area | body.reason | optional, written to audit |
| Action | Call | Result handling |
|---|---|---|
| Suspend | POST /users/{id}/suspend |
200 → badge Suspended. 409 → already suspended. Step-up: 403 reauthentication_required → GLB-03 Confirm it's you, then retry. |
Notes: Suspension revokes sessions and deactivates every push device the user holds; say so in the confirm body.
D7 · Access
ACX-01 — User — Access
Domain: D7 Access · Route: /admin/users/:userId/access · Archetype: tab · Phase: MVP
Who: users.list (read), entitlements.manage or app owner (write)
Purpose: Turn apps on or off for one person; see every path that grants access.
Web (PWA) container: tabpanel (route segment)
Loads: GET /users/{id}/entitlements?include_inactive=true · GET /applications
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Rows (one per app) | list | virtualized list | resolved status per app + paths (personal Entitlement, org grants) | StatusBadge + AccessSwitch on the personal path |
| Paths disclosure | expandable | Entitlement.granted_via, source, subscription_id, organization_id, member_decision, starts_at/ends_at, disabled_reason | platform-managed paths (free, subscription) show a "Managed by Substratal" caption; developer grants and platform rows can coexist |
|
| Org-only access | caption + link | switch replaced by "Via {org}" → ORG-06 | ||
| Grant access | primary-button | → ACX-02 | ||
| Why? | button | → ACX-04 |
| Action | Call | Result handling |
|---|---|---|
| Switch off | → ACX-03 confirm → PATCH /entitlements/{id} {status:disabled, disabled_reason} |
Optimistic with Undo (PATCH status:active) for 10 s |
| Switch on | PATCH /entitlements/{id} {status:active} |
No confirm |
| Remove grant made in error | DELETE /entitlements/{id} |
Only developer grants with no order_id and < 24 h old; never on free/subscription rows (409 entitlement_platform_managed); 409 otherwise |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
Notes: The switch on a platform-managed row only disables / re-enables it (the platform never re-enables a row an admin disabled). Term, source and scope edits are hidden for those rows.
ACX-02 — Grant access
Domain: D7 Access · Route: /admin/users/:userId/access/grant · Archetype: form · Phase: MVP
Who: entitlements.manage or app owner (own app)
Purpose: Give a person access to an app.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| App | select | body.application_id | app owners see only their apps | |
| Type | radio-group | body.source purchase | trial | admin_grant | free and subscription are never offered — the platform grants them |
|
| Order ID | text-field | body.order_id | required feel for purchase | |
| Starts | date-time | body.starts_at | default now | |
| Ends | date-time | body.ends_at | optional; required for trial |
| Action | Call | Result handling |
|---|---|---|
| Grant | POST /users/{id}/entitlements (Idempotency-Key, required) |
201 → row Active. 409 entitlement_already_exists → "Already has access — view it". A platform-managed row doesn't block a grant (they coexist). |
ACX-03 — Turn off / edit access
Domain: D7 Access · Route: /admin/entitlements/:entId · Archetype: confirm · Phase: MVP
Who: entitlements.manage or app owner
Purpose: Confirm turning off access, or edit term/source.
Web (PWA) container: <dialog role=alertdialog>; bottom sheet < 768 px
Loads: GET /entitlements/{id}
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Title | text | "Turn off {app} for {name}?" | ||
| Reason | text-field | body.disabled_reason | optional; audit | |
| Edit term (advanced) | disclosure | ends_at, source trial→purchase, order_id | hidden for platform-managed rows |
| Action | Call | Result handling |
|---|---|---|
| Turn off | PATCH /entitlements/{id} {status:disabled, disabled_reason} (If-Match) |
409 version_conflict → reload and re-apply |
| Save changes | PATCH /entitlements/{id} |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ACX-04 — Access check (Why?)
Domain: D7 Access · Route: /admin/users/:userId/apps/:appId/why · Archetype: popover · Phase: MVP
Who: users.list or app owner
Purpose: Explain exactly why a person can or can't use an app.
Web (PWA) container: Popover ≥ 1024 px; side panel 768–1023; bottom sheet < 768
Loads: GET /users/{id}/apps/{appId}/effective-permissions
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Verdict | banner | role=region banner | allowed | "Dana can use Timetrack" / "can't" + first failing reason (user_status, entitlement_status) |
| Checks | checklist |
|
user_status, entitlement_status, access_paths[], roles, effective_permissions | each with pass/fail icon |
| Computed at | caption | computed_at |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ACX-05 — Access (all)
Domain: D7 Access · Route: /admin/access · Archetype: table · Phase: MVP
Who: entitlements.manage or app owner (confined to own apps)
Purpose: Every grant across users: audit expirations, trials, revocations.
Web (PWA) container: Virtualized grid table ≥ 1024 px; card rows below
Loads: GET /entitlements?application_id&status&source&user_id&organization_id&order_id&ends_before&include_inactive&include=total
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Count | caption | caption |
page.total / page.total_capped |
"{n} access grants"; capped → "10,000+ access grants"; follows the filters |
| Filters | chips/menus | toggle-button chip row | app, status, source, ends before (Expiring in 7/30 days presets) | |
| Columns | table | role=grid virtualized table | user, app, status, source (incl. free / subscription), subscription_id, starts_at, ends_at, order_id, granted_via | source filter defaults to developer grants; "Show platform-managed" chip adds free/subscription rows |
| Multi-select | selection | bulk Turn off (confirm; POST /entitlements/bulk-update, up to 25 per call, per-row results) |
| Action | Call | Result handling |
|---|---|---|
| Open row | → ACX-01 for that user |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
D8 · Roles & Permissions
ROL-01 — Roles
Domain: D8 Roles & Permissions · Route: /admin/roles · Archetype: list · Phase: MVP
Who: users.list (read), roles.manage (write); an Application's owner reads and edits that Application's roles without a platform permission
Purpose: Platform and app roles.
Web (PWA) container: List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px
Loads: GET /roles?scope&include=total · GET /permissions (includes notifications.send)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Count | caption | caption |
page.total / page.total_capped |
"{n} roles"; capped → "10,000+ roles"; follows the filters |
| Scope | segmented | role=radiogroup segmented buttons | scope platform | {application_id} | app picker when App; an owner without platform permissions sees only App, with their own apps in the picker (another app's roles come back as an empty page) |
| Rows | list | virtualized list | Role: name, scope, seed, assignment_count, description | seed → lock icon |
| New role | primary-button | → ROL-03 | roles.manage |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ROL-02 — Role detail
Domain: D8 Roles & Permissions · Route: /admin/roles/:roleId · Archetype: detail · Phase: MVP
Who: users.list (read), roles.manage (write); an Application's owner, for that Application's roles
Purpose: View or edit a role's permissions.
Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px
Loads: GET /roles/{id} · GET /permissions?scope
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Header | name, id-chip, scope, assignment_count | + copy button |
||
| Description | text-field | Role.description | read-only when seed | |
| Permissions | checkbox-list grouped by prefix | grouped checkbox list | Role.permissions ⊂ Permission[].key | read-only when seed; show Permission.description |
| Holders | link | / | → USR-01 filtered by GET /users?role_id={id} |
explicit assignments only; for an app's default_app_role, add "and everyone with access to {app}" → ACX-05 filtered |
| Delete role | destructive-button | DELETE /roles/{id} | only non-seed with assignment_count 0 |
| Action | Call | Result handling |
|---|---|---|
| Save | PATCH /roles/{id} {description, permissions} (If-Match) |
422 unknown_permission → "{key} isn't one of this application's permissions."; 404 role_not_found for another app's role |
| Delete | DELETE /roles/{id} |
409 → still assigned |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
ROL-03 — New role
Domain: D8 Roles & Permissions · Route: /admin/roles/new · Archetype: form · Phase: MVP
Who: roles.manage
Purpose: Define a custom role.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Name | text-field | body.name | ^[a-z][a-z0-9_]{1,40}$; live validation | |
| Scope | select | body.scope | platform or an application | |
| Description | text-area | body.description | ||
| Permissions | checkbox-list | grouped checkbox list | body.permissions | ≥ 1 |
| Action | Call | Result handling |
|---|---|---|
| Create | POST /roles |
409 → name taken in scope |
ROL-04 — User — Roles
Domain: D8 Roles & Permissions · Route: /admin/users/:userId/roles · Archetype: tab · Phase: MVP
Who: users.list (read), roles.manage (write)
Purpose: Assign and remove roles for a user.
Web (PWA) container: tabpanel (route segment)
Loads: GET /users/{id}/roles
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Rows | list | virtualized list | UserRoleAssignment: role, application_id, assigned_at, assigned_by, implicit | implicit → "Granted with app access", not removable |
| Assign role | button → role picker | combobox multi-select |
| Action | Call | Result handling |
|---|---|---|
| Assign | POST /users/{id}/roles/{roleId} |
idempotent; 200 already held. Platform role: step-up (GLB-03 Confirm it's you). If the response has mfa_enrollment_required: true, say "{name} needs two-step verification before this role takes effect." |
| Remove | DELETE /users/{id}/roles/{roleId} |
409 → implicit role. Platform role: step-up |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
D9 · Applications
APL-01 — Applications
Domain: D9 Applications · Route: /dev/apps · Archetype: list · Phase: MVP
Who: Any (catalog), owner/applications.manage (manage)
Purpose: Applications you own or administer, and (staff) the review queue.
Web (PWA) container: List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px
Loads: GET /applications?q&owned=true&include=total (staff: all, with review_status, access_tier, include_inactive, sort) · GET /push-credentials?status=failed&include=total (health badge)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Search | search | q: case-insensitive prefix of name or slug |
combines with filters; no minimum length | |
| Count | caption | caption |
page.total / page.total_capped |
"12 applications"; capped → "10,000+ applications"; follows the filters |
| Status filter | chips | toggle-button chip row | review_status approved | pending_review | rejected | suspended | retired | staff only; Review queue = pending_review, oldest in review first (the API's default for that filter); Retired sends review_status=retired (retired apps are hidden otherwise) |
| Sort | menu | menu button (role=menu) | sort=-created_at (newest, default) | created_at (oldest) |
not shown in the review queue, whose order is review_requested_at |
| Rows | list / table | virtualized list | ApplicationSummary: icon, name, slug, visibility, access_tier, review_status, owner (owner_user_id → name, or owner_organization_id → org name), holder_count, review_requested_at |
holders = active Entitlements (a User grant and an Organization grant count once each); pending_review rows show "In review {n} days" from review_requested_at; owner names resolve from the caller's cache, falling back to the id chip |
| Push health | badge | badge pill | failed push credentials across the caller's apps (GET /push-credentials?status=failed) |
"{n} push credentials failing" → APL-07 of the first, or OPS-05 for staff; hidden at 0 |
| Register app | primary-button | → APL-02 | applications.manage, or anyone with a verified email (self-service, flag app_registration_self_service); unverified → disabled with "Verify your email to register apps" |
States: Loading: skeleton after 300 ms; Empty: "You don't own any applications yet." with Register app; Error: inline with Retry; codes per COPY-AND-STATES
APL-02 — Register application
Domain: D9 Applications · Route: /dev/apps/new · Archetype: wizard · Phase: MVP
Who: applications.manage, or anyone with a verified email (self-service)
Purpose: Register a new application.
Web (PWA) container: Dialog/sheet with step indicator; each step a URL hash
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Name | text-field | name | ||
| Slug | text-field | slug | ^[a-z][a-z0-9-]{1,63}$; 'platform' reserved; immutable — warn | |
| Launch URL | url-field | launch_url | https | |
| Redirect URIs | url-list | repeating rows + Add | redirect_uris | |
| Visibility | radio-group | visibility public | invite_only | internal | applications.manage only; a self-service app starts public |
|
| Access tier | radio-group | access_tier free | restricted (default restricted); staff creating a first-party app also see standard | owner chooses Free (everyone) or Restricted (only people they grant); standard is for first-party apps only (422 access_tier_reserved) |
|
| First-party | toggle | first_party | applications.manage only; marks Substratal's own apps (defaults the tier to standard) | |
| Owner | select | owner_user_id | owner_organization_id | self-service: yourself, or an Organization you're an org_admin of |
|
| Icon | image-picker | + paste + drop | icon_url (hosted) | square PNG, JPEG or WebP, ≤ 1 MB, ≤ 2048 × 2048; uploaded after the Application is created (POST /applications/{id}/icon/uploads → POST to url → …/complete), CLIENT-ARCHITECTURE §4.3 |
| Support URL | url-field | support_url | ||
| Email from name | text-field | email_from_name |
| Action | Call | Result handling |
|---|---|---|
| Register | POST /applications (Idempotency-Key) |
409 slug taken; 422 field errors; 403 email_not_verified / moderation_field_forbidden; 429 → 10 a day. Staff registration grants the platform-managed Entitlements its access_tier calls for; a self-service app starts pending_review and is granted them only once approved (APL-06). |
APL-03 — Application — Overview
Domain: D9 Applications · Route: /dev/apps/:appId · Archetype: detail · Phase: MVP
Who: Owner (configure), applications.manage (anything, including retire and delete)
Purpose: Configure an application, and (staff) review, retire or delete it.
Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px
Loads: GET /applications/{id}
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Header | icon, name, id-chip, review StatusBadge, "Third-party" chip when self_registered, "Test" chip when test_mode |
+ copy button |
subtitle: owner (user or organization) · "{holder_count} people have access" · "In review for {n} days" while pending_review |
|
| Tabs | tabs | role=tablist | Overview · Settings schema · Permissions & roles · Push · Keys · Webhooks · Access · Usage · Activity | Push = APL-07; Keys/Webhooks/Access = KEY-01/WHK-01/ACX-05 filtered to app; Usage = GET /usage?application_id={id}&group_by=operation (owner or operations.view): requests, error rate and latency per day, by operation |
| Icon | image-picker | + paste + drop | POST /applications/{id}/icon/uploads → POST the file to url → POST /applications/{id}/icon/uploads/{uploadId}/complete (200 Application); Remove icon → DELETE /applications/{id}/icon |
owner or applications.manage; square, ≤ 1 MB; 422 invalid_image; audited as application.icon_changed |
| Fields | settings rows | settings rows | name, description, launch_url, redirect_uris, support_url, email_from_name (owner); visibility, first_party (applications.manage); access_tier (owner: free | restricted while approved or pending_review, 10 changes a day, 409 application_not_available otherwise; staff on first-party apps) | slug read-only with lock; every field read-only when retired |
| Platform alerts | toggle | receives_platform_notifications | owner-writable; explain that security/account alerts will push under this app's name and icon. For a self_registered app only applications.manage can turn it on (owner sees it disabled with a reason) |
|
| Review notes | banner | role=region banner | review_status rejected/suspended/retired + review_notes | retired: "Retired on {date}. {review_notes}" and no edit, add-key, add-webhook or add-credential actions |
| Retire application… | destructive-row | row button (destructive) | PATCH {review_status: retired, review_notes} | applications.manage; only from approved or suspended; review_notes required; confirm lists what is cut off (below). Can't be undone |
| Delete test application… | destructive-row | row button (destructive) | DELETE /applications/{id} | applications.manage; only when test_mode; confirm by typing the slug |
| Action | Call | Result handling |
|---|---|---|
| Save field | PATCH /applications/{id} (If-Match) |
422 → field errors; 409 application_retired → reload as retired |
| Retire | PATCH /applications/{id} {review_status: "retired", review_notes} (If-Match) |
200 → banner + toast "Retired. {n} access grants, {k} keys, {w} webhooks and {p} push credentials were cut off." from the application.retired audit event's after.cut_off (AUD-02 link). 403 live_mode_required → "Retiring a live application needs a live-mode sign-in." 409 invalid_review_transition → "Only approved or suspended applications can be retired." |
| Delete | DELETE /applications/{id} |
204 → APL-01 with toast. 409 application_not_deletable → "Only test-mode applications can be deleted. Retire it instead." 409 application_in_use → list details.references (keys, webhooks, grants…) with links |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
Notes: Retiring cascades in one transaction: platform-managed Entitlements end, other active ones are revoked (disabled_reason: application_retired), API Keys are revoked, webhooks disabled, push credentials disabled, devices inactive (application_retired), and access.revoked fires. Roles, settings, audit history and the slug stay. Suspension doesn't cascade.
APL-04 — Settings schema
Domain: D9 Applications · Route: /dev/apps/:appId/schema · Archetype: tab · Phase: Phase 2
Who: Owner / applications.manage
Purpose: Declare per-user settings the app stores in Substratal.
Web (PWA) container: tabpanel (route segment)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Properties | list | virtualized list | settings_schema.properties: key, type, enum, default, min/max, maxLength | add/edit via form |
| JSON editor | code-editor | CodeMirror 6 (JSON) | settings_schema | JSON validation; diff before save |
| Preview | rendered SET-02 form | SchemaForm preview | shows exactly what users will see | |
| Stats | caption | settings_schema_stats |
| Action | Call | Result handling |
|---|---|---|
| Save | PATCH /applications/{id} {settings_schema} |
422 → schema rule errors |
APL-05 — Permissions & roles
Domain: D9 Applications · Route: /dev/apps/:appId/roles · Archetype: tab · Phase: Phase 2
Who: Owner / applications.manage
Purpose: Declare app permissions, available app roles and the default role.
Web (PWA) container: tabpanel (route segment)
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Permissions | editable list | role=grid virtualized table | permissions[] {key, description} | key app. |
| Available app roles | token list | token input (chips in input) | available_app_roles (≤ 20) | |
| Default app role | select | default_app_role | held implicitly by everyone with access |
| Action | Call | Result handling |
|---|---|---|
| Save | PATCH /applications/{id} |
APL-06 — Review
Domain: D9 Applications · Route: /dev/apps/:appId/review · Archetype: form · Phase: Phase 3
Who: applications.manage
Purpose: Staff moderation of an application.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Review status | radio-group | review_status | ||
| Notes | text-area | review_notes | visible to owner |
| Action | Call | Result handling |
|---|---|---|
| Save | PATCH /applications/{id} {review_status, review_notes} |
APL-07 — Push credentials
Domain: D9 Applications · Route: /dev/apps/:appId/push · Archetype: tab · Phase: Phase 2
Who: Owner or applications.manage with a User token (write); app key / owner (read)
Purpose: Configure APNs, FCM and Web Push for an Application so it can send push notifications.
Web (PWA) container: tabpanel (route segment)
Loads: GET /applications/{id}/push-credentials
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Providers | list | virtualized list | PushCredential per provider apns | fcm | web_push: status active|failed|disabled, failure_reason, failed_at, last_used_at; apns team_id/key_id/topic; fcm project_id/client_email; web_push subject + vapid_public_key | one row per provider with Add / Edit / Remove; failed → warning banner with reason and Fix |
| Add APNs | form | POST body: provider apns, team_id (10), key_id (10), topic (bundle id), private_key (.p8) | file picker / drop / paste for the .p8; key never shown again | |
| Add FCM | form | POST body: provider fcm, service_account (JSON file) | drop/pick the downloaded JSON; validate shape client-side | |
| Add Web Push | form | POST body: provider web_push, subject (mailto:/https:) | platform generates VAPID keys; show vapid_public_key with Copy for the web client | |
| Rotate / fix | form | PATCH /applications/{id}/push-credentials/{provider} {key material | status: active} | web_push can't rotate in place — explain delete + recreate | |
| Remove | destructive-button | DELETE /applications/{id}/push-credentials/{provider} | confirm; web_push removal deactivates every browser subscription | |
| Platform alerts | toggle | Application.receives_platform_notifications | mirror of APL-03 toggle |
| Action | Call | Result handling |
|---|---|---|
| Add | POST /applications/{id}/push-credentials |
201; 409 push_credential_exists → Edit; 409 application_retired → hide Add; 422 invalid_push_credential → field error; 400 user_token_required never happens in the Hub (User token) |
| Fetch one | GET /applications/{id}/push-credentials/{provider} |
on Edit |
| Save | PATCH /applications/{id}/push-credentials/{provider} |
409 invalid_status_transition |
| Remove | DELETE /applications/{id}/push-credentials/{provider} |
204 |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
Notes: disabled means the Application was retired; it can't be re-enabled. To prove a credential end to end, test from the Application itself: POST /users/{id}/devices/{deviceId}/test accepts the device's own user or the Application's own key, so the app (or its backend, with its key) sends the test to a device registered to it. The Hub doesn't offer it here or on NTF-03, which tests the Hub's own devices only.
D10 · Developer Credentials
KEY-01 — API keys
Domain: D10 Developer Credentials · Route: /dev/keys · Archetype: table · Phase: MVP
Who: api_keys.manage or app owner
Purpose: Service and agent credentials.
Web (PWA) container: Virtualized grid table ≥ 1024 px; card rows below
Loads: GET /api-keys?q&scope&mode&intended_use&include_inactive&include=total
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Search | search | q: case-insensitive prefix of name |
combines with filters | |
| Count | caption | caption |
page.total / page.total_capped |
"{n} keys"; capped → "10,000+ keys"; follows the filters |
| Filters | chips | toggle-button chip row | mode live|test, intended_use, include revoked | TEST pill on test keys |
| Columns | table | role=grid virtualized table | name, scope, secret_hint, mode, intended_use, restrict_destructive, last_used_at, expires_at, status(revoked_at) | |
| Create key | primary-button | → KEY-02 |
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES
KEY-02 — Create API key
Domain: D10 Developer Credentials · Route: /dev/keys/new · Archetype: form · Phase: MVP
Who: api_keys.manage or app owner (app-scoped)
Purpose: Create a key with least-privilege permissions.
Web (PWA) container: Modal <dialog> ≥ 768 px; bottom sheet (drag handle, snap points) < 768 px
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Name | text-field | name | ||
| Scope | select | scope platform | application | owners: own apps only | |
| Mode | segmented | role=radiogroup segmented buttons | mode live | test | fixed after creation — say so |
| Used by | radio-group | intended_use service | agent | agent defaults restrict_destructive on | |
| Block destructive operations | toggle | restrict_destructive | ||
| Permissions | checkbox-list | grouped checkbox list | permissions | filtered by scope via GET /permissions; app-scoped keys offer the five app-confined platform permissions incl. notifications.send |
| Expires | date-field | date-field | expires_at | optional; presets 30/90/365 days |
| Rate limit | number-field | rate_limit_per_minute | platform api_keys.manage only (hidden for app owners: sending it is 403); 1–10,000 per minute; empty = default 100 |
| Action | Call | Result handling |
|---|---|---|
| Create | POST /api-keys |
201 ApiKeyWithSecret → KEY-03. A platform-scoped key needs step-up (GLB-03 Confirm it's you) |
KEY-03 — Secret reveal
Domain: D10 Developer Credentials · Route: (modal) · Archetype: secret · Phase: MVP
Who: Creator
Purpose: Show a new API key secret, webhook signing secret, or recovery codes exactly once.
Web (PWA) container: Modal <dialog>, cancel prevented, no Esc
| Element | Kind | Web (PWA) control | Data / API | Rules |
|---|---|---|---|---|
| Secret | monospace selectable text | with user-select:all |
secret | never logged, never persisted, excluded from screenshots where the OS allows |
| Copy | button | clipboard (sensitive) | auto-clear after 60 s where supported | |
| Acknowledge | checkbox | client | gates Done; modal not dismissible until checked |
KEY-04 — API key detail
Domain: D10 Developer Credentials · Route: /dev/keys/:keyId · Archetype: detail · Phase: MVP
Who: api_keys.manage or app owner
Purpose: Edit, rotate or revoke a key.
Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px
Loads: GET /api-keys/{id} · GET /audit-events?actor_id={id} · Usage: GET /usage?api_key_id={id}&granularity=day (operations.view; an owner adds application_id of the key's app)
| Element | Kind | Web (PWA) control | Data / API | Rules | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Fields | settings rows | settings rows | name, permissions, restrict_destructive (editable); rate_limit_per_minute (platform api_keys.manage only; empty = default 100); scope, mode, intended_use, expires_at, created_by, last_used_at (read-only) | changing the rate limit needs step-up | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Usage | chart + table | chart +
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES WHK-01 — WebhooksDomain: D10 Developer Credentials · Route: Web (PWA) container: List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px Loads:
States: Loading: skeleton after 300 ms; Empty failures: "No failed deliveries in this range."; Error: inline with Retry; codes per COPY-AND-STATES WHK-02 — Add / edit webhookDomain: D10 Developer Credentials · Route: Web (PWA) container: Modal
WHK-03 — Webhook — DeliveriesDomain: D10 Developer Credentials · Route: Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES WHK-04 — Delivery detailDomain: D10 Developer Credentials · Route: Web (PWA) container: Popover ≥ 1024 px; side panel 768–1023; bottom sheet < 768 Loads:
States: Loading: skeleton after 300 ms; 404 delivery_not_found → "This delivery is older than 30 days, or isn't on this webhook." with a link to WHK-03 D11 · Plan & BillingBIL-01 — My planDomain: D11 Plan & Billing · Route: Web (PWA) container: Grouped settings rows in main pane Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES; After return from checkout: poll GET /users/me/subscription every 2 s (max 30 s) until plan = standard, showing "Finishing up…"; Downgraded: "Your Standard access ended on {date}. Your data is kept." Notes: Business/Enterprise aren't offered (422 plan_requires_sales); show "Contact sales" link only. Standard is billed monthly or yearly (owner decision, 2026-11-04), USD only, with no trial. A first checkout that's never completed becomes BIL-02 — Organization subscriptionDomain: D11 Plan & Billing · Route: Web (PWA) container: Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES Notes: Members gained or lost take effect at once; say so before saving. On a yearly subscription, members added mid-year are prorated and invoiced at once ("Members you add during the year are prorated and invoiced right away."); monthly subscriptions aren't prorated. BIL-03 — Checkout / billing portalDomain: D11 Plan & Billing · Route: Web (PWA) container:
Notes: BIL-04 — Tenant & infrastructureDomain: D11 Plan & Billing · Route: Web (PWA) container: Detail pane with header, tablist, toolbar; full page < 768 px Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES D12 · Audit LogAUD-01 — Audit logDomain: D12 Audit Log · Route: Web (PWA) container: Virtualized grid table ≥ 1024 px; card rows below Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES Notes: Hot window is one year for every Tenant; read the AUD-02 — Audit eventDomain: D12 Audit Log · Route: Web (PWA) container: Popover ≥ 1024 px; side panel 768–1023; bottom sheet < 768 Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES D13 · NotificationsNTF-01 — InboxDomain: D13 Notifications · Route: Web (PWA) container: List pane (resizable) + detail pane ≥ 768 px; single pane < 768 px Entry points: Bell in the toolbar / Inbox in the sidebar (desktop) / Inbox tab (compact); Tapping a push; Badges (app icon, Dock/taskbar, PWA) Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES; Empty: "You're all caught up"; Feature off (501 not_implemented): hide Inbox entry points; badges fall back to none; Retention: items older than 90 days disappear (caption in empty Archived view) Notes: The Inbox shows notifications from every Application plus platform alerts, but push banners for another app's notifications arrive through that app's own install — the Hub only pushes its own ( NTF-02 — NotificationDomain: D13 Notifications · Route: Web (PWA) container: Popover ≥ 1024 px; side panel 768–1023; bottom sheet < 768 Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES NTF-03 — Devices & notificationsDomain: D13 Notifications · Route: Web (PWA) container: Grouped settings rows in main pane Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES Notes: Device tokens are never displayed (only token_hint). NTF-04 — Turn on notificationsDomain: D13 Notifications · Route: Web (PWA) container: Dialog/sheet with step indicator; each step a URL hash Entry points: First time a notification-worthy moment happens (org invite, first launch after sign-in on mobile, enabling in NTF-03/SET-01) — never on cold start before sign-in
Notes: Re-register on launch at most once a day (keeps the device from going stale after 270 days). Windows and Linux have no supported push provider in the API: this screen is replaced by an in-app explanation and local notifications from polling (see their PLATFORM-SPEC). NTF-05 — User — Notifications & devicesDomain: D13 Notifications · Route: Web (PWA) container: Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; codes per COPY-AND-STATES NTF-06 — Send notificationDomain: D13 Notifications · Route: Web (PWA) container: Modal
G · Global / ShellGLB-01 — Command paletteDomain: G Global / Shell · Route: Web (PWA) container: Top-layer
GLB-02 — Manage hubDomain: G Global / Shell · Route: Web (PWA) container: Bottom-nav destination list < 768 px
GLB-03 — System statesDomain: G Global / Shell · Route: Web (PWA) container: Top-layer
Notes: C · ConsoleThe web Hub's management additions (PRODUCT-SPEC §2a). Web adopts them; the native apps skip them for now (OPEN-QUESTIONS #27). OPS-, SEC-01 and CFG- read through the Ops gateway, a same-origin backend of the web Hub with read-only AWS access. It checks the person's access token against the API's JWKS (RS256, issuer, expiry; test-mode tokens refused), confirms their platform roles with Gateway states. A panel the gateway has no data source for in this deployment answers OPS-01 — OverviewDomain: C Console · Route: Loads:
States: Loading: skeleton after 300 ms; Error: per tile, so one failing source doesn't blank the page; Gateway OPS-02 — Traffic & latencyDomain: C Console · Route: Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry OPS-03 — LogsDomain: C Console · Route: Loads:
States: Loading: progress while the query runs; Empty: "No log lines match."; Error: inline with Retry SEC-01 — Security eventsDomain: C Console · Route: Loads:
Notes: Token refreshes go through the web Hub's backend. The API records the person's real IP and user agent for them only when the backend signs OPS-04 — AlarmsDomain: C Console · Route: Loads:
OPS-05 — Jobs & deliveryDomain: C Console · Route: Loads:
OPS-06 — ReleasesDomain: C Console · Route: Loads:
OPS-07 — CostDomain: C Console · Route: Loads:
Notes: Show "Updated {time}" because the data is up to 6 hours old. CFG-01 — ConfigurationDomain: C Console · Route: Loads:
Notes: Read-only. Terraform-owned values say "Change this in the API repo" and link to the variable. CFG-02 — Feature flags & platform settingsDomain: C Console · Route: Loads:
States: Loading: skeleton after 300 ms; Error: inline with Retry; read-only for operations.view without operations.manage RPT-01 — ReportsDomain: C Console · Route: Loads:
Notes: Revenue stays in Stripe; link to the Stripe dashboard instead of mirroring it. INT-01 — IntegrationsDomain: C Console · Route: Loads:
|