---
title: "Replace a MerQube portfolio_handler"
method: PUT
path: "/target_portfolio_handler/{uuid}"
tags: ["portfolio_handler"]
---

# Replace a MerQube portfolio_handler

`PUT /target_portfolio_handler/{uuid}`

## Request

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

Replace a MerQube portfolio_handler.

## Request body

- TargetPortfolioHandlerPatchPutGet: Describes how to handle the validation and selection of Target Portfolios
  - `auto_select` boolean: If true, the handler will automatically select the last valid portfolio for an effective timestamp
  - `eod_final_portfolio_lock_enabled` boolean: If true, finalized EOD target portfolios are locked after final selection.
  - `eod_status_patch_allowed` boolean: If false, clients cannot PATCH or DELETE the status of EOD target portfolios. MerQube internal callers can still update status so validation and auto-finalization keep working.
  - `event_notification_config` object
    - `FAILED_VALIDATION` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
    - `FINAL` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
    - `PASSED_VALIDATION` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
    - `PAST_DEADLINE` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
    - `PENDING_VALIDATION` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
    - `SELECTED` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
    - `UNSELECTED` TargetPortfolioHandlerNotificationConfig
      - `diss_destinations` DisseminationDestinations
        - `email_dissapi_configs` object[]
          - `bcc_list` string[]
          - `cc_list` string[]
          - `content` string
          - `email_list` string[]
          - `file_keys` string[]
          - `recipient_list` string[], required
          - `subject` string, required
        - `s3_dissapi_configs` object[]
          - `bucket` string, required
          - `file_keys` string[], required
          - `key_prefix` string, required
        - `sftp_dissapi_configs` object[]
          - `file_keys` string[], required
          - `sftp_ids` string[], required
      - `file_name_format` string
  - `intraday_auto_select` boolean: If true, the handler will automatically select the last valid intraday portfolio for an effective timestamp
  - `intraday_final_portfolio_lock_enabled` boolean: If true, finalized intraday target portfolios are locked after final selection.
  - `intraday_selection_window` TimestampWindow
    - `end_ts` string, required: the time of day of the deadline
    - `start_ts` string: the time of day of the deadline
    - `tzinfo` string: Timezone of the window
  - `intraday_status_patch_allowed` boolean: If false, clients cannot PATCH or DELETE the status of INTRADAY target portfolios. MerQube internal callers can still update status so validation and auto-finalization keep working.
  - `intraday_validation_window` TimestampWindow
    - `end_ts` string, required: the time of day of the deadline
    - `start_ts` string: the time of day of the deadline
    - `tzinfo` string: Timezone of the window
  - `intraday_validator_fn` string
  - `name` string, required
  - `namespace` string, required: the calling user must have permission to this namespace to create the handler in this namespace
  - `selection_window` TimestampWindow
    - `end_ts` string, required: the time of day of the deadline
    - `start_ts` string: the time of day of the deadline
    - `tzinfo` string: Timezone of the window
  - `validation_window` TimestampWindow
    - `end_ts` string, required: the time of day of the deadline
    - `start_ts` string: the time of day of the deadline
    - `tzinfo` string: Timezone of the window
  - `validator_fn` string
  - `id` string, required
  - `status` Status, required
    - `created_at` string
    - `created_by` string
    - `last_modified` string, required
    - `last_modified_by` string
    - `locked_after` string, date-time: If this is set (non null), the manifest is locked for all edits to any other field after this timestamp. A PUT/PATCH may be used to first unlock the manifest, by setting this field (to a max of one hour in the future), or to `null` again, to make other edits.

## Response `200`

OK

## Other responses

- `400`: illegal request body
- `403`: not authorized
- `404`: portfolio_handler 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)
