Tenant context
PlatformSelect and propagate the active tenant context used for authorization, data isolation and audit attribution.
Isolation
Tenant-scoped by design
Hierarchy
Organizations + sub-organizations
Access
Membership + role context
Configuration
Policies, modules & branding
Overview
Identity is not tenant authorization. A valid user token must also resolve to an active membership for the requested tenant.
Context headers
| Header / claim | Purpose |
|---|---|
| X-Tenant-Id | Selects the active tenant for the request |
| membership_id | Identifies the active user-to-tenant membership where required |
| tenant_id claim | Current authenticated context when issued by Mediloop |
| role / scopes | Effective role and permissions for the active context |
Membership context
One user can have multiple professional and personal memberships. Switching tenant context changes effective access without creating a second user identity.
Request example
Tenant-aware requestCopy
curl -X GET "https://api.mediloop.lu/v1/appointments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-Tenant-Id: tnt_clinic_01" \
-H "X-Membership-Id: mbr_01"Security rules
| Rule | Behavior |
|---|---|
| Membership required | Reject tenant access without an active membership |
| Least privilege | Resolve permissions from membership + roles + scopes |
| No cross-tenant inference | Do not expose resource existence across unauthorized tenants |
| Audit attribution | Persist tenant and membership context on sensitive writes |