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

# Add a child portfolio to a parent.

> Creates one direct parent-child portfolio relationship. The caller must own the parent and the child must
be available to the caller. Self-links and relationships that would place an ancestor below its descendant are
rejected. Supported portfolio-type combinations are unspecified;
the relationship is created before returning when accepted.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/Portfolios/LinkPortfolios
openapi: 3.0.4
info:
  title: Derivitec Api 1.0
  version: '1.0'
servers:
  - url: https://api.riskportal.activeviam.com
security:
  - oauth2: []
  - apikey: []
tags:
  - name: AdminUser
  - name: AtotiReport
  - name: AtotiSession
  - name: BloombergOAuth
  - name: Bond
  - name: BondYieldCurvePage
  - name: BookAccess
  - name: Books
  - name: Commodity
  - name: Counterparties
  - name: Currencies
  - name: Equity
  - name: EquityDividend
  - name: EquityPage
  - name: FeatureFlag
  - name: Fx
  - name: FxPage
  - name: GroupAccess
  - name: Home
  - name: LegacyPosition
  - name: MarketData
  - name: MarketDataProvider
  - name: MarketDataProviderAccess
  - name: Meta
  - name: Notification
  - name: Organisation
  - name: PnLReport
  - name: PortfolioAccess
  - name: Portfolios
  - name: Position
  - name: PositionFilter
  - name: PricingEnvironment
  - name: PricingEnvironmentAccess
  - name: RateAsset
  - name: RateAssetPage
  - name: Report
  - name: ReportDefinition
  - name: ReportHistoryLauncherQuery
  - name: ReportLauncher
  - name: ReportQuery
  - name: ReportQueryViewUser
  - name: ReportRestriction
  - name: ReportView
  - name: RiskReport
  - name: Tradable
  - name: TradeBooking
  - name: User
  - name: VarReport
  - name: VarReportQuery
  - name: YieldCurvePage
paths:
  /api/Portfolios/LinkPortfolios:
    post:
      tags:
        - Portfolios
      summary: Add a child portfolio to a parent.
      description: >-
        Creates one direct parent-child portfolio relationship. The caller must
        own the parent and the child must

        be available to the caller. Self-links and relationships that would
        place an ancestor below its descendant are

        rejected. Supported portfolio-type combinations are unspecified;

        the relationship is created before returning when accepted.
      operationId: LinkPortfolios
      requestBody:
        description: >-
          Required `ParentPortfolioName`, `ChildPortfolioName`,
          `ParentPortfolioType`, and `ChildPortfolioType`. The type fields use
          available `PortfolioType` values.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/ApiPortfolioLinkRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPortfolioLinkRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/ApiPortfolioLinkRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ApiPortfolioLinkRequest'
      responses:
        '200':
          description: >-
            Returns whether the direct relationship was added, with name, type,
            access, or invalid-tree errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPortfolioLinkResponse'
        '400':
          description: BadRequest
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    ApiPortfolioLinkRequest:
      required:
        - $type
      type: object
      additionalProperties: false
      description: >-
        Parent and child portfolio selections for adding one direct hierarchy
        relationship.
      properties:
        parent_portfolio_name:
          type: string
          description: >-
            Name of the parent portfolio in the relationship. Both portfolio
            names must be supplied.
          nullable: true
          example: Parent portfolio
        child_portfolio_name:
          type: string
          description: >-
            Name of the child portfolio in the relationship. Both portfolio
            names must be supplied.
          nullable: true
          example: Child portfolio
        parent_portfolio_type:
          enum:
            - derivitec
            - enfusion
            - orchestrade
            - liquidity_book
            - maia
            - fund_studio
            - not_set
          type: string
          description: >-
            Portfolio category used to resolve the parent portfolio. Both parent
            and child categories are required for relationship changes.
          nullable: true
        child_portfolio_type:
          enum:
            - derivitec
            - enfusion
            - orchestrade
            - liquidity_book
            - maia
            - fund_studio
            - not_set
          type: string
          description: >-
            Portfolio category used to resolve the child portfolio. Both parent
            and child categories are required for relationship changes.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.Portfolios.ApiPortfolioLinkRequest,
              Derivitec.Web.Core
    ApiPortfolioLinkResponse:
      required:
        - $type
      type: object
      additionalProperties: false
      description: Outcome of adding a direct parent-child portfolio relationship.
      properties:
        is_success:
          type: boolean
          description: >-
            Whether the operation completed successfully. The default is `true`;
            error outcomes set it to `false`.
          example: true
        error_messages:
          type: array
          items:
            type: string
          description: >-
            Messages explaining operation-level failures. The collection is
            empty by default.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.Portfolios.ApiPortfolioLinkResponse,
              Derivitec.Web.Core
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 access-token requested from AWS Cognito and provided as a Auth
        Bearer header
      flows:
        implicit:
          authorizationUrl: https://auth.riskportal.derivitec.com/oauth2/authorize
          scopes: {}
    apikey:
      type: apiKey
      description: API-Key requested via the site and provided as a header
      name: x-api-key
      in: header

````