Herald
OpenapiAuth

Authenticate user with email/username and password

Supports both email and username login. Returns a session token or requires TOTP verification if two-factor authentication is enabled for the user.

POST
/api/auth/{realmId}/login

Supports both email and username login. Returns a session token or requires TOTP verification if two-factor authentication is enabled for the user.

Path Parameters

realmId*string

Realm ID

Request Body

application/json
  1. body
agreements?array<>|null
clientId*string
email?string|null
oauthClientId?string|null
password*string
redirectUri?string|null
state?string|null
turnstileToken?string|null
username?string|null

Response Body

Successful login.

application/json
  1. response
accessToken*string
expiresIn*integer
Formatint64
Range0 <= value
refreshExpiresIn*integer
Formatint64
Range0 <= value
refreshToken*string
tokenType*string
Example Request
curl -X POST 'https://example.com/api/auth/string/login' \
  -H 'Content-Type: application/json' \
  -d '{
  "clientId": "string",
  "password": "string"
}'
Example Response
{
  "accessToken": "string",
  "expiresIn": 0,
  "refreshExpiresIn": 0,
  "refreshToken": "string",
  "tokenType": "string"
}