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

# Get the current authenticated user, or null when unauthenticated.



## OpenAPI

````yaml /api-reference/portal.v1.json get /api/auth/session
openapi: 3.0.3
info:
  title: Swiss HR Easy — Employee Portal API
  version: 1.0.0
  description: >-
    Versioned contract for the employee self-service portal endpoints consumed
    by the mobile app. Generated from Zod schemas — do not edit by hand (run
    `npm run gen:openapi`).
servers:
  - url: https://{tenantHost}
    description: >-
      Per-tenant deployment host. Swiss HR Easy is single-tenant, so each
      customer install serves this contract from its own host.
security: []
tags:
  - name: profile
    description: Employee profile overview and entitlements.
  - name: leave
    description: Employee leave balances and requests.
  - name: time
    description: Employee time tracking and weekly summaries.
  - name: sick-leave
    description: Employee sick-leave reports and summaries.
  - name: payslips
    description: Employee payslips and deduction breakdowns.
  - name: compensation
    description: The caller's compensation role, salary band and placement rationale.
  - name: auth
    description: Current-session retrieval and logout for the mobile app.
  - name: holidays
    description: >-
      The days behind the vacation day count that cost less than a full day:
      public holidays, school holidays, and Betriebsferien days the caller was
      approved to work through.
paths:
  /api/auth/session:
    get:
      tags:
        - auth
      summary: Get the current authenticated user, or null when unauthenticated.
      operationId: getCurrentSession
      responses:
        '200':
          description: >-
            The current user, or null when the caller has no valid session.
            Returns 200 in both the authenticated and unauthenticated cases.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
components:
  schemas:
    SessionResponse:
      type: object
      properties:
        user:
          nullable: true
          type: object
          properties:
            id:
              type: string
            email:
              type: string
            name:
              type: string
            role:
              type: string
              enum:
                - SUPERADMIN
                - ADMIN
                - HR_STAFF
                - MANAGER
                - SYSTEM_ADMIN
                - PAYROLL_PROVIDER
                - EMPLOYEE
                - APPLICANT
          required:
            - id
            - email
            - name
            - role
          additionalProperties: false
      required:
        - user
      additionalProperties: false

````