Retirement Lab Auth API
The auth API from Retirement Lab — 16 operation(s) for auth.
The auth API from Retirement Lab — 16 operation(s) for auth.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/retirementlab-app:retirementlab-app-auth-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Income Simulator Auth API
version: 0.1.0
tags:
- name: Auth
paths:
/api/auth/session:
get:
tags:
- Auth
summary: Get Or Create Session
operationId: get_or_create_session_api_auth_session_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthSessionResponse'
/api/auth/session/advertising-choice:
post:
tags:
- Auth
summary: Bootstrap With Advertising Choice
operationId: bootstrap_with_advertising_choice_api_auth_session_advertising_choice_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AdvertisingChoice'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthSessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/auth/login:
post:
tags:
- Auth
summary: Login
operationId: login_api_auth_login_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLoginRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthSessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/auth/me:
get:
tags:
- Auth
summary: Get Me
operationId: get_me_api_auth_me_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthSessionResponse'
security:
- HTTPBearer: []
/api/auth/google-login-state:
post:
tags:
- Auth
summary: Create Google Login State
operationId: create_google_login_state_api_auth_google_login_state_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleLoginStateRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleLoginStateResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/auth/google-redirect:
post:
tags:
- Auth
summary: Google Redirect Callback
description: 'Step 1 of the Google Sign-In redirect flow.
Google posts a form with ``credential`` and ``g_csrf_token`` fields.
We verify CSRF and the JWT, then 303-redirect to a same-origin GET
that completes the login. The two-step approach is required because
``SameSite=Lax`` does not send the existing ``sim_session`` cookie on
the cross-site POST from Google, but *does* send it on the subsequent
same-origin GET — allowing anonymous-session promotion to work.
The verified credential is passed to step 2 via a short-lived
``SameSite=Lax; Secure; HttpOnly`` cookie so it never appears in URLs.
Emits ``auth_flow_event`` with stage=``google_redirect``.'
operationId: google_redirect_callback_api_auth_google_redirect_post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
/api/auth/complete-login:
get:
tags:
- Auth
summary: Complete Login
description: 'Step 2 of the Google Sign-In redirect flow.
This is a same-origin GET, so the browser sends both the
``sim_session`` cookie (anonymous session) and the ``grl_credential``
cookie (verified JWT from step 1). We delegate to the existing
``login()`` handler for full attribution, analytics, and anonymous
session promotion.'
operationId: complete_login_api_auth_complete_login_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
/api/auth/logout:
post:
tags:
- Auth
summary: Logout
operationId: logout_api_auth_logout_post
responses:
'204':
description: Successful Response
/api/auth/token/exchange:
post:
tags:
- Auth
summary: Exchange Handoff Code
description: 'Exchange a one-time OAuth handoff code for a bearer token.
The mobile app receives the handoff code via deep link and POSTs it here
over HTTPS. The code is single-use and short-TTL; a reused or expired code
is rejected. On success a fresh opaque session token is issued — the same
server-side revocable credential as the web cookie.'
operationId: exchange_handoff_code_api_auth_token_exchange_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TokenExchangeRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/auth/token/refresh:
post:
tags:
- Auth
summary: Refresh Token
description: 'Renew a mobile bearer token (rotating refresh exchange).
Present the current valid bearer token; receive a fresh token with extended
expiry while the old token is revoked. An expired or revoked token is
rejected and the client must sign in again.'
operationId: refresh_token_api_auth_token_refresh_post
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenResponse'
/api/auth/account:
delete:
tags:
- Auth
summary: Delete Account
operationId: delete_account_api_auth_account_delete
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AccountDeleteRequest'
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/auth/account/export:
get:
tags:
- Auth
summary: Export Account Data
operationId: export_account_data_api_auth_account_export_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- HTTPBearer: []
/api/auth/email/enabled:
get:
tags:
- Auth
summary: Email Auth Enabled
operationId: email_auth_enabled_api_auth_email_enabled_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EmailAuthEnabledResponse'
/api/auth/email/password-login:
post:
tags:
- Auth
summary: Reviewer Password Login
description: Password auth for the single pre-provisioned, non-admin reviewer only.
operationId: reviewer_password_login_api_auth_email_password_login_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EmailPasswordLoginRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthSessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/auth/email/send-code:
post:
tags:
- Auth
summary: Email Send Code
description: 'Send a verification code via email.
Always returns 200 regardless of whether email exists — anti-enumeration.
Passwordless auth means every valid request follows the same code path
(generate, store, send), so timing does not leak account existence.
Email delivery is synchronous so that runtime failures (SES credential
issues, transient AWS errors) surface as a 503 to the caller instead of
silently succeeding while the code never arrives.'
operationId: email_send_code_api_auth_email_send_code_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EmailSendCodeRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties:
anyOf:
- type: boolean
- type: string
type: object
title: Response Email Send Code Api Auth Email Send Code Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/auth/email/verify-and-login:
post:
tags:
- Auth
summary: Email Verify And Login
description: 'Passwordless login: verify OTP code, then log in or create account.
Single endpoint — no password involved. Returns AuthSessionResponse.
Uses constant-time behavior whether the account is new or existing.'
operationId: email_verify_and_login_api_auth_email_verify_and_login_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EmailVerifyAndLoginRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthSessionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
GoogleLoginStateRequest:
properties:
terms_accepted:
type: boolean
title: Terms Accepted
default: false
marketing_email_opt_in:
type: boolean
title: Marketing Email Opt In
default: false
attribution:
additionalProperties:
type: string
type: object
title: Attribution
auth_flow_id:
type: string
title: Auth Flow Id
auth_intent:
type: string
title: Auth Intent
type: object
title: GoogleLoginStateRequest
EmailSendCodeRequest:
properties:
email:
type: string
title: Email
purpose:
type: string
enum:
- auth
title: Purpose
default: auth
type: object
required:
- email
title: EmailSendCodeRequest
RunLimit:
properties:
scope:
type: string
enum:
- anonymous_lifetime
- member_daily
- unlimited
title: Scope
limit:
type: integer
title: Limit
used:
type: integer
title: Used
remaining:
type: integer
title: Remaining
reset_at:
type: string
format: date-time
title: Reset At
type: object
required:
- scope
title: RunLimit
description: "Structured run-allowance summary returned for every user.\n\n``scope`` selects which allowance applies:\n- ``anonymous_lifetime``: anonymous lifetime sign-in run cap.\n- ``member_daily``: signed-in free member's daily compute allowance.\n- ``unlimited``: Pro/pass users have no compute cap (limit/used/remaining\n and reset_at are all null).\n\n``reset_at`` is the exact instant the daily window rolls over (member_daily\nonly) so the frontend can render it in the user's local timezone."
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
EmailPasswordLoginRequest:
properties:
email:
type: string
maxLength: 320
title: Email
password:
type: string
maxLength: 72
minLength: 1
title: Password
terms_accepted:
type: boolean
title: Terms Accepted
default: false
marketing_email_opt_in:
type: boolean
title: Marketing Email Opt In
default: false
type: object
required:
- email
- password
title: EmailPasswordLoginRequest
EmailAuthEnabledResponse:
properties:
enabled:
type: boolean
title: Enabled
type: object
required:
- enabled
title: EmailAuthEnabledResponse
TokenExchangeRequest:
properties:
code:
type: string
title: Code
type: object
required:
- code
title: TokenExchangeRequest
description: Exchange a one-time OAuth handoff code for a bearer token.
AuthLoginRequest:
properties:
credential:
type: string
title: Credential
terms_accepted:
type: boolean
title: Terms Accepted
default: false
marketing_email_opt_in:
type: boolean
title: Marketing Email Opt In
default: false
type: object
required:
- credential
title: AuthLoginRequest
AuthUser:
properties:
id:
type: integer
title: Id
provider:
type: string
title: Provider
name:
type: string
title: Name
email:
type: string
title: Email
picture:
type: string
title: Picture
type: object
required:
- id
- provider
- name
title: AuthUser
TokenResponse:
properties:
auth_token:
type: string
title: Auth Token
expires_at:
type: string
format: date-time
title: Expires At
type: object
required:
- auth_token
- expires_at
title: TokenResponse
description: Bearer token issued to a mobile (token-mode) client.
GoogleLoginStateResponse:
properties:
state:
type: string
title: State
expires_at:
type: string
format: date-time
title: Expires At
type: object
required:
- state
- expires_at
title: GoogleLoginStateResponse
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
EmailVerifyAndLoginRequest:
properties:
email:
type: string
title: Email
code:
type: string
title: Code
terms_accepted:
type: boolean
title: Terms Accepted
default: false
marketing_email_opt_in:
type: boolean
title: Marketing Email Opt In
default: false
type: object
required:
- email
- code
title: EmailVerifyAndLoginRequest
AccountDeleteRequest:
properties:
confirm:
type: string
title: Confirm
type: object
title: AccountDeleteRequest
AdvertisingChoice:
properties:
permission:
type: string
enum:
- granted
- denied
title: Permission
version:
type: string
enum:
- 2026-09-24.v1
title: Version
additionalProperties: false
type: object
required:
- permission
- version
title: AdvertisingChoice
AuthSessionResponse:
properties:
user:
$ref: '#/components/schemas/AuthUser'
anonymous:
type: boolean
title: Anonymous
default: false
account_tier:
type: string
title: Account Tier
default: free
scenario_cap:
type: integer
title: Scenario Cap
run_cap:
type: integer
title: Run Cap
runs_remaining:
type: integer
title: Runs Remaining
run_limit:
$ref: '#/components/schemas/RunLimit'
billing_enabled:
type: boolean
title: Billing Enabled
default: false
has_stripe_customer:
type: boolean
title: Has Stripe Customer
default: false
paid_access_expires_at:
type: string
format: date-time
title: Paid Access Expires At
billing_plan:
type: string
title: Billing Plan
has_active_subscription:
type: boolean
title: Has Active Subscription
default: false
can_start_stripe_checkout:
type: boolean
title: Can Start Stripe Checkout
default: true
can_start_store_purchase:
type: boolean
title: Can Start Store Purchase
default: true
trial_eligible:
type: boolean
title: Trial Eligible
default: false
pro_plan_price_usd:
type: integer
title: Pro Plan Price Usd
default: 10
free_n_scenarios:
type: integer
title: Free N Scenarios
signup_conversion:
type: boolean
title: Signup Conversion
default: false
missing_terms_acceptance:
type: boolean
title: Missing Terms Acceptance
default: false
auth_token:
type: string
title: Auth Token
auth_token_expires_at:
type: string
format: date-time
title: Auth Token Expires At
type: object
required:
- user
title: AuthSessionResponse
securitySchemes:
HTTPBearer:
type: http
scheme: bearer