Resolve the current principal from the verified JWT
Returns the caller’s identity and authorized tenant scope as derived from the verified bearer token’s claims. Purely a read of the validated token + the merchant/store mapping; it does not establish or mutate a session. A request with a missing/invalid/expired token gets 401.
/auth/meAuthorizationBearer token (JWT) · headerrequiredJWT issued by the external IdP via the OAuth 2.0 authorization-code flow (Kinde in
production; a simulator in test). The client obtains it and sends it as a Bearer token on
every authenticated call. Sarvex's services verify it — issuer, audience, signature
(IdP JWKS), expiry — and read identity and tenant from its claims. Sarvex does not issue
or revoke these tokens. merchant_id/store_id are read from the verified claims (and the
merchant→store mapping), never from the URL. The operator scope is required for
/operator/*. Operators acting on a specific merchant pass the X-Operate-As header,
which is recorded in the audit log.
Current principal and authorized scope.
user_idstringSubject claim from the IdP token.
emailstring<email>rolestringownerstaffoperatormerchant_idstringThe merchant tenant the caller is authorized for (from claims; for operators, the X-Operate-As context).
store_idsstring[]Stores under that merchant the caller may act on (merchant → store). One in V1.
Missing or invalid credentials.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequireddetailsobject | null