POST /rpc/json with a JSON-RPC 2.0 envelope.
Request shape
get#SessionInfo from the Auth facade:
Required headers
Every call sends:X-CSRF-Token plus the darpan_login_key session cookie; the header-token
channel adds login_key instead, with no CSRF token and no cookie.
Authentication channels
Two channels exist. Which one applies is not ambiguous:- Browser app (canonical): HttpOnly cookie. With cookie auth enabled, the app
authenticates through the
darpan_login_keyHttpOnly cookie plus the CSRF token from/apps/darpan/csrfToken. No token is stored where page scripts can read it. - Integration callers and fallback:
login_keyheader. Non-browser clients — and browser deployments where credentialed CORS is unavailable — send the token returned bylogin#Sessionin thelogin_keyrequest header. Keep the token in memory; never put it in query parameters.
Access-Control-Allow-Credentials for the app origins. A wildcard allowlist is an incident
posture, not a configuration.
Success shape
Error shape
Errors return anerror object instead of result; facade business validation instead returns result.ok: false with result.errors[]. For the envelope, the code table, and the validation shape, see Errors.
Contract versioning
The generated contract carriesinfo.x-darpan-contract-version, decoupled from the
product release version. The policy is additive-only:
- Non-breaking, no version bump: new methods, new optional request parameters, new response fields.
- Breaking, requires a conscious version bump: removing a method, removing or renaming a parameter or response field, changing a field’s type, or making a parameter newly required.