---
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-05-18** `8ec2edea6b20` — 6 warning
  - removed the optional property `details` from the response with the `400` status
  - removed the optional property `details` from the response with the `404` status
  - removed the optional property `details` from the response with the `500` status
  - added the new `too_many_requests` enum value to the `code` response property for the response status `400`
  - …2 more
- **2026-04-21** `a51d090509a7` — 1 info
  - endpoint added

[Change 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/2a40f94de722/schema)
