login
# login
POST
/auth/login
const url = 'http://localhost:8080/api/v1/auth/login';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"username":"example","password":"example","client":"web","deviceName":"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 http://localhost:8080/api/v1/auth/login \ --header 'Content-Type: application/json' \ --data '{ "username": "example", "password": "example", "client": "web", "deviceName": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
username
required
string
password
required
string
client
required
string
deviceName
string
Responses
Section titled “Responses”Logged in. Web clients get a cookie; device clients get a token.
Media typeapplication/json
object
member
required
object
id
required
string
username
required
string
displayName
required
string
role
required
string
theme
required
string
textScale
required
number
reducedMotion
required
boolean
shareVisits
boolean
showAiSummaries
boolean
avatar
createdAt
required
string format: date-time
csrfToken
Web clients only.
string
deviceToken
Device clients only. Shown once.
string
Examples
Exampleseed
Derived from fixtures/seed.json.
{ "deviceToken": "hsd_demoDeviceToken0123456789abcdef", "member": { "avatar": null, "createdAt": "2026-10-07T09:00:00.000Z", "displayName": "Ben", "id": "mem_01j9706wfq8em7agb270vat3vp", "lastSeenAt": null, "locale": "zh-Hans", "reducedMotion": false, "role": "member", "shareVisits": false, "showAiSummaries": true, "textScale": 1, "theme": "system", "username": "ben" }}Missing or invalid credentials.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}Too many requests. See Retry-After.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}Headers
Section titled “Headers”Retry-After
integer