Management session authentication
Property managers scripting against the Core API should complete Getting Started — Recommended Setup Sequence steps 1–3 (General information, Users, Preferences) before wiring POST /auth/login — this is operator JWT auth, not partner Authentication Bearer keys. Finish steps 4–15 and Onboarding a New Property — Step 7 before portfolio-wide automation touches live bookings. When sign-in was restored mid-setup, see Getting Started — Lockout catch-up after password recovery (refresh Bearer JWT before MCP or scripted calls resume). Guide pairing after go-live: Setup sequence after go-live (hub: API Reference — Setup sequence after go-live).
Start with How it differs from integration auth and Sign-in flow, then Authenticated API calls for curl examples. Contrast Authentication (partner Bearer keys on integration prefixes). For scripted retries after expiry, see Error Handling on 401 refresh failures. External AI clients: Landlord MCP alternative. Habit-specific shortcuts live under Related below.
This page documents operator authentication for the Vivin Core API — the same session the management frontend uses at platform.vivin.app. It is not the partner integration Bearer token used for GET /{platform}-integration/listings and similar routes.
Use this when you build internal automation, one-off scripts, or evaluate HTTP routes before wiring Landlord MCP. For production AI clients, prefer Landlord MCP tools (they enforce the same permissions as the UI).
How it differs from integration auth
Partner integrations use long-lived Bearer keys — Authentication. Never paste integration keys into Core /api Swagger below.
| Aspect | Management session | Partner integration |
|---|---|---|
| Who | Property managers, Vivin internal operators | Channel managers, OTAs, booking engines |
| Credential | Email + password or Google ID token → short-lived JWT in response body | Long-lived API key in Authorization: Bearer |
| Refresh | httpOnly cookie (POST /auth/refresh) — not readable from JavaScript | Key does not rotate unless Vivin rotates it |
| Scope | User role + accountId on every domain route | Single integration platform + account |
| Docs surface | Core API Swagger at /api when enabled (see below) | Per-integration Swagger at /{platform}-integration |
Sign-in flow
Browser clients rely on httpOnly refresh cookies — command-line scripts need curl -c cookies.txt -b cookies.txt. Session UX: Getting Started — Staying signed in.
POST /auth/login HTTP/1.1
Host: api.vivin.app
Content-Type: application/json
{
"email": "[email protected]",
"password": "your-password"
}
Response (200) — short-lived access token plus user and account context:
{
"token": "<JWT>",
"user": {
"id": "…",
"email": "[email protected]",
"firstName": "…",
"lastName": "…",
"role": "…",
"accountId": "…"
},
"account": {
"id": "…",
"companyName": "…",
"logoUrl": "…"
}
}
The server also sets an httpOnly refresh cookie on the response. Browser clients (the management frontend) send that cookie automatically on POST /auth/refresh. Command-line scripts must preserve cookies between requests (for example curl -c cookies.txt -b cookies.txt).
Google sign-in (POST /auth/google)
When the hub UI shows Sign in with Google, the browser posts a Google Identity Services ID token instead of email/password. The response shape and refresh cookie match POST /auth/login. Vivin resolves an existing property manager by linked Google subject or by email match — it does not create users. Unknown Google emails are rejected; deactivated users cannot sign in. Operator UX: Getting Started — Sign in with Google.
POST /auth/google HTTP/1.1
Host: api.vivin.app
Content-Type: application/json
{
"idToken": "<Google Identity Services ID token>"
}
Prefer email/password for headless scripts unless you already hold a fresh Google ID token. Browser operators should use the hub button rather than calling this route manually.
Command-line example (login + refresh cookie)
Replace api.vivin.app with your API host:
# 1) Sign in — save Set-Cookie refresh token to a jar and read the access JWT
curl -sS -c cookies.txt -X POST 'https://api.vivin.app/auth/login' \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","password":"your-password"}' \
| tee login.json
export VIVIN_JWT="$(jq -r .token login.json)"
# 2) Call a protected route
curl -sS -b cookies.txt -H "Authorization: Bearer ${VIVIN_JWT}" \
'https://api.vivin.app/bookings?limit=5'
# 3) When the JWT expires, refresh (cookie only — no body)
curl -sS -b cookies.txt -c cookies.txt -X POST 'https://api.vivin.app/auth/refresh' \
| tee refresh.json
export VIVIN_JWT="$(jq -r .token refresh.json)"
# 4) End the session server-side
curl -sS -b cookies.txt -c cookies.txt -X POST 'https://api.vivin.app/auth/logout'
The refresh cookie name and attributes are managed by Core API — treat cookies.txt as a secret alongside the JWT.
Authenticated API calls
Refresh with POST /auth/refresh when JWT expires — 401 patterns in Error Handling. Permission matrix: Users and roles.
Send the access token on every protected route:
GET /bookings HTTP/1.1
Host: api.vivin.app
Authorization: Bearer <JWT>
When the JWT expires, call POST /auth/refresh with the refresh cookie (no body, no access token required). A successful refresh returns a new token in the body and rotates the refresh cookie.
POST /auth/logout revokes the current refresh token and clears the cookie. Safe to call even when the access token is already expired.
Operator-visible behaviour (silent refresh, session-expired message, sidebar Logout) is described in Getting Started — Staying signed in.
sequenceDiagram
participant Client as Script or browser
participant API as Core API
Client->>API: POST /auth/login (email + password)
API-->>Client: 200 body.token (JWT) + Set-Cookie refresh
Client->>API: GET /bookings Authorization Bearer JWT
alt JWT expired
Client->>API: POST /auth/refresh (refresh cookie)
API-->>Client: 200 new token + rotated cookie
Client->>API: Retry protected route with new JWT
end
Client->>API: POST /auth/logout (refresh cookie)
API-->>Client: Refresh revoked; cookie cleared
Permissions and multi-tenancy
Every route filters by signed-in accountId — same tenancy model as partner reads after Property & Unit Mapping. Do not reuse management JWTs on integration prefixes.
Every management route is scoped to the signed-in user's accountId. Module tabs and write actions additionally require role permissions (for example finance.approve_payments, bookings.create) — the same matrix documented under Users and roles.
401 / 403 responses follow the patterns in Error handling. Integration partners should not reuse management JWTs on integration route prefixes, and vice versa.
Core API Swagger (/api)
Enable locally with ENABLE_CORE_API_SWAGGER=true — integration Swagger stays separate per Try requests in Swagger. Paste JWT from POST /auth/login, not partner Bearer keys.
The internal Core API catalogue (all management and domain routes) is exposed at /api on the API host when ENABLE_CORE_API_SWAGGER=true (or 1) on that environment. It may be disabled on production hosts.
Integration Swagger pages (/uniplaces-integration, /ical-integration, etc.) stay enabled separately — see Try requests in Swagger.
To explore management routes locally:
- Start Core API with Core Swagger enabled for your environment.
- Open the Core Swagger UI on your API host (path
/api). - Click Authorize, choose the Bearer scheme, and paste the JWT from
POST /auth/login(with or without theBearerprefix, per the form hint). - Expand a tag (for example bookings) and use Try it out on a
GETyou have permission to call.
The Bearer control uses the same JWT as programmatic management calls — not your integration API key. Integration Swagger pages (/{platform}-integration) remain separate; see Try requests in Swagger.
On shared API hosts (for example api.vivin.app), /api may return 404 when ENABLE_CORE_API_SWAGGER is not set. Integration Swagger URLs stay available for partners. Operators evaluating management routes on those hosts should use the management UI, Landlord MCP, or a local Core API instance with Swagger enabled.
Landlord MCP alternative
Prefer Landlord MCP for external AI clients — same permissions as the UI without raw HTTP. Booking-scoped automation: Tenant MCP.
Landlord MCP wraps the same Core API behind MCP tools with session-based auth (Mcp-Session-Id). Prefer MCP when external AI clients need structured, permission-aware tool calls instead of raw HTTP.
Authentication paths for Landlord MCP:
| Path | When to use |
|---|---|
| API keys | IDE assistants (Cursor, Claude Desktop), custom scripts — paste Bearer token from AI / MCP |
| MCP OAuth | Hosted connectors (Claude.ai, ChatGPT) — PKCE authorization code on the Core API host |
POST /auth/login (this page) | One-off scripts and Swagger exploration — refresh via httpOnly cookie |
POST /auth/google (this page) | Hub Sign in with Google — same JWT + refresh cookie; requires an existing invited user |
POST /auth/refresh / POST /auth/logout | Silent renewal and explicit end of session (browser or scripts with cookie jar) |
Connector OAuth issues the same management JWT shape as login; see MCP OAuth — Token response.
Management session section cross-reference
Use the endpoints and fields above. Related integrator pages are linked inline where useful.
Related
Related below links operator JWT and refresh cookies to setup, companion API guides, operator workflows, and escalation paths.
Setup sequence after go-live
Complete Account Settings — Recommended setup order before partner traffic.
- Setup steps 1–3 (General Information, Preferences, Users) — Complete before scripted management HTTP; greyed-out routes usually mean step 3 permissions are missing (FAQ — Navigation & shortcuts)
- Setup steps 4–12 — Onboarding a New Property mirrors Account Settings tabs operators configure before automation targets live inventory
- Setup steps 13–15 (Listings, Bookings, Tenants) — Validate
accountId-scoped reads against the same inventory partner Bearer keys see on integration prefixes - After steps 13–15 — Onboarding a New Property — Step 7 go-live verification before escalating JWT or permission errors on management routes
- After step 3 — sign in with Getting Started — Staying signed in; contrast Authentication partner Bearer keys (never paste integration tokens into Core
/apiSwagger) - Prefer Landlord MCP for external AI clients when JWT refresh or permission matrices block raw HTTP scripts
- Escalation — In-app Vivin support tickets via Get Help & Support when management session errors block operator automation (distinct from
[email protected])
Documentation map & escalation
- Getting Started — Recommended Setup Sequence before partner HTTP traffic;
- API Reference hub — Hub pairing matrix across integration guides;
- Get Help & Support — Escalate when JWT refresh or permission errors block management automation (hub: Setup sequence after go-live)
- Using in-app support — Escalate JWT refresh or permission failures that block management automation scripts
- Introduction — Platform overview and how operator JWT routes relate to partner Bearer keys
Companion API guides
Companion guides share Bearer authorization or error shapes with this page — start from API Reference hub.
- Authentication (integration) — Partner Bearer keys for marketplace and booking-engine feeds
- AI usage — Account-scoped LLM token ledger (
GET /ai-usage,GET /ai-usage/summary) on the same management JWT - Error handling — Standard HTTP error shapes and
401refresh failures - Creating Bookings — Partner write surface (distinct from operator JWT on management routes)
- Webhooks & Notifications — Outbound events when automation listens instead of polling management
GETs - Property & Unit Mapping — Partner
externalIdscope contrast with operatoraccountIdJWT routes
Upstream & downstream workflows
- Resetting a Management User Password — Session recovery when JWT refresh fails after password rotation
- Portfolio KPI review — Month-end reconciliation scripts may run before opening Finance management routes
- Handling a Late Payment — Step 1 — Collections scripts that query management Transactions routes after JWT sign-in; upstream path from Notifications — Payment overdue alerts
- Entering Monthly Utility Bills — Supplier bill ingestion scripts that run before opening Utilities → Bills in the UI
Operator UI & settings
- Users and roles — Permission matrix behind management routes
- Settings > Preferences — In-app notifications — Alert categories management automation may poll after JWT sign-in
- Settings > Emails — Communication Rules management JWT routes may audit alongside scripted booking imports
- Getting Started — External AI and automation — When to choose Landlord MCP, Tenant MCP, or direct management HTTP
- Getting Started — Staying signed in — Browser silent refresh and session-expired UX
- Management Frontend Deep Links — Bookmarkable routes to share with scripts that open the UI after API queries
- Finance > Deposits — JWT-authenticated deposit refund queue for scripted departure-week reconciliation
Deeper concept reads
- Landlord MCP — Recommended external automation surface for operators
- Tenant MCP — Booking-scoped alternative when automation targets one reservation
- Automation & AI — Channel map for in-product AI, chatbot, and external MCP clients
- Payment Allocation — Operator payment matching behind many management routes
- Integrations & Distribution — Marketplace partner APIs use integration Bearer keys, not management JWTs from this guide
- Services Marketplace — Portal service charges management JWT scripts may reconcile on Transactions after tenant Request Service
- Tenant Portal — Operator JWT workflows that copy portal links from booking Contract Info after management session sign-in
- FAQ — Tenant contract signing blocked — No PDF yet, mandatory Your Details gates, category locks, or Lease purpose; portal signing vs paper upload on Contract Info
- Booking Lifecycle — Computed Upcoming → Ongoing → Ended / Canceled status model, list filters, and Timeline
Deeper workflow reads
See Upstream & downstream workflows above for the same guides.
Operator habit hubs
Day-to-day operator habits (lockout catch-up, pending receipts, payment triage, handoffs, and related playbooks) live on the Common Workflows habit hub.
Deep-link anchors for habit hubs
Lockout catch-up after password recovery
Pending manual receipt approval
Reject/revert mistaken receipts
Portfolio segmentation by tenant category
Notification row-click navigation
Payment alert to receivables triage
Confirmation alert triage
Finance debt receivables triage
Handling a Late Payment collections
Finance Income status drill-down
Cash flow forecast drill-down
Key glossary terms
- Glossary — Credit note (payment reject/revert) — Accounting follow-up when management scripts reject already-invoiced receipts
- Glossary — Invoiced floor (rent) — Rent edits blocked below exported invoice totals on JWT-authenticated management routes
- Glossary — Deposit lifecycle status — Management JWT routes for Finance → Deposits and booking Deposit tab require
bookings.refund/ Approve payments permissions - Glossary — End-of-Booking cost split — Charge Time → End of Booking splits daily overage across every occupied unit; still-staying roommates stay in the denominator
- Glossary — Change history — Operator-initiated edits on Listings setup and Bookings Changelog; create-time defaults excluded
- Glossary — Archived booking ledger visibility — Delete Booking hides manual/provider_platform rows on Finance → Transactions; vIBAN and credit card stay visible
- Glossary — Full term list
Module documentation hubs
for screen-by-screen operator follow-up.
- AI Chat module — In-management assistant using the same operator JWT session as management HTTP routes (hub)
- Bookings module — Operator UI routes that share the same JWT session as management scripts (hub)
- Finance module — Ledger tabs that require Approve payments permission on top of a valid session (hub)
- Inbox module — WhatsApp routes that require the same operator session as management scripts (hub)
- Dashboard module — Same-day KPI snapshot using management JWT routes (hub)
- Operations module — Ticket and cash-flow routes behind the same JWT session as management scripts (hub)
- Notifications module — Alert routes automation may poll after management JWT sign-in (hub); Payment overdue alerts when scripted queries surface unpaid schedules
- Audit module — Portfolio-wide Manual Blocks and Discounts contract-value review (hub)
- Analytics module — Month-range portfolio KPI charts with rankings and heatmaps (hub)
- Listings module — Property wizard, Channels tab, and unit management (hub)
- Properties workspace — Legacy
/propertiesURL redirects into Listings (hub) - Booking engine details — Rich marketplace payload editor via the Full integration pill (hub)
- Tenants module — Tenant directory and profile sidebars (hub)
- Sales module — Portfolio availability and channel manager connections (hub)
- Utilities module — Bills Included ceiling model and tenant overage charges (hub)
- Account Settings — Workspace-wide financial policies, templates, integrations, and operational defaults (hub)