---
title: "Apply New Canonical Cluster"
method: POST
path: "/v1/projects/{project_id}/source-health/duplicates/apply-cluster"
tags: ["reports"]
---

# Apply New Canonical Cluster

`POST /v1/projects/{project_id}/source-health/duplicates/apply-cluster`

## Request

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

Apply a NEW-canonical merge (task 1370): atomically create the new key
(source value + translations copied from the most-complete key of the group)
and trash ALL the group's old keys. The CODE repoint is the agent's job.

## Path parameters

- `project_id` string, required

## Query parameters

- `version_id` string, nullable

## Request body

- ApplyNewKeyClusterIn
  - `source_value` string, required
  - `new_key` NewCanonicalKey, required
    - `name` string, required
    - `namespace` 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

- ApplyNewKeyClusterOut
  - `new_key_uuid` string, required
  - `name` string, required
  - `namespace` string, required
  - `copied_from_key_uuid` string, required
  - `copied_languages` integer, required
  - `trashed_key_uuids` 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)
