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

# Get portfolio detail

> Returns portfolio with full holdings, P&L, linked strategy details, performance metrics, and agent scorecard.

Operation ID: get__portfolios_id_.



## OpenAPI

````yaml /openapi/itoflow-public.openapi.json get /portfolios/{id}
openapi: 3.1.0
info:
  description: >-
    All Itoflow APIs are experimental and may change without notice. Read-only
    operations marked interactive can be tried from the documentation; the
    others are reference-only.
  title: Itoflow Developer API
  version: 1.0.0
servers:
  - description: Itoflow API
    url: https://api.itoflow.ai
security: []
tags:
  - name: Account
  - name: Billing
  - name: Brokers
  - name: Chat
  - name: Connected MCP servers
  - name: GitHub
  - name: Market data
  - name: Monitors
  - name: Notifications
  - name: Portfolios
  - name: Risk runs
  - name: Sharing and data
  - name: Strategies
paths:
  /portfolios/{id}:
    get:
      tags:
        - Portfolios
      summary: Get portfolio detail
      description: >-
        Returns portfolio with full holdings, P&L, linked strategy details,
        performance metrics, and agent scorecard.


        Operation ID: get__portfolios_id_.
      operationId: get__portfolios_id_
      parameters:
        - description: Resource UUID
          in: path
          name: id
          required: true
          schema:
            description: Resource UUID
            example: 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - in: query
          name: factor_as_of
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - format: date-time
                type: string
        - in: query
          name: factor_model_version
          required: false
          schema:
            maxLength: 200
            minLength: 1
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioDetailResponse'
          description: Portfolio detail with holdings and metrics
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid portfolio ID
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Ownership required
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Portfolio not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Server error
      security:
        - bearerAuth: []
