Skip to content

POST   /auth/login

Login using email and password

Authenticates a user with email and password credentials and returns a session token

Request Body

{
"email": "string",
"password": "string"
}

Try it out

Loading...

Output:

Responses

Description

Login successful

{
"id": 0,
"email": "string",
"createdBy": "string",
"updatedBy": "string",
"createdAt": "string",
"updatedAt": "string",
"primaryAccount": {
"accountId": "string",
"accountName": "string",
"usersPrimaryAccount": false,
"accountAdmin": false
},
"accounts": [
{
"accountId": "string",
"accountName": "string",
"usersPrimaryAccount": false,
"accountAdmin": false
}
],
"flatRolesList": [
"string"
],
"flatPermissionsList": [
"string"
],
"token": "string"
}

References

#/components/schemas/UserSession

type: object
required:
- id
- email
- token
- id
- email
properties:
id:
type: integer
description: User ID
email:
type: string
format: email
description: User's email address
createdBy:
type: string
description: Email of the user who created this user
updatedBy:
type: string
description: Email of the user who last updated this user
createdAt:
type: string
format: date-time
description: Creation timestamp
updatedAt:
type: string
format: date-time
description: Last update timestamp
primaryAccount:
type: object
properties:
accountId:
type: string
accountName:
type: string
usersPrimaryAccount:
type: boolean
accountAdmin:
type: boolean
accounts:
type: array
description: List of accounts the user has access to
items:
type: object
properties:
accountId:
type: string
accountName:
type: string
usersPrimaryAccount:
type: boolean
accountAdmin:
type: boolean
flatRolesList:
type: array
description: List of user roles
items:
type: string
flatPermissionsList:
type: array
description: List of user permissions
items:
type: string
token:
type: string
description: JWT session token for authentication

#/components/schemas/Error

type: object
properties:
error:
type: string
description: Error message
status:
type: integer
description: HTTP status code
message:
type: string
description: Detailed error message
description: Error response object
required:
- error

Route Source Code

Check out the source code for this route entrypoint here: /auth/login/route.ts

Or the swagger.yaml spec this documentation was generated from: /auth/login/swagger.yaml