login
POST
/api/v1/auth/login
const url = 'https://example.com/api/v1/auth/login';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"username":"example","password":"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 https://example.com/api/v1/auth/login \ --header 'Content-Type: application/json' \ --data '{ "username": "example", "password": "example" }'Rate-limited. Exchange an enrolled account’s credentials for a dashboard session.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
username
required
string
password
required
string
Examplegenerated
{ "username": "example", "password": "example"}Responses
Section titled “ Responses ”Signed in, or a multi-factor challenge when the account has a confirmed second factor. A challenge sets no session cookie.
Media typeapplication/json
object
data
required
One of:
object
user
required
object
id
required
string format: uuid
name
required
string
username
required
string
role
required
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
string
active
required
boolean
createdAt
required
string format: date-time
lastLoginAt
string format: date-time
capabilities
Effective capabilities of the signed-in user’s role.
Array<string>
csrfToken
required
string
authMethod
required
string
mfaEnrollmentRequired
required
boolean
object
mfaRequired
required
boolean
challengeToken
required
string
methods
required
Array<string>
Example
{ "data": { "user": { "role": "owner" }, "authMethod": "password" }}Invalid credentials