components:
  schemas:
    PortfolioDetailResponse:
      properties:
        exited_holdings:
          items:
            $ref: '#/components/schemas/ExitedHolding'
          type: array
        factorScorecard:
          $ref: '#/components/schemas/PortfolioFactorScorecard'
        first_broker_snapshot_pending:
          type: boolean
        holdings:
          items:
            $ref: '#/components/schemas/Holding'
          type: array
        linked_strategy:
          additionalProperties: {}
          description: Full strategy object if linked
          type:
            - object
            - 'null'
        live_broker_state:
          $ref: '#/components/schemas/LiveBrokerState'
        metrics:
          $ref: '#/components/schemas/PortfolioMetrics'
        pnl_metrics:
          $ref: '#/components/schemas/PnLMetrics'
        portfolio:
          properties:
            benchmarkIndexId:
              description: >-
                Provider index id (for example GSPC.INDX) used as the comparison
                basis for benchmark-relative factor risk
              type:
                - string
                - 'null'
            broker_type:
              type:
                - string
                - 'null'
            created_at:
              type: string
            description:
              type:
                - string
                - 'null'
            execution_mode:
              type: string
            holdings:
              description: Always empty — see top-level holdings field
              items:
                $ref: '#/components/schemas/Holding'
              type: array
            is_active:
              type: boolean
            linkedAt:
              type:
                - string
                - 'null'
            linkedStrategyId:
              format: uuid
              type:
                - string
                - 'null'
            linkType:
              type:
                - string
                - 'null'
            name:
              type: string
            peerPortfolioId:
              description: >-
                Another portfolio on the platform this portfolio is measured
                against for benchmark-relative factor risk
              format: uuid
              type:
                - string
                - 'null'
            portfolio_id:
              format: uuid
              type: string
            portfolio_type:
              type: string
            updated_at:
              type: string
            user_email:
              type: string
          required:
            - portfolio_id
            - user_email
            - name
            - description
            - created_at
            - updated_at
            - is_active
            - holdings
            - linkedStrategyId
            - linkType
            - linkedAt
            - peerPortfolioId
            - benchmarkIndexId
            - portfolio_type
            - execution_mode
            - broker_type
          type: object
        portfolio_value:
          description: >-
            Original reviewed import value; null for portfolios without this
            provenance. Current value is in metrics.
          properties:
            amount_usd:
              description: Reviewed portfolio capital value in USD at import.
              type: string
            as_of_date:
              description: Source or provider mark date; not the import timestamp.
              type:
                - string
                - 'null'
            basis:
              description: >-
                Fund total NAV is present only for an explicitly reviewed,
                verified single-ETF import.
              enum:
                - portfolio_value
                - fund_total_nav
              type: string
            declared_amount:
              description: >-
                Stated value in declared_currency, as reviewed; null when
                provider prices set the value.
              type:
                - string
                - 'null'
            declared_currency:
              description: >-
                Currency of declared_amount; null when provider prices set the
                value.
              type:
                - string
                - 'null'
            source:
              enum:
                - provider_derived
                - user_declared
                - source_document
              type: string
          required:
            - amount_usd
            - as_of_date
            - basis
            - declared_amount
            - declared_currency
            - source
          type:
            - object
            - 'null'
        price_updated_at:
          type:
            - string
            - 'null'
        scorecard:
          $ref: '#/components/schemas/AgentScorecard'
        scorecard_input_dates:
          $ref: '#/components/schemas/PortfolioFactorScorecardInputDates'
        valuation_unavailable_reason:
          type:
            - string
            - 'null'
        valuationError:
          properties:
            code:
              enum:
                - PORTFOLIO_VALUE_NOT_POSITIVE
                - PORTFOLIO_VALUE_UNKNOWN
              type: string
            message:
              type: string
          required:
            - code
            - message
          type:
            - object
            - 'null'
      required:
        - portfolio_value
        - portfolio
        - holdings
        - exited_holdings
        - metrics
        - valuation_unavailable_reason
        - valuationError
        - pnl_metrics
        - linked_strategy
        - price_updated_at
        - scorecard
        - factorScorecard
      type: object
    Error:
      properties:
        available:
          description: Optional available amount or value
          type: string
        billing_action:
          $ref: '#/components/schemas/BillingAction'
        code:
          description: Machine-readable error code
          type: string
        currentVersion:
          description: Current server-side version, when relevant
          type: number
        details:
          description: Optional structured error details
        error:
          description: Error type or code
          type: string
        expectedVersion:
          description: Client-provided expected version, when relevant
          type: number
        message:
          description: Human-readable error message
          type: string
        requested:
          description: Optional requested amount or value
          type: string
        usage:
          description: Optional usage metadata for limit errors
      required:
        - error
      type: object
    ExitedHolding:
      allOf:
        - $ref: '#/components/schemas/Holding'
        - properties:
            is_exited:
              enum:
                - true
              type: boolean
            realized_pnl:
              type:
                - string
                - 'null'
            realized_pnl_pct:
              type:
                - string
                - 'null'
          required:
            - realized_pnl
            - realized_pnl_pct
            - is_exited
          type: object
    PortfolioFactorScorecard:
      properties:
        asOf:
          type: string
        benchmarkRelative:
          $ref: '#/components/schemas/PortfolioBenchmarkRelativeFactorScorecard'
        coverage:
          $ref: '#/components/schemas/PortfolioFactorCoverage'
        currency:
          type: string
        diagnostics:
          $ref: '#/components/schemas/PortfolioFactorDiagnostics'
        exposures:
          items:
            $ref: '#/components/schemas/PortfolioFactorExposure'
          type: array
        holdings:
          description: >-
            Per-holding risk contributions, ranked by absolute total risk
            contribution share and capped at 100 rows.
          items:
            $ref: '#/components/schemas/PortfolioFactorHolding'
          type: array
        holdingsTotal:
          description: Modeled symbol count before the persisted holding cap.
          type: integer
        holdingsTruncated:
          description: True when holdings carries only the top-ranked slice.
          type: boolean
        modelVersion:
          type: string
        portfolioId:
          type: string
        residualDiagnostics:
          $ref: '#/components/schemas/PortfolioResidualDiagnostics'
        risk:
          $ref: '#/components/schemas/PortfolioFactorRisk'
        schemaVersion:
          type: number
        view:
          $ref: '#/components/schemas/PortfolioFactorRiskView'
      required:
        - schemaVersion
        - modelVersion
        - asOf
        - portfolioId
        - currency
        - coverage
        - exposures
        - risk
        - diagnostics
      type:
        - object
        - 'null'
    Holding:
      properties:
        companyName:
          type:
            - string
            - 'null'
        cost_basis:
          description: Decimal string
          type:
            - string
            - 'null'
        currency:
          type:
            - string
            - 'null'
        current_price_usd:
          type:
            - string
            - 'null'
        current_value_usd:
          type:
            - string
            - 'null'
        fx_rate_to_usd:
          type:
            - string
            - 'null'
        holding_id:
          format: uuid
          type: string
        portfolio_id:
          format: uuid
          type: string
        price_updated_at:
          type:
            - string
            - 'null'
        quantity:
          description: Decimal string
          type: string
        symbol:
          type: string
        unrealized_pnl:
          type:
            - string
            - 'null'
        unrealized_pnl_pct:
          type:
            - string
            - 'null'
        updated_at:
          type:
            - string
            - 'null'
      required:
        - holding_id
        - portfolio_id
        - symbol
        - quantity
        - cost_basis
        - currency
        - updated_at
        - current_price_usd
        - current_value_usd
        - fx_rate_to_usd
        - price_updated_at
        - unrealized_pnl
        - unrealized_pnl_pct
      type: object
    LiveBrokerState:
      properties:
        availableCash:
          type:
            - string
            - 'null'
        availableCashUsd:
          type:
            - string
            - 'null'
        currency:
          type:
            - string
            - 'null'
        reservedCash:
          type:
            - string
            - 'null'
        reservedCashUsd:
          type:
            - string
            - 'null'
        snapshotAt:
          type:
            - string
            - 'null'
        totalCash:
          type:
            - string
            - 'null'
        totalCashUsd:
          type:
            - string
            - 'null'
        totalEquity:
          type:
            - string
            - 'null'
        totalEquityUsd:
          type:
            - string
            - 'null'
      required:
        - availableCash
        - totalEquity
        - currency
        - snapshotAt
      type:
        - object
        - 'null'
    PortfolioMetrics:
      properties:
        cash:
          type: string
        cumulativeReturn:
          type:
            - string
            - 'null'
        cumulativeReturnReason:
          type:
            - string
            - 'null'
        dailyReturn:
          type:
            - string
            - 'null'
        dailyReturnReason:
          type:
            - string
            - 'null'
        recordedAt:
          type: string
        totalValue:
          type:
            - string
            - 'null'
      required:
        - totalValue
        - cash
        - cumulativeReturn
        - cumulativeReturnReason
        - dailyReturn
        - dailyReturnReason
        - recordedAt
      type:
        - object
        - 'null'
    PnLMetrics:
      properties:
        total_pnl:
          type:
            - string
            - 'null'
        total_pnl_pct:
          type:
            - string
            - 'null'
        total_realized_pnl:
          type:
            - string
            - 'null'
        total_unrealized_pnl:
          type:
            - string
            - 'null'
      required:
        - total_unrealized_pnl
        - total_realized_pnl
        - total_pnl
        - total_pnl_pct
      type:
        - object
        - 'null'
    AgentScorecard:
      properties:
        avgTurnover30d:
          type:
            - number
            - 'null'
        benchmarkSymbol:
          type:
            - string
            - 'null'
        calculatedAt:
          type: string
        calculationSource:
          type: string
        cumulativeReturn:
          type:
            - number
            - 'null'
        cumulativeReturnReason:
          type:
            - string
            - 'null'
        dailyReturn:
          type:
            - number
            - 'null'
        dailyReturnReason:
          type:
            - string
            - 'null'
        hasSufficientData:
          type: boolean
        insight:
          type: string
        maxDrawdown:
          type:
            - number
            - 'null'
        monthlyAlpha:
          type:
            - number
            - 'null'
        overallAlpha:
          type:
            - number
            - 'null'
        sharpe30d:
          type:
            - number
            - 'null'
        sharpeOverall:
          type:
            - number
            - 'null'
        sortino30d:
          type:
            - number
            - 'null'
        volatility:
          type:
            - number
            - 'null'
        weeklyAlpha:
          type:
            - number
            - 'null'
        winRate30d:
          type:
            - number
            - 'null'
      required:
        - cumulativeReturn
        - cumulativeReturnReason
        - dailyReturn
        - dailyReturnReason
        - volatility
        - avgTurnover30d
        - winRate30d
        - weeklyAlpha
        - monthlyAlpha
        - overallAlpha
        - sharpe30d
        - sharpeOverall
        - sortino30d
        - maxDrawdown
        - hasSufficientData
        - insight
        - benchmarkSymbol
        - calculatedAt
        - calculationSource
      type:
        - object
        - 'null'
    PortfolioFactorScorecardInputDates:
      properties:
        holdings_fund_books_peers_and_benchmark_read_by:
          description: >-
            When the worker calculated the card, as an ISO time. Holdings, fund
            books, peers and benchmark constituents are the ones on file then,
            so they can be newer than the model date (factorScorecard.asOf) and
            than a requested factor_as_of. Null when not known: the current card
            stores no calculation time.
          type:
            - string
            - 'null'
        meaning:
          description: >-
            What each date covers: prices and the risk model end at the model
            date; the book is the one on file at the calculation time.
          type: string
      required:
        - holdings_fund_books_peers_and_benchmark_read_by
        - meaning
      type:
        - object
        - 'null'
    BillingAction:
      description: Action that resolves a billing-related rejection
      properties:
        href:
          type: string
        kind:
          enum:
            - upgrade
            - payment_method
            - spending_cap
            - billing
          type: string
        label:
          type: string
      required:
        - href
        - label
        - kind
      type: object
    PortfolioBenchmarkRelativeFactorScorecard:
      properties:
        benchmarkName:
          type: string
        benchmarkSource:
          type: string
        benchmarkSymbol:
          type: string
        coverage:
          $ref: '#/components/schemas/PortfolioFactorCoverage'
        diagnostics:
          $ref: '#/components/schemas/PortfolioFactorDiagnostics'
        exposures:
          items:
            $ref: '#/components/schemas/PortfolioFactorExposure'
          type: array
        risk:
          $ref: '#/components/schemas/PortfolioFactorRisk'
      required:
        - benchmarkSymbol
        - coverage
        - risk
        - exposures
        - diagnostics
      type: object
    PortfolioFactorCoverage:
      properties:
        cashWeight:
          type: string
        grossWeight:
          type:
            - string
            - 'null'
        longWeight:
          type:
            - string
            - 'null'
        modeledWeight:
          type: string
        netWeight:
          type:
            - string
            - 'null'
        positionsModeled:
          type: number
        positionsTotal:
          type: number
        shortWeight:
          type:
            - string
            - 'null'
      type: object
    PortfolioFactorDiagnostics:
      properties:
        cashExcluded:
          type: number
        factorCount:
          type: number
        symbolCount:
          type: number
        warnings:
          items:
            type: string
          type: array
      type: object
    PortfolioFactorExposure:
      properties:
        activeRiskContribution:
          description: Decimal string
          type: string
        exposure:
          description: Decimal string
          type: string
        factorId:
          type: string
        group:
          enum:
            - market
            - country
            - region
            - gics_sector
            - gics_industry_group
            - gics_industry
            - sector
            - style
            - currency
          type: string
        marginalRiskContribution:
          description: Decimal string
          type: string
        name:
          type: string
        proxyScope:
          type:
            - string
            - 'null'
        riskContribution:
          description: Decimal string
          type: string
        varianceContribution:
          description: Decimal string
          type: string
      required:
        - factorId
        - name
        - group
        - proxyScope
        - exposure
      type: object
    PortfolioFactorHolding:
      properties:
        annualizationFactor:
          description: Decimal string
          type: string
        marginalContribution:
          description: Decimal string
          type: string
        specificVarianceShare:
          description: Decimal string
          type: string
        specificVolatility:
          description: Decimal string
          type: string
        symbol:
          type: string
        totalRiskContributionShare:
          description: Decimal string
          type: string
        volatilityConvention:
          description: daily or annualized
          type: string
        weight:
          description: Decimal string
          type: string
      required:
        - symbol
      type: object
    PortfolioResidualDiagnostics:
      properties:
        commonComponentRatioThreshold:
          description: Decimal string
          type: string
        effectiveNumberOfBets:
          description: Decimal string
          type: string
        firstComponentVarianceShare:
          description: Decimal string
          type: string
        meanPairwiseResidualCorrelation:
          description: Decimal string
          type: string
        medianPairwiseResidualCorrelation:
          description: Decimal string
          type: string
        minimumWindowSessions:
          type: integer
        modelSpecificVariance:
          description: Decimal string
          type: string
        realizedResidualVariance:
          description: Decimal string
          type: string
        requestedWindowSessions:
          type: integer
        residualCommonComponentDetected:
          type: boolean
        residualVarianceRatio:
          description: Decimal string
          type: string
        sufficientHistory:
          type: boolean
        symbolsMissing:
          items:
            type: string
          type: array
        symbolsMissingCount:
          type: integer
        symbolsUsed:
          items:
            type: string
          type: array
        symbolsUsedCount:
          type: integer
        warnings:
          items:
            type: string
          type: array
        weightMissing:
          description: Decimal string
          type: string
        weightUsed:
          description: Decimal string
          type: string
        windowSessions:
          type: integer
      type: object
    PortfolioFactorRisk:
      properties:
        activeRiskComplete:
          description: >-
            Benchmark-relative risk only. False when the active risk figures
            leave out part of the active book; diagnostics.warnings names what
            is left out.
          type: boolean
        activeSpecificShare:
          type: string
        activeVariance:
          type: string
        activeVolatility:
          type: string
        annualizationFactor:
          description: >-
            Return periods per year as a decimal string. When
            volatilityConvention is daily, annualize volatility by multiplying
            it by sqrt(annualizationFactor).
          type: string
        factorShare:
          type: string
        factorVariance:
          type: string
        specificRiskContribution:
          type: string
        specificShare:
          type: string
        specificVariance:
          type: string
        totalVariance:
          type: string
        totalVolatility:
          type: string
        volatilityConvention:
          description: >-
            Convention for variance and volatility levels: daily means per daily
            return period; annualized means per year.
          enum:
            - daily
            - annualized
          type: string
      type: object
    PortfolioFactorRiskView:
      properties:
        absoluteRiskRows:
          items:
            $ref: '#/components/schemas/PortfolioFactorRiskViewRow'
          type: array
        benchmarkRelativeRiskRows:
          items:
            $ref: '#/components/schemas/PortfolioFactorRiskViewRow'
          type: array
        coverageSummary:
          $ref: '#/components/schemas/PortfolioFactorRiskCoverageSummary'
        holdingRows:
          items:
            $ref: '#/components/schemas/PortfolioFactorHoldingViewRow'
          type: array
        residualSummary:
          $ref: '#/components/schemas/PortfolioResidualSummary'
      type: object
    PortfolioFactorRiskViewRow:
      properties:
        contribution:
          type: string
        contributionShare:
          type: string
        group:
          type: string
        id:
          type: string
        kind:
          enum:
            - factor
            - specific
            - returns_fallback
            - cash
            - unmodeled
          type: string
        name:
          type: string
      required:
        - id
        - name
        - kind
        - group
      type: object
    PortfolioFactorRiskCoverageSummary:
      properties:
        cashWeight:
          type: string
        lookthroughModeledWeight:
          type: string
        lookthroughUnmodeledWeight:
          type: string
        modeledWeight:
          type: string
        returnsFallbackWeight:
          type: string
        unmodeledWeight:
          type: string
      type: object
    PortfolioFactorHoldingViewRow:
      properties:
        contributionShare:
          description: Decimal string
          type: string
        id:
          type: string
        name:
          type: string
        specificVarianceShare:
          description: Decimal string
          type: string
        symbol:
          type: string
        weight:
          description: Decimal string
          type: string
      required:
        - id
        - symbol
      type: object
    PortfolioResidualSummary:
      properties:
        commonComponentDetected:
          type: boolean
        effectiveNumberOfBets:
          description: Decimal string
          type: string
        firstComponentVarianceShare:
          description: Decimal string
          type: string
        meanPairwiseResidualCorrelation:
          description: Decimal string
          type: string
        residualVarianceRatio:
          description: Decimal string
          type: string
        sufficientHistory:
          type: boolean
        symbolsUsed:
          type: integer
        weightMissing:
          description: Decimal string
          type: string
        weightUsed:
          description: Decimal string
          type: string
        windowSessions:
          type: integer
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: Itoflow access token issued for the Itoflow API.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.