---
title: "CloneSecret clones a secret from an existing secret."
method: POST
path: "/v1.1/secret/clone"
tags: ["ControlService"]
---

# CloneSecret clones a secret from an existing secret.

`POST /v1.1/secret/clone`

Fetches the source secret, applies removals, merges provided values,
 and stores as a new secret. Returns AlreadyExists if target ID exists.

## Request body

- ProtobufControlpbV1CloneSecretRequest
  - `cloneFrom` string — id from the secret to clone
  - `removeValues` string[], nullable — keys to remove from the new secret values object
  - `secret` union — new secret, copy values from clone_from, then add / update values from the new secret
    - object, nullable
    - ProtobufControlpbV1Secret
      - `author` string
      - `createdAt` string, date-time, nullable
      - `description` string
      - `id` string
      - `values` object, nullable

## Response `200`

OK

- ProtobufControlpbV1CloneSecretResponse
  - `id` string

## Other responses

- `4XX` — Something is wrong with your request such as missing or invalid data. Correct your request and try again.
- `5XX` — Internal server error. Try again later or reach out to MetaRouter support.

---

[API](https://skmtc.net/metarouter/apis/control-api.md) · [All operations](https://skmtc.net/metarouter/apis/control-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/metarouter/control-api/versions/5afc05bfaaa2/schema)
