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

# Get the current session

> Returns the session object if the user is authenticated.



## OpenAPI

````yaml https://us-west-2.api.thenile.dev/v2/openapi get /v2/databases/{database}/auth/session
openapi: 3.0.0
info:
  title: Nile auth API
  version: '0.1'
servers: []
security: []
tags: []
paths:
  /v2/databases/{database}/auth/session:
    get:
      tags:
        - auth
      summary: Get the current session
      description: Returns the session object if the user is authenticated.
      parameters:
        - $ref: '#/components/parameters/database'
      responses:
        '200':
          description: The current session
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      name:
                        type: string
                        example: User Name
                      email:
                        type: string
                        format: email
                        example: user@example.com
                      image:
                        type: string
                        format: uri
                        example: https://example.com/user.png
                  expires:
                    type: string
                    format: date-time
                    example: '2024-07-16T19:20:30.450Z'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
components:
  parameters:
    database:
      name: database
      in: path
      required: true
      schema:
        type: string
      description: The string (id or name, depending on the credentials)

````