POST
/api/public/generatetokenGenerate an access token with username and password
Authenticates a user with a username and password and generates a JWT access token. Supply non-empty username and password values; include otp when required for the account's authentication flow. The successful response contains the token and its type.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Credentials and any additional one-time password required to authenticate the user.
otpstringoptional
A one-time password for accounts that require an additional authentication factor.
passwordstringrequired
The user's password; must contain at least one character.
usernamestringrequired
The user's username; must contain at least one character.
200Returns an object containing the generated `accessToken` and the token type.
accessTokenstringoptional
tokenTypestringoptional
400Returned when the request is invalid or required credentials are missing.
codestringrequired
paramsarray<object>optional
401Returned when the credentials or authentication details are not accepted.
codestringrequired
paramsarray<object>optional
403Returned when access to the requested operation is forbidden.
codestringrequired
paramsarray<object>optional
404Returned when a requested resource was not found.
codestringrequired
paramsarray<object>optional
Error handling
A 400 indicates an invalid request, a 401 indicates that the credentials or authentication details were not accepted, and a 403 indicates forbidden access. A 404 indicates that a requested resource was not found. The body must include non-empty username and password values; provide otp when the authentication flow requires it.