---
title: "Set Adopted Deployment Environment"
method: PATCH
path: "/internal/clusters/{cluster_id}/adopted-deployments/{namespace}/environment"
tags: ["internal"]
---

# Set Adopted Deployment Environment

`PATCH /internal/clusters/{cluster_id}/adopted-deployments/{namespace}/environment`

## Request

- Base URL: `https://api.mengi.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mengi.cloud/internal/clusters/{cluster_id}/adopted-deployments/{namespace}/environment`
- Auth: none declared. Required headers: `x-service-token`

Record the environment of a deployment imported from a namespace (worker only).

Discovery does not capture environment variables, so a migrated
deployment's record would lose its secret references at the first edit.

## Path parameters

- `cluster_id` string, uuid, required
- `namespace` string, required

## Headers

- `x-service-token` string, required

## Request body

- AdoptedDeploymentEnvironmentUpdate
  - `environment_variables` object[], required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/4ae9b375cdbb?raw)
