Skip to content

GET   /auth/session

Get current user session

Retrieves information about the currently authenticated user's session

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Try it out

Loading...

Output:

Responses

Description

Current user session retrieved successfully

{
"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/session/route.ts

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