---
title: "Set Source Duplicate Merge Plan"
method: PUT
path: "/v1/projects/{project_id}/source-health/duplicates/merge-plan"
tags: ["reports"]
---

# Set Source Duplicate Merge Plan

`PUT /v1/projects/{project_id}/source-health/duplicates/merge-plan`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/projects/{project_id}/source-health/duplicates/merge-plan`
- Auth: none declared

Save (or clear, when merge_plan is null) a duplicate group's merge plan —
the Resolve modal's clusters + survivor_outcome (task 1120).

## Path parameters

- `project_id` string, required

## Query parameters

- `version_id` string, nullable

## Request body

- MergePlanIn
  - `source_value` string, required
  - `merge_plan` MergePlan
    - `clusters` MergeCluster[], required
      - `canonical_key_uuid` string, nullable
      - `new_key` NewCanonicalKey
        - `name` string, required
        - `namespace` string, required
      - `new_key_created` boolean
      - `redundant_key_uuids` string[], required
      - `applied` boolean
    - `survivor_outcome` string, required
  - `files_modified` FileModified[], nullable
    - `path` string, required
    - `line` integer, nullable
    - `found_key` string, nullable
    - `replacement_key` string, nullable
    - `occurrences` integer, nullable
    - `key_name` string, nullable

## Response `200`

Successful Response

- MergePlanOut
  - `source_value` string, required
  - `status` string, nullable
  - `merge_plan` MergePlan
    - `clusters` MergeCluster[], required
      - `canonical_key_uuid` string, nullable
      - `new_key` NewCanonicalKey
        - `name` string, required
        - `namespace` string, required
      - `new_key_created` boolean
      - `redundant_key_uuids` string[], required
      - `applied` boolean
    - `survivor_outcome` string, required

## Other responses

- `422`: Validation Error

---

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