Skip to main content
POST
/
api
/
v4
/
secrets
/
duplicate
cURL
curl --request POST \
  --url https://us.infisical.com/api/v4/secrets/duplicate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "projectId": "<string>",
  "sourceEnvironment": "<string>",
  "destinationEnvironment": "<string>",
  "secretIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "sourceSecretPath": "/",
  "destinationSecretPath": "/",
  "shouldOverwrite": false,
  "attributesToCopy": {}
}
'
{
  "results": [
    {
      "sourceSecretId": "<string>",
      "sourceSecretKey": "<string>",
      "destinationSecretId": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://infisical.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

An access token in Infisical

Body

application/json
projectId
string
required

The ID of the project containing the secret.

sourceEnvironment
string
required

The slug of the source environment.

destinationEnvironment
string
required

The slug of the destination environment.

secretIds
string<uuid>[]
required

Array of source secret IDs to duplicate. All secrets must belong to the source environment and path. Rotation and honey-token secrets cannot be duplicated. Maximum 50 secrets per request.

Required array length: 1 - 50 elements
sourceSecretPath
string
default:/

The folder path of the source secret.

destinationSecretPath
string
default:/

The folder path where the secret will be duplicated to.

shouldOverwrite
boolean
default:false

When true, overwrite an existing secret with the same key at the destination. When false (default), the request fails if the destination already has a secret with that key.

attributesToCopy
object

Object specifying which attributes of the source secret to copy to the destination. Each key is optional and defaults to false. Available keys: value, comment, tags, metadata, skipMultilineEncoding.

Response

Default Response

results
object[]
required