Log in (SPA cookie session)
POST/api/login
Authenticates the GLOBAL account (its password is the sole credential —
no tenant slug required) and resolves the account's active memberships.
Requires the CSRF cookie from /sanctum/csrf-cookie.
- Exactly one active membership → logs in immediately as that tenant's
user (
needs_tenant_selection: false,userpopulated). A session cookie is set. - More than one active membership → does NOT log in
(
needs_tenant_selection: true,user: null); the client must callPOST /api/session/select-tenantwith a chosentenant_id.
Request
Responses
- 200
- 422
- 429
Either authenticated (single membership; session cookie set) or awaiting tenant selection (multiple memberships).
The request failed validation.
Rate limit exceeded.
Response Headers
X-RateLimit-Limit
Request quota for the current window.
X-RateLimit-Remaining
Remaining requests in the current window.
Retry-After
Seconds to wait before retrying.