Get JWT token

Get JWT token

Get a JWT token to authenticate with the API.

POSThttps://studio.edgeimpulse.com/v1/api-login
Body
username*string

Username or e-mail address

Example: "edge-user-01"
password*string

Password

uuidstring

Evaluation user UUID

ssoTypeenum
browsercli
sessionIdstring

Session ID

totpTokenstring

TOTP Token. Required if a user has multi-factor authentication with a TOTP token enabled. If a user has MFA enabled, but no totpToken is submitted; then an error starting with "ERR_TOTP_TOKEN IS REQUIRED" is returned. Use this to then prompt for an MFA token and re-login.

Response

OK

Body
success*boolean

Whether the operation succeeded

errorstring

Optional error description (set if 'success' was false)

tokenstring

JWT token, to be used to log in in the future through JWTAuthentication

redirectUrlstring

Redirect URL to follow to complete login

Request
const response = await fetch('https://studio.edgeimpulse.com/v1/api-login', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "username": "edge-user-01",
      "password": "text"
    }),
});
const data = await response.json();
Response
`{ "success": true, "token": "A372jdhe.ad3r4gfrg" }`

Last updated