> ## Documentation Index
> Fetch the complete documentation index at: https://infisical-devin-1781641701-docs-github-pat-fine-grained.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Duplicate

> Duplicate one or more static secrets into another environment



## OpenAPI

````yaml POST /api/v4/secrets/duplicate
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v4/secrets/duplicate:
    post:
      tags:
        - Secrets
      description: Duplicate one or more static secrets into another environment
      operationId: duplicateSecretV4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  description: The ID of the project containing the secret.
                sourceEnvironment:
                  type: string
                  description: The slug of the source environment.
                sourceSecretPath:
                  type: string
                  default: /
                  description: The folder path of the source secret.
                destinationEnvironment:
                  type: string
                  description: The slug of the destination environment.
                destinationSecretPath:
                  type: string
                  default: /
                  description: The folder path where the secret will be duplicated to.
                secretIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                  minItems: 1
                  maxItems: 50
                  description: >-
                    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.
                shouldOverwrite:
                  type: boolean
                  default: false
                  description: >-
                    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:
                  type: object
                  properties:
                    value:
                      type: boolean
                      default: false
                    comment:
                      type: boolean
                      default: false
                    tags:
                      type: boolean
                      default: false
                    metadata:
                      type: boolean
                      default: false
                    skipMultilineEncoding:
                      type: boolean
                      default: false
                  additionalProperties: false
                  default: {}
                  description: >-
                    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.
              required:
                - projectId
                - sourceEnvironment
                - destinationEnvironment
                - secretIds
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            sourceSecretId:
                              type: string
                            sourceSecretKey:
                              type: string
                            destinationSecretId:
                              type: string
                          required:
                            - sourceSecretId
                            - sourceSecretKey
                            - destinationSecretId
                          additionalProperties: false
                        - type: object
                          properties:
                            sourceSecretId:
                              type: string
                            sourceSecretKey:
                              type: string
                            approval:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                policyId:
                                  type: string
                                  format: uuid
                                hasMerged:
                                  type: boolean
                                  default: false
                                status:
                                  type: string
                                  default: open
                                conflicts:
                                  nullable: true
                                slug:
                                  type: string
                                folderId:
                                  type: string
                                  format: uuid
                                createdAt:
                                  type: string
                                  format: date-time
                                updatedAt:
                                  type: string
                                  format: date-time
                                isReplicated:
                                  type: boolean
                                  nullable: true
                                committerUserId:
                                  type: string
                                  format: uuid
                                  nullable: true
                                statusChangedByUserId:
                                  type: string
                                  format: uuid
                                  nullable: true
                                bypassReason:
                                  type: string
                                  nullable: true
                              required:
                                - id
                                - policyId
                                - slug
                                - folderId
                                - createdAt
                                - updatedAt
                              additionalProperties: false
                          required:
                            - sourceSecretId
                            - sourceSecretKey
                            - approval
                          additionalProperties: false
                          description: >-
                            Returned when the destination has an active
                            secret-approval policy.
                required:
                  - results
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: An access token in Infisical

````