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

# Get current user information

> Returns the authenticated user along with every organization they belong to and their roles in each.




## OpenAPI

````yaml /openapi/openapi.yaml get /whoami
openapi: 3.0.3
info:
  title: Albus API
  description: Albus service REST API
  version: 1.0.0
servers:
  - url: https://albus.sh/api
    description: Production server
  - url: http://localhost:8080
    description: Local development server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Auth
    description: Identify the authenticated user.
  - name: Health
    description: Check service availability.
  - name: Secrets
    description: Manage secrets available to agent sessions.
  - name: Sessions
    description: Run and inspect agent sessions.
  - name: Tokens
    description: Manage organization API keys.
paths:
  /whoami:
    get:
      tags:
        - Auth
      summary: Get current user information
      description: >
        Returns the authenticated user along with every organization they belong
        to and their roles in each.
      operationId: whoami
      responses:
        '200':
          description: User information retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
        '401':
          description: Unauthorized - invalid or missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
      security:
        - bearerAuth: []
components:
  schemas:
    WhoamiResponse:
      type: object
      required:
        - user_id
        - email
        - organizations
      properties:
        user_id:
          type: string
          description: Unique user identifier
          example: user_123
        email:
          type: string
          format: email
          description: User's email address
          example: user@example.com
        name:
          type: string
          description: User's display name
          example: John Doe
        roles:
          type: array
          items:
            type: string
          description: >
            Roles in the active organization (present only when a single
            organization is in scope).
          example:
            - admin
        active_organization:
          allOf:
            - $ref: '#/components/schemas/OrganizationMembership'
          description: >
            The organization this session is scoped to. Present when the user
            belongs to exactly one organization; absent when they belong to
            several and none is selected yet.
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMembership'
          description: Every organization the user belongs to, with their roles.
        issued_at:
          type: integer
          format: int64
          description: Token issue timestamp (Unix epoch)
        expires_at:
          type: integer
          format: int64
          description: Token expiration timestamp (Unix epoch)
    ErrUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message
          example: Invalid or expired token
    OrganizationMembership:
      type: object
      required:
        - id
        - name
        - roles
      properties:
        id:
          type: string
          description: Organization identifier
          example: '42'
        name:
          type: string
          description: Organization display name
          example: Acme Corp
        roles:
          type: array
          items:
            type: string
          description: Roles the user holds in this organization
          example:
            - admin
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: http
      scheme: bearer
      description: Org-scoped API key issued via POST /tokens

````