---
title: "Update environment"
method: PUT
path: "/api/projects/{projectId}/environments/{environmentId}"
tags: ["Environment"]
---

# Update environment

`PUT /api/projects/{projectId}/environments/{environmentId}`

Updates an existing environment configuration including name, key, and approval settings.

## Path parameters

- `environmentId` string, uuid, required
- `projectId` string, uuid, required

## Request body

- object
  - `name` string, required — New name for the environment
  - `key` string, nullable — New key for BRMS type environments
  - `approvalMode` 'require_one_per_team' | 'none_create_request' | 'require_any' | 'none' | 'null', nullable — Approval mode for deployments to this environment
  - `approvalGroups` string[] — List of group IDs that can approve deployments

## Response `200`

The updated environment

- object — The updated environment
  - `id` string, uuid, required — Unique identifier of the environment
  - `name` string, required — Name of the environment
  - `accessToken` string, nullable — Access token for the environment
  - `type` 'brms' | 'deployment', required — Type of environment (brms or deployment)
  - `key` string, nullable — Unique key for BRMS type environments
  - `release` object, nullable — Currently deployed release information
    - `id` string, uuid, required — Unique identifier of the release
    - `name` string, required — Name of the release
    - `version` number — Version number of the release (legacy)
    - `semanticVersion` string — Semantic version string of the release
    - `status` string, required — Status of the release
    - `createdAt` string, required — Timestamp when the release was created
  - `releaseId` string, uuid, nullable — ID of the currently deployed release
  - `deploymentId` string, uuid, nullable — ID of the associated deployment
  - `deployment` object, nullable — Deployment configuration for the environment
    - `id` string, uuid, required — Unique identifier of the deployment
    - `name` string, required — Name of the deployment
    - `description` string, nullable — Description of the deployment
    - `provider` string, required — Cloud provider for the deployment
    - `configuration` object — Provider-specific configuration
    - `organisationId` string, uuid, required — ID of the organisation
    - `createdAt` string, required — Timestamp when the deployment was created
    - `updatedAt` string, required — Timestamp when the deployment was last updated
    - `deletedAt` string, nullable — Timestamp when the deployment was deleted
  - `projectId` string, uuid, required — ID of the project
  - `project` object, nullable — Project the environment belongs to
    - `id` string, uuid, required — Unique identifier of the project
    - `name` string, required — Name of the project
    - `key` string — Unique key of the project
  - `reviewers` object[] — List of members assigned as reviewers
    - `id` string, uuid, required — Unique identifier of the member
  - `requiredReviewers` boolean, required — Whether reviewers are required
  - `addToWorkflow` boolean, required — Whether the environment is part of the deployment workflow
  - `workflowOrder` number, nullable — Order position in the deployment workflow
  - `approvalGroups` object[], required — Groups that can approve deployments
    - `id` string, uuid, required — Unique identifier of the group
    - `name` string, required — Name of the group
    - `description` string — Description of the group
    - `projectId` string, uuid, required — ID of the project the group belongs to
    - `roleId` string, uuid — ID of the role assigned to the group
  - `approvalMode` 'require_one_per_team' | 'none_create_request' | 'require_any' | 'none', required — Approval mode for deployments to this environment
  - `changeRequests` object[] — Pending change requests for this environment
    - `id` string, uuid, required — Unique identifier of the change request
    - `type` string, required — Type of change request
    - `status` string, required — Status of the change request
    - `createdAt` string, required — Timestamp when the change request was created
  - `createdAt` string, required — Timestamp when the environment was created
  - `updatedAt` string, required — Timestamp when the environment was last updated
  - `deletedAt` string, nullable — Timestamp when the environment was deleted
  - `metadata` object — Additional metadata from the deployment provider

---

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