> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voiceflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Merge environments

> Folds the contents of one environment into another, so work done in a clone can be brought back to the environment it was cloned from.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json put /v1/stable/environment/merge
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/environment/merge:
    put:
      tags:
        - Environment
      summary: Merge environments
      description: >-
        Folds the contents of one environment into another, so work done in a
        clone can be brought back to the environment it was cloned from.
      operationId: StableEnvironmentController_merge
      parameters:
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StableEnvironmentMergeRequest'
      responses:
        '200':
          description: >-
            Returns the source and target environments as they stand after the
            merge, plus the resulting release on the target, with its name,
            description, and the ID of the backup that snapshots it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StableEnvironmentMergeResponse'
          x-vf-doc:
            description: >-
              Returns the source and target environments as they stand after the
              merge, plus the resulting release on the target, with its name,
              description, and the ID of the backup that snapshots it.
      security:
        - token: []
components:
  schemas:
    StableEnvironmentMergeRequest:
      type: object
      properties:
        sourceEnvironmentAlias:
          type: string
          description: The alias of the environment whose changes are merged.
        targetEnvironmentAlias:
          type: string
          description: The alias of the environment that receives the merged changes.
        removeSourceEnvironment:
          default: false
          description: If true, the source environment is deleted after the merge.
          type: boolean
      required:
        - sourceEnvironmentAlias
        - targetEnvironmentAlias
      additionalProperties: false
    StableEnvironmentMergeResponse:
      type: object
      properties:
        sourceEnvironment:
          $ref: '#/components/schemas/StableEnvironment'
        targetEnvironment:
          $ref: '#/components/schemas/StableEnvironment'
        targetRelease:
          type: object
          properties:
            name:
              type: string
            backupID:
              type: number
              description: >-
                The ID of the backup that snapshots the environment for this
                release.
            createdAt:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            description:
              nullable: true
              description: An optional description of what changed in this release.
              type: string
            autogenerated:
              type: boolean
              description: >-
                Whether the release was created automatically by the system
                rather than published manually.
          required:
            - name
            - backupID
            - createdAt
            - description
            - autogenerated
      required:
        - sourceEnvironment
        - targetEnvironment
        - targetRelease
    StableEnvironment:
      type: object
      properties:
        name:
          type: string
        alias:
          type: string
          description: The URL-safe alias that identifies the environment (e.g. `main`).
        isMain:
          type: boolean
          description: Whether this is the main (default) environment of the project.
        releases:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              backupID:
                type: number
                description: >-
                  The ID of the backup that snapshots the environment for this
                  release.
              createdAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              description:
                nullable: true
                description: An optional description of what changed in this release.
                type: string
              autogenerated:
                type: boolean
                description: >-
                  Whether the release was created automatically by the system
                  rather than published manually.
            required:
              - name
              - backupID
              - createdAt
              - description
              - autogenerated
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        trafficPercentage:
          type: number
          description: >-
            The percentage of live traffic (0-100) currently routed to this
            environment.
      required:
        - name
        - alias
        - isMain
        - releases
        - createdAt
        - trafficPercentage
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token

````