---
title: "Clone an environment"
method: POST
path: "/environments/{id}/clone"
tags: ["Environments"]
---

# Clone an environment

`POST /environments/{id}/clone`

Clone all published features and plans from the source environment into a target environment. If target_environment_id is provided, entities are cloned into that existing environment. Otherwise a new environment is created from name and type first.

## Path parameters

- `id` string, required

## Request body

- CloneEnvironmentRequest
  - `name` string — Name of the new environment (required when target_environment_id is not provided)
  - `target_environment_id` string — TargetEnvironmentID is the ID of an existing environment to clone into (optional). When provided, Name and Type are ignored. When omitted, Name and Type are required.
  - `type` 'development' | 'production'

## Response `202`

Accepted

- ModelsTemporalWorkflowResult
  - `message` string
  - `run_id` string
  - `workflow_id` string

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `500` — Internal Server Error

## Changes

- **2026-07-15** `f8ecf435d25d` — 3 warning
  - added the new `not_implemented` enum value to the `code` response property for the response status `400`
  - added the new `not_implemented` enum value to the `code` response property for the response status `404`
  - added the new `not_implemented` enum value to the `code` response property for the response status `500`
- **2026-07-09** `7d57386313c7` — 1 breaking, 3 info
  - the response's body type/format changed from ``/`` to `object`/`` for status `202`
  - added the optional property `message` to the response with the `202` status
  - added the optional property `run_id` to the response with the `202` status
  - added the optional property `workflow_id` to the response with the `202` status
- **2026-07-09** `4b1a811c4179` — 1 breaking, 3 warning
  - the response's body type/format changed from `object`/`` to ``/`` for status `202`
  - removed the optional property `message` from the response with the `202` status
  - removed the optional property `run_id` from the response with the `202` status
  - removed the optional property `workflow_id` from the response with the `202` status
- …earlier changes not shown

[Full history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/environments/:id/clone/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/f8ecf435d25d/schema)
