Enterprise API
The Enterprise API is the dedicated client-facing surface for commercial facility managers, enterprise estate clients, and property partners.
While Vibrant staff and field technicians perform walkthroughs, set schedules, and triage issues via the Internal API, the Enterprise API provides the external client portal for property owners and managers to monitor operations and approve work.
What It Does
- Client Maintenance Calendar & Assets: Viewing property equipment, maintenance schedules, and completed service records.
- Walkthrough & Media Inspection: Reviewing inspection reports, walkthrough summaries, and photo/video evidence.
- Work Item Decisions & Approvals: Reviewing recommended repairs and recording client approval decisions (accept, defer, decline).
- Media Storage Integrations: Generating presigned URLs for client uploads/downloads (S3/RustFS) and receiving async object-creation webhooks.
The Dual-Transport Split
Like the other surfaces, the Enterprise API splits read queries from stateful workflows:
- Enterprise PostgREST (
enterprise_apischema, port 3850): - Handles high-volume reads directly from PostgreSQL views: maintenance schedules, assets, walkthrough logs, and work items.
- Enforces Row-Level Security (RLS) scoped to the caller's authorized company and sites.
- Enterprise FastAPI (
vibrant_platform_enterprise_api, port 3800): - Handles multi-step operations:
POST /sites/{site_id}/media/upload-intents,GET /sites/{site_id}/media/{media_id}/download, andPOST /sites/{site_id}/work-items/{item_id}/decision. - Ingests asynchronous object-storage webhooks at
/internal/media/object-createdvia shared webhook tokens.
Identity & Authorization
- Keycloak Client:
vibrant-enterprise-webin thevibrantrealm. - JWT Claim: Carries
role: enterprise_portal_role. - Anonymous Access: Falls back to
enterprise_portal_anon(fails closed for protected resources). - Database Connection: FastAPI connects via
enterprise_api_loginusing application roleenterprise_api_role. - Shared Code: Imports shared database and security utilities from
vibrant_platform_common, but never imports fromvibrant_platform_apiorvibrant_platform_internal_api.
Technical Pointers
- Service Code:
src/vibrant_platform_enterprise_api/ - Entrypoint:
vibrant_platform_enterprise_api.main:create_app - Settings:
src/vibrant_platform_enterprise_api/app_settings.py(VIBRANT_ENTERPRISE_API_*) - Database Schemas:
enterprise_api,site_maintenance, andmediaininfrastructure/db/schema.sql - Local Compose Service:
enterprise-apiandenterprise-postgrestininfrastructure/local/compose.yaml