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"}Description
Unauthorized - not authenticated
{ "error": "string", "status": 0, "message": "string"}Description
Internal server error
{ "error": "string", "status": 0, "message": "string"}References
#/components/schemas/UserSession
type: objectrequired: - id - email - token - id - emailproperties: 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|export interface UserSession { /** User ID */ id: number; /** User's email address */ email: string; /** Email of the user who created this user */ createdBy?: string; /** Email of the user who last updated this user */ updatedBy?: string; /** Creation timestamp */ createdAt?: Date; /** Last update timestamp */ updatedAt?: Date; primaryAccount?: { accountId?: string; accountName?: string; usersPrimaryAccount?: boolean; accountAdmin?: boolean; }; /** List of accounts the user has access to */ accounts?: { accountId?: string; accountName?: string; usersPrimaryAccount?: boolean; accountAdmin?: boolean; }[]; /** List of user roles */ flatRolesList?: string[]; /** List of user permissions */ flatPermissionsList?: string[]; /** JWT session token for authentication */ token: string;}#/components/schemas/Error
type: objectproperties: error: type: string description: Error message status: type: integer description: HTTP status code message: type: string description: Detailed error messagedescription: Error response objectrequired: - error|export interface Error { /** Error message */ error: string; /** HTTP status code */ status?: number; /** Detailed error message */ message?: string;}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