> ## 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 the authenticated caller

> Returns the caller a credential authenticates: a signed-in user with every organization they belong to and their roles in each, or the API key that signed the request, along with the organization it acts in.




## 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: []
  - apiKey: []
tags:
  - name: Agents
    description: Inspect the agents that have run in your organization.
  - name: Auth
    description: Identify the authenticated user.
  - name: Health
    description: Check service availability.
  - name: Memories
    description: Read and delete what your agents remember.
  - name: Models
    description: Discover the models available to run agents on.
  - name: Secrets
    description: Manage secrets available to agent sessions.
  - name: Sessions
    description: Run and inspect agent sessions.
  - name: Tokens
    description: Manage organization API keys.
  - name: Traces
    description: Find your agent invocations and read what they did.
paths:
  /whoami:
    get:
      tags:
        - Auth
      summary: Get the authenticated caller
      description: >
        Returns the caller a credential authenticates: a signed-in user with
        every organization they belong to and their roles in each, or the API
        key that signed the request, along with the organization it acts in.
      operationId: whoami
      responses:
        '200':
          description: OK
          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: []
        - apiKey: []
components:
  schemas:
    WhoamiResponse:
      type: object
      description: >
        The caller a credential authenticates. Exactly one of user or api_key is
        present.
      properties:
        user:
          allOf:
            - $ref: '#/components/schemas/AuthenticatedUser'
          description: The signed-in user, when calling with a user session.
        api_key:
          allOf:
            - $ref: '#/components/schemas/AuthenticatedApiKey'
          description: The API key, when calling with an API key.
    ErrUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message
          example: Invalid or expired token
    AuthenticatedUser:
      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)
    AuthenticatedApiKey:
      type: object
      required:
        - name
        - organization_id
      properties:
        name:
          type: string
          description: Display name of the API key (e.g. "ci-deploy").
        organization_id:
          type: string
          description: The organization this key acts in.
          example: '42'
    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
    apiKey:
      type: http
      scheme: bearer
      description: Org-scoped API key issued via POST /tokens

````