> ## 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 portfolio holdings

> Retrieve portfolio holdings (ISIN, asset, quantity) and target allocation (percentages per asset)



## OpenAPI

````yaml GET /portfolios/{id}
openapi: 3.0.3
info:
  title: Wealthyhood Portfolio API
  version: 1.0.0
  description: >
    Investments screen portfolio endpoints that expose chart prices and return
    metrics.


    All requests require a bearer token with the scopes advertised in the
    primary specification, 

    and must include the `x-user-id` header so the platform can resolve the
    acting investor.
servers:
  - url: https://{host}
    variables:
      host:
        default: api.wealthyhood.com
        description: Wealthyhood API host name.
security:
  - bearerAuth: []
tags:
  - name: Portfolio
    description: >-
      Investments screen data for a single portfolio (prices and performance by
      tenor).
paths:
  /portfolios/{id}:
    get:
      tags:
        - Portfolio
      summary: Get portfolio holdings
      description: >
        Returns a simplified portfolio view with holdings (ISIN, asset,
        quantity), target allocation

        (asset weights as percentages, no ISIN), and timestamps. Use this
        endpoint when you need positions

        and model weights without performance metrics or historical price
        series.
      parameters:
        - $ref: '#/components/parameters/ExternalUserId'
        - $ref: '#/components/parameters/PortfolioId'
      responses:
        '200':
          description: Portfolio holdings with asset details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioHoldings'
              examples:
                sample:
                  summary: Portfolio with holdings
                  value:
                    id: 64f0c51e7fb3fc001234abcd
                    currency: EUR
                    holdings:
                      - isin: US0378331005
                        assetCommonId: equities_apple
                        quantity: 12.5
                      - isin: EU0009658145
                        assetCommonId: etf_vanguard_snp500
                        quantity: 8
                    targetAllocation:
                      - assetCommonId: equities_apple
                        percentage: 40
                      - assetCommonId: etf_vanguard_snp500
                        percentage: 60
                    createdAt: '2024-03-01T10:00:00.000Z'
                    updatedAt: '2024-07-10T12:00:00.000Z'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  parameters:
    ExternalUserId:
      name: x-user-id
      in: header
      required: true
      description: MongoDB identifier of the user whose portfolio is being queried.
      schema:
        type: string
        pattern: ^[a-f0-9]{24}$
    PortfolioId:
      name: id
      in: path
      required: true
      description: Portfolio identifier belonging to the authenticated user.
      schema:
        type: string
        pattern: ^[a-f0-9]{24}$
  schemas:
    PortfolioHoldings:
      type: object
      required:
        - id
        - currency
        - holdings
        - targetAllocation
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: Portfolio unique identifier.
        currency:
          type: string
          description: ISO currency code for the portfolio (e.g. EUR, GBP, USD).
        holdings:
          type: array
          description: Array of holdings with asset details and quantities.
          items:
            $ref: '#/components/schemas/Holding'
        targetAllocation:
          type: array
          description: >-
            Target allocation by asset. Weights are persisted with the
            portfolio. May be an empty array when unset.
          items:
            $ref: '#/components/schemas/TargetAllocationItem'
        createdAt:
          type: string
          format: date-time
          description: Portfolio creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp.
      additionalProperties: false
    Holding:
      type: object
      required:
        - isin
        - assetCommonId
        - quantity
      properties:
        isin:
          type: string
          description: International Securities Identification Number (ISIN) for the asset.
        assetCommonId:
          type: string
          description: Wealthyhood internal asset identifier.
        quantity:
          type: number
          format: double
          description: Number of shares/units held.
    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 (weights for active
            assets sum to 100 when a target is configured).
      additionalProperties: false
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: integer
        error:
          type: object
          properties:
            message:
              type: string
            description:
              type: string
              nullable: true
        responseId:
          type: string
          format: uuid
      additionalProperties: false
  responses:
    UnauthorizedError:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 401
            error:
              message: User not found
            responseId: 56962f31-e1bc-4a32-8b47-623f793aa2f8
    ForbiddenError:
      description: >-
        Authenticated user cannot access the requested portfolio or lacks
        scopes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 403
            error:
              message: Portfolio does not belong to user
            responseId: 1c8b2106-5f8f-4f71-8f06-23a53205b384
    NotFoundError:
      description: Portfolio or related resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 404
            error:
              message: Portfolio not found
            responseId: 77354fbd-2d0a-4f5a-8e15-a64c2b7ac3b5
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Auth0-issued access token that includes the scopes listed for the route.

````