---
title: "PUT /index/{uuid}/target_portfolio"
method: PUT
path: "/index/{uuid}/target_portfolio"
tags: ["index"]
---

# PUT /index/{uuid}/target_portfolio

`PUT /index/{uuid}/target_portfolio`

## Request

- Base URL: `https://api.merqube.com`
- URL: `https://api.merqube.com/index/{uuid}/target_portfolio`
- Auth: none declared
- TypeScript: <https://skmtc.dev/merqube/apis/merqube-api/docs/index/:uuid/target_portfolio/put.ts> (a function with typed inputs; its response is checked against the schema)

replace the portfolio for this index. Will eventually but not immediately affect /index/uuid/portfolio.

## Path parameters

- `uuid` string, required

## Request body

- BasketPortfolioPutIn: Input data for creating/replacing target portfolios. This object captures all information needed to execute externally defined rebalances.
  - `divisor` number: A scaling factor to apply for the SHARES of the portfolio constituents
  - `external_id` string: An external ID to reference this portfolio with. Must be unique per index.
  - `positions` ValidEquityBasketPosition[], required
    - union
      - BasketPosition: A general basket portfolio position
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
      - RicEquityPosition: Equity position, identified by a RIC
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
        - `real_time_trade_types` RealTimeTradeType[]
        - `use_primary_listing` boolean: use the security's primary listing rather than the one from the identifier
      - FsymEquityPosition: Equity position, identified by a FSYM + country code
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
        - `country_code` string, required: ISO country codes
      - OptionPosition: An Option position
        - `amount` number, required
        - `currency` string, required
        - `delta_hedge_flag` boolean
        - `expiration_date` string, required
        - `expiration_type` 'AM' | 'PM'
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `lag` string
        - `leg_multiple` number
        - `mic` string
        - `strike` number, required
        - `strike_type` 'PCT_SPOT' | 'DELTA' | 'SPCT_SPOT'
        - `structure_id` number
        - `style` 'AMERICAN' | 'EUROPEAN'
        - `type` 'PUT' | 'CALL', required
        - `underlying` string, required
        - `vol_multiplier` number
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
      - FuturesPosition: A Futures position
        - `amount` number, required
        - `currency` string, required
        - `expiration_date` string, required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `lag` string
        - `underlying` string, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
      - SecapiBasketPosition: A basket position that uses custom metrics from merqube data source
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
        - `custom_metric` string
      - MerqubeIndexPosition: A basket position that uses custom metrics from merqube data source
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
        - `metric_name` string
      - IsinMicEquityPosition: Equity position, identified by an ISIN and MIC
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
        - `mic` string, required
      - MutualFundPosition: Mutual fund position, identified by ISIN (funds have no MIC)
        - `amount` number, required
        - `asset_type` 'CASH' | 'THIRD_PARTY_INDEX' | 'EQUITY' | 'OPTION' | 'FUTURES' | 'MUTUAL_FUND' | 'MERQUBE_INDEX' | 'CUSTOM_SECAPI_INDEX' | 'OTHER', required
        - `identifier` string, required
        - `identifier_type` 'RIC' | 'CURRENCY_CODE' | 'FSYM_ID' | 'TICKER' | 'BBG_TICKER' | 'CUSIP' | 'ISIN', required
        - `position_id` string
        - `price` number: client supplied price for a position we cannot price ourselves; must be set together with price_currency
        - `price_currency` string: currency of price; must be set together with price
  - `share_selection_date` string
  - `target_portfolio_type` 'EOD' | 'INTRADAY': Whether its an end of day portfolio or an intraday portfolio.
  - `timestamp` string, required
  - `unit_of_measure` 'SHARES' | 'WEIGHT', required: Used to indicate if portfolio amounts are absolute or relative. weight indicates portfolio amounts are relative weights units indicates portfolio amounts are absolute values, e.g. shares or number of contracts

## Response `200`

OK, portfolio successfully written and validated.

## Other responses

- `400`: bad portfolio or request
- `403`: not authorized
- `404`: index does not exist

---

[API](https://skmtc.dev/merqube/apis/merqube-api.md) - [All operations](https://skmtc.dev/merqube/apis/merqube-api/llms.txt) - [OpenAPI document](https://skmtc.dev/merqube/apis/merqube-api/revisions/20f47ca36587?raw)
