---
title: "Edit an environment"
method: PUT
path: "/environment/{environmentId}"
tags: ["Environment Main Calls"]
---

# Edit an environment

`PUT /environment/{environmentId}`

## Request

- Base URL: `https://api.qovery.com`
- URL: `https://api.qovery.com/environment/{environmentId}`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/qovery/apis/qovery-api/docs/environment/:environmentId/put.ts> (a function with typed inputs; its response is checked against the schema)

To edit an environment you must have the admin permission

## Path parameters

- `environmentId` string, uuid, required

## Request body

- EnvironmentEditRequest
  - `name` string
  - `mode` 'DEVELOPMENT' | 'PRODUCTION' | 'STAGING'

## Response `200`

Edit an environment

- Environment
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time
  - `name` string, required: name is case insensitive
  - `organization` ReferenceObject, required
    - `id` string, uuid, required
  - `project` ReferenceObject, required
    - `id` string, uuid, required
  - `last_updated_by` string, uuid: uuid of the user that made the last update
  - `cloud_provider` object, required
    - `provider` string
    - `cluster` string
  - `mode` 'DEVELOPMENT' | 'PREVIEW' | 'PRODUCTION' | 'STAGING', required
  - `cluster_id` string, uuid, required
  - `cluster_name` string, string

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access forbidden
- `404`: Resource not found
- `409`: Environment name within the project is already taken

---

[API](https://skmtc.dev/qovery/apis/qovery-api.md) - [All operations](https://skmtc.dev/qovery/apis/qovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qovery/apis/qovery-api/revisions/93c4960a44ba?raw)
