> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rootprint.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the current session

> Get the current session



## OpenAPI

````yaml /api/openapi.json get /api/auth/get-session
openapi: 3.1.0
info:
  description: HTTP API for the Rootprint log management platform.
  title: Rootprint API
  version: 0.3.4
servers:
  - description: Rootprint API
    url: https://example.com
security:
  - cookieAuth: []
paths:
  /api/auth/get-session:
    get:
      tags:
        - Authentication
      summary: Get the current session
      description: Get the current session
      operationId: getSession
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  session:
                    $ref: '#/components/schemas/Session'
                  user:
                    $ref: '#/components/schemas/User'
                required:
                  - session
                  - user
                type:
                  - object
                  - 'null'
          description: Success
        '400':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: >-
            Bad Request. Usually due to missing parameters, or invalid
            parameters.
        '401':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: Unauthorized. Due to missing or invalid authentication.
        '403':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >-
            Forbidden. You do not have permission to access this resource or to
            perform this action.
        '404':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: Not Found. The requested resource was not found.
        '429':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >-
            Too Many Requests. You have exceeded the rate limit. Try again
            later.
        '500':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >-
            Internal Server Error. This is a problem with the server that you
            cannot fix.
      security:
        - bearerAuth: []
components:
  schemas:
    Session:
      properties:
        createdAt:
          default: Generated at runtime
          format: date-time
          type: string
        expiresAt:
          format: date-time
          type: string
        id:
          type: string
        impersonatedBy:
          readOnly: true
          type: string
        ipAddress:
          type: string
        token:
          type: string
        updatedAt:
          format: date-time
          type: string
        userAgent:
          type: string
        userId:
          type: string
      required:
        - expiresAt
        - token
        - createdAt
        - updatedAt
        - userId
      type: object
    User:
      properties:
        banExpires:
          format: date-time
          readOnly: true
          type: string
        banReason:
          readOnly: true
          type: string
        banned:
          default: false
          readOnly: true
          type: boolean
        createdAt:
          default: Generated at runtime
          format: date-time
          type: string
        email:
          type: string
        emailVerified:
          default: false
          readOnly: true
          type: boolean
        id:
          type: string
        image:
          type: string
        name:
          type: string
        role:
          readOnly: true
          type: string
        updatedAt:
          default: Generated at runtime
          format: date-time
          type: string
      required:
        - name
        - email
        - createdAt
        - updatedAt
      type: object
  securitySchemes:
    cookieAuth:
      in: cookie
      name: better-auth.session_token
      type: apiKey
    bearerAuth:
      description: Bearer token authentication
      scheme: bearer
      type: http

````