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

# Get current user

> Retrieve the current authenticated user with complete profile information, portfolio, address, and tax residency details.



## OpenAPI

````yaml GET /users/me
openapi: 3.0.3
info:
  title: Wealthyhood Users API
  version: 1.0.0
  description: >
    User management endpoints for creating and managing user accounts in the
    Wealthyhood platform.


    All requests require a bearer access token with the advertised scopes, and
    must include 

    appropriate authentication headers.
servers:
  - url: https://{host}
    variables:
      host:
        default: api.wealthyhood.com
        description: Wealthyhood API host name.
security:
  - bearerAuth: []
tags:
  - name: Users
    description: Create and manage user accounts.
paths:
  /users/me:
    get:
      tags:
        - Users
      summary: Get current user
      description: >
        Retrieve the current authenticated B2B user with complete profile
        information, portfolio holdings,

        target allocation, address, and tax residency details. This endpoint
        requires authentication via Bearer token and 

        the `x-user-id` header to identify the user.
      operationId: getCurrentUser
      parameters:
        - name: x-user-id
          in: header
          required: true
          description: MongoDB ObjectId of the authenticated user
          schema:
            type: string
            pattern: ^[a-f0-9]{24}$
          example: 64f0c51e7fb3fc001234a001
      responses:
        '200':
          description: User retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserResponse'
              example:
                id: 64f0c51e7fb3fc001234a001
                email: john.doe@example.com
                firstName: John
                lastName: Doe
                dateOfBirth: '1990-05-15'
                residencyCountry: GR
                language: en
                portfolios:
                  - id: 64f0c51e7fb3fc001234def0
                    currency: EUR
                    holdings:
                      - isin: US0378331005
                        assetCommonId: equities_apple
                        quantity: 12.5
                    targetAllocation:
                      - assetCommonId: equities_apple
                        percentage: 100
                    createdAt: '2024-03-01T10:00:00.000Z'
                    updatedAt: '2024-07-10T12:00:00.000Z'
                address:
                  line1: 15 Ermou Street
                  line2: Apartment 4B
                  city: Athens
                  postalCode: 10563
                  countryCode: GR
                taxResidency:
                  countryCode: GR
                  proofType: TIN
                  value: '123456789'
                createdAt: '2024-10-03T10:30:00Z'
                updatedAt: '2024-10-03T10:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    GetUserResponse:
      type: object
      required:
        - id
        - email
        - portfolios
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: MongoDB ObjectId of the user
          pattern: ^[a-f0-9]{24}$
          example: 64f0c51e7fb3fc001234a001
        email:
          type: string
          format: email
          example: john.doe@example.com
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        dateOfBirth:
          type: string
          format: date
          example: '1990-05-15'
        residencyCountry:
          type: string
          example: GR
        language:
          type: string
          description: >-
            User's preferred language. Valid values are "en" (English) or "el"
            (Greek).
          enum:
            - en
            - el
          example: en
        portfolios:
          type: array
          description: Array of user's portfolios with holdings and target allocation
          items:
            $ref: '#/components/schemas/PortfolioHoldings'
        address:
          type: object
          properties:
            line1:
              type: string
            line2:
              type: string
            city:
              type: string
            postalCode:
              type: string
            countryCode:
              type: string
        taxResidency:
          type: object
          properties:
            countryCode:
              type: string
              description: Two-letter ISO country code for tax residency
            proofType:
              type: string
              description: >-
                Type of tax identification. Valid values are "NINO" (for UK) or
                "TIN" (for all other countries).
              enum:
                - NINO
                - TIN
            value:
              type: string
              description: Tax identification number
        nationalities:
          type: array
          description: >-
            Array of two-letter ISO country codes for user's nationality
            (citizenship)
          items:
            type: string
            pattern: ^[A-Z]{2}$
          example:
            - GR
        employmentInfo:
          type: object
          description: Employment and source of wealth information (optional)
          properties:
            incomeRangeId:
              type: string
              description: >
                ID of the income range (1-10). 1=€0-€10k | 2=€10k-€20k |
                3=€20k-€30k | 4=€30k-€50k |

                5=€50k-€75k | 6=€75k-€100k | 7=€100k-€150k | 8=€150k-€250k |
                9=€250k-€500k | 10=€500k+
            employmentStatus:
              type: string
            sourcesOfWealth:
              type: array
              items:
                type: string
            industry:
              type: string
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the user was created
          example: '2024-10-03T10:30:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the user was last updated
          example: '2024-10-03T10:30:00Z'
    PortfolioHoldings:
      type: object
      description: User's portfolio with holdings, target allocation, and timestamps
      required:
        - id
        - currency
        - holdings
        - targetAllocation
      properties:
        id:
          type: string
          description: Portfolio unique identifier
          example: 64f0c51e7fb3fc001234def0
        currency:
          type: string
          description: ISO currency code for the portfolio (e.g. EUR, GBP, USD)
          example: EUR
        holdings:
          type: array
          description: Array of holdings with asset details and quantities
          items:
            type: object
            required:
              - isin
              - assetCommonId
              - quantity
            properties:
              isin:
                type: string
                description: >-
                  International Securities Identification Number (ISIN) for the
                  asset
                example: US0378331005
              assetCommonId:
                type: string
                description: Wealthyhood internal asset identifier
                example: equities_apple
              quantity:
                type: number
                format: double
                description: Number of shares/units held
                example: 12.5
        targetAllocation:
          type: array
          description: Target allocation by asset. Empty when unset.
          items:
            $ref: '#/components/schemas/TargetAllocationItem'
        createdAt:
          type: string
          format: date-time
          description: Portfolio creation timestamp
          example: '2024-03-01T10:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2024-07-10T12:00:00.000Z'
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message
            description:
              type: string
              description: Additional error details
              nullable: true
        responseId:
          type: string
          format: uuid
          description: Unique identifier for this error response
      additionalProperties: false
    TargetAllocationItem:
      type: object
      required:
        - assetCommonId
        - percentage
      properties:
        assetCommonId:
          type: string
          description: Wealthyhood internal asset identifier
        percentage:
          type: number
          format: double
          description: Target allocation percentage for the asset
      additionalProperties: false
  responses:
    BadRequestError:
      description: Validation failure or business rule violation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          examples:
            invalidEmail:
              summary: Invalid email format
              value:
                status: 400
                error:
                  message: Invalid email address format
                responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
            missingFields:
              summary: Missing required fields
              value:
                status: 400
                error:
                  message: 'Missing required fields: firstName, lastName'
                responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
            addressCountryMismatch:
              summary: Address country code mismatch
              value:
                status: 400
                error:
                  message: Address countryCode must match residencyCountry
                responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
    UnauthorizedError:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 401
            error:
              message: Unauthorized - Invalid or missing authentication token
            responseId: 145f2b0d-1d5b-4e91-8d0d-7af0ae9ad13a
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Auth0-issued access token that includes the scopes listed for the
        endpoint.

````