TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/akevalion/life_cost/llms.txt
Use this file to discover all available pages before exploring further.
POST /update_last_visited_wallet endpoint updates the currently authenticated user’s active wallet context. Every transaction query in the application — including money transfers, chart data, monthly summaries, and category breakdowns — is scoped to current_user.last_visited_wallet_id. Calling this endpoint with a different wallet ID is what switches the user’s view from one wallet to another without logging out or creating a new session.
Method & Path
Authentication
This endpoint requires an active login session. Requests without a valid session cookie are rejected and redirected to the login flow. Session cookies are issued automatically upon successful Google OAuth sign-in.Request Body
The request body must be valid JSON with theContent-Type: application/json header set.
The numeric ID of the wallet to activate for the current user. This value is written directly to
current_user.last_visited_wallet_id in the user table. All subsequent queries (transfers, charts, statistics) will be filtered by this wallet ID until the endpoint is called again with a different value. Omitting this field or passing a falsy value returns a 400 error.Example Request
Example Request Body
Example Response
Error Cases
| Status | Body | Condition |
|---|---|---|
200 OK | {"message": "Last group updated successfully"} | The user’s active wallet was updated successfully. |
400 Bad Request | {"error": "Wallet ID is required"} | The wallet_id field was missing from the request body, null, or evaluated to a falsy value (e.g. 0). |
401 Unauthorized | — | The request was made without an authenticated session. The server redirects to the Google login flow. |
Missing wallet_id — 400 Response
The frontend calls this endpoint automatically when the user selects a different wallet from the wallet dropdown in the navigation bar. After receiving a
200 response, the page is reloaded so that all visible data — transactions, charts, and monthly totals — is refreshed against the newly activated wallet.