Mobile Exchange
POST
/auth/mobile/exchange
const url = 'https://example.com/auth/mobile/exchange';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"id_token":"example","device_name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/auth/mobile/exchange \ --header 'Content-Type: application/json' \ --data '{ "id_token": "example", "device_name": "example" }'Exchange an OIDC ID token for an API token (mobile PKCE flow).
The mobile app performs the full OAuth2 PKCE flow directly with the OIDC provider, then sends the resulting ID token here. The backend validates the token via JWKS, upserts the user, and creates an API token that expires after 90 days.
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
TokenLoginResponse
object
token
required
Token
string
user
required
UserOut
Schema for user profile response — ORM serialization via from_attributes.
object
id
required
Id
integer
sub
required
Sub
string
locale
Locale
string
base_currency
Base Currency
string
theme
Theme
string
theme_mode
Theme Mode
string
offer_rule_on_categorize
Offer Rule On Categorize
boolean
tour_seen
Tour Seen
boolean
setup_checklist_hidden
Setup Checklist Hidden
boolean
suggest_category_from_payee
Suggest Category From Payee
boolean
totp_enabled
Totp Enabled
boolean
is_admin
Is Admin
boolean
is_active
Is Active
boolean
Example
{ "user": { "locale": "fr", "base_currency": "EUR", "theme": "ledger", "theme_mode": "light", "offer_rule_on_categorize": false, "tour_seen": false, "setup_checklist_hidden": false, "suggest_category_from_payee": true, "totp_enabled": false, "is_admin": false, "is_active": true }}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}