Fahrtenbuch

Auth

GET
/auth/methods

TOTP und Passkeys lassen sich serverweit per TOTP_ENABLED bzw. PASSKEYS_ENABLED abschalten. Abgeschaltet antworten die zugehörigen Endpunkte mit 403 (TOTP_DISABLED / PASSKEYS_DISABLED), und bei der Anmeldung wird ein eingerichtetes TOTP nicht abgefragt.

Response Body

Verfügbare Anmeldeverfahren

application/json
  1. response
password*boolean
totp*boolean
passkeys*boolean
oauthProviders*array<>
Example Request
curl -X GET 'https://example.com/api/v1/auth/methods'
Example Response200
{  "password": true,  "totp": true,  "passkeys": true,  "oauthProviders": [    "google"  ]}

Log in

POST
/auth/login

Request Body

application/json
  1. body
identifier*string
password*string
Formatpassword
totpCode?|
Match^[0-9]{6}$
deviceName?string|null

Response Body

Erfolgreich angemeldet

application/json
  1. response
accessToken*string
refreshToken*string
expiresIn*integer
tokenType?string
user*
Example Request
curl -X POST 'https://example.com/api/v1/auth/login' \  -H 'Content-Type: application/json' \  -d '{  "identifier": "string",  "password": "pa$$word"}'
Example Response
{  "accessToken": "string",  "refreshToken": "string",  "expiresIn": 0,  "tokenType": "Bearer",  "user": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "email": "user@example.com",    "loginName": "string",    "displayName": "string",    "firstName": "string",    "lastName": "string",    "role": "user",    "status": "active",    "locale": "de",    "timezone": "Europe/Berlin",    "themeMode": "light",    "totpEnabled": true,    "totpRequired": true,    "passkeyEnabled": true,    "hasPassword": true,    "forcePasswordChange": true,    "onboardingCompleted": true,    "lastLoginAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}

Refresh access token

POST
/auth/refresh

Request Body

application/json
  1. body
refreshToken*string

Response Body

Neue Tokens

application/json
  1. response
accessToken*string
refreshToken*string
expiresIn*integer
tokenType?string
Example Request
curl -X POST 'https://example.com/api/v1/auth/refresh' \  -H 'Content-Type: application/json' \  -d '{  "refreshToken": "string"}'
Example Response200
{  "accessToken": "string",  "refreshToken": "string",  "expiresIn": 0,  "tokenType": "Bearer"}
POST
/auth/logout

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Response Body

Abgemeldet

Example Request
curl -X POST 'https://example.com/api/v1/auth/logout'
Example Response204
Empty

Log out of all sessions

POST
/auth/logout-all

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Response Body

Alle Sitzungen widerrufen

Example Request
curl -X POST 'https://example.com/api/v1/auth/logout-all'
Example Response204
Empty

Request password reset

POST
/auth/password/forgot

Request Body

application/json
  1. body
email*string
Formatemail

Response Body

Anfrage angenommen

Example Request
curl -X POST 'https://example.com/api/v1/auth/password/forgot' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com"}'
Example Response202
Empty

Reset password

POST
/auth/password/reset

Request Body

application/json
  1. body
token*string
password*string
Formatpassword
Length8 <= length

Response Body

Passwort geändert

Example Request
curl -X POST 'https://example.com/api/v1/auth/password/reset' \  -H 'Content-Type: application/json' \  -d '{  "token": "string",  "password": "pa$$word"}'
Example Response200
Empty