Mediloop

Tenant context

Platform

Select 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 / claimPurpose
X-Tenant-IdSelects the active tenant for the request
membership_idIdentifies the active user-to-tenant membership where required
tenant_id claimCurrent authenticated context when issued by Mediloop
role / scopesEffective 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

RuleBehavior
Membership requiredReject tenant access without an active membership
Least privilegeResolve permissions from membership + roles + scopes
No cross-tenant inferenceDo not expose resource existence across unauthorized tenants
Audit attributionPersist tenant and membership context on sensitive writes