---
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

---

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