Skip to content

Local Login Token

POST
/auth/login/token
curl --request POST \
--url https://example.com/auth/login/token \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "password": "example", "totp_code": "example", "device_name": "example" }'

Authenticate with email/password and return an API token (mobile-friendly).

Unlike POST /auth/login which sets HTTP-only cookies, this endpoint returns the token in the JSON body so native mobile clients can store it securely. Creates a long-lived API token (ptr_*) for the authenticated user.

Media typeapplication/json
LoginRequest
object
email
required
Email
string format: email
password
required
Password
string
<= 1024 characters
totp_code
Any of:
string
<= 32 characters
device_name
Any of:
string
<= 100 characters

Example generated

{
"email": "hello@example.com",
"password": "example",
"totp_code": "example",
"device_name": "example"
}

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
email
required
Any of:
string
name
required
Any of:
string
locale
Locale
string
default: fr
base_currency
Base Currency
string
default: EUR
theme
Theme
string
default: ledger
theme_mode
Theme Mode
string
default: light
date_format
Any of:
string
number_format
Any of:
string
font_size
Any of:
string
density
Any of:
string
report_frequency
Any of:
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
default: true
custom_css
Any of:
string
missing_rates_dismissed
Any of:
string
totp_enabled
Totp Enabled
boolean
is_admin
Is Admin
boolean
is_active
Is Active
boolean
default: true

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>
ValidationError
object
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": {}
}
]
}