> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gorules.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update environment

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



## OpenAPI

````yaml /openapi/brms.json put /api/projects/{projectId}/environments/{environmentId}
openapi: 3.0.3
info:
  title: GoRules BRMS
  version: local
servers: []
security: []
tags:
  - name: AI
    description: >-
      AI-powered assistant for interactive conversations and decision logic
      generation
  - name: Audit log
    description: Track and export organisation activity logs for compliance and monitoring
  - name: Branches
    description: >-
      Manage feature branches for collaborative decision development with
      commits and merging
  - name: Change requests
    description: Review and approve changes before merging or deploying to environments
  - name: Cloud
    description: Cloud-specific endpoints for organisation and client management
  - name: Decision
    description: Evaluate and simulate decision graphs with trace and performance data
  - name: Deployment workflows
    description: Manage deployment workflow runs and job approvals
  - name: Deployments
    description: Configure cloud storage providers for release deployments
  - name: Document
    description: Manage decision documents, versions, and file operations within projects
  - name: Environment
    description: >-
      Configure deployment environments with approval workflows and access
      tokens
  - name: Group
    description: Manage permission groups for project-level access control
  - name: Infrastructure
    description: Health check and infrastructure status endpoints
  - name: Integration
    description: Configure external integrations for HTTP requests and data sources
  - name: Invitation
    description: Manage organisation invitations for new members
  - name: Member
    description: Manage project membership and group assignments
  - name: Organisation
    description: Manage organisation settings, preferences, and licensing
  - name: Personal access token
    description: Create and manage personal access tokens for API authentication
  - name: Profile
    description: Manage current user profile settings
  - name: Project
    description: Create and manage projects with approval workflows
  - name: Release
    description: >-
      Package, version, and deploy decision documents. Learn more about
      [Releases](https://gorules.io/developers/brms/multi-environment)
  - name: Roles
    description: Define custom roles with permissions for organisation-wide access control
  - name: Security
    description: Manage project access tokens for API authentication
  - name: Templates
    description: Browse and apply project templates for quick onboarding
  - name: Test events
    description: Manage test events for decision evaluation and testing
  - name: User
    description: Manage organisation users, invitations, and service accounts
paths:
  /api/projects/{projectId}/environments/{environmentId}:
    put:
      tags:
        - Environment
      summary: Update environment
      description: >-
        Updates an existing environment configuration including name, key, and
        approval settings.
      operationId: updateEnvironment
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: environmentId
          required: true
          description: ID of the environment to update
        - schema:
            type: string
            format: uuid
          in: path
          name: projectId
          required: true
          description: ID of the project containing the environment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New name for the environment
                key:
                  type: string
                  nullable: true
                  description: New key for BRMS type environments
                approvalMode:
                  type: string
                  nullable: true
                  enum:
                    - require_one_per_team
                    - none_create_request
                    - require_any
                    - none
                    - null
                  default: none
                  description: Approval mode for deployments to this environment
                approvalGroups:
                  type: array
                  items:
                    type: string
                    format: uuid
                    description: Group ID
                  default: []
                  description: List of group IDs that can approve deployments
              required:
                - name
        required: true
      responses:
        '200':
          description: The updated environment
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier of the environment
                  name:
                    type: string
                    description: Name of the environment
                  accessToken:
                    type: string
                    nullable: true
                    description: Access token for the environment
                  type:
                    type: string
                    enum:
                      - brms
                      - deployment
                    description: Type of environment (brms or deployment)
                  key:
                    type: string
                    nullable: true
                    description: Unique key for BRMS type environments
                  release:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the release
                      name:
                        type: string
                        description: Name of the release
                      version:
                        type: number
                        description: Version number of the release (legacy)
                      semanticVersion:
                        type: string
                        description: Semantic version string of the release
                      status:
                        type: string
                        description: Status of the release
                      createdAt:
                        type: string
                        description: Timestamp when the release was created
                    required:
                      - id
                      - name
                      - status
                      - createdAt
                    description: Currently deployed release information
                  releaseId:
                    type: string
                    nullable: true
                    format: uuid
                    description: ID of the currently deployed release
                  deploymentId:
                    type: string
                    nullable: true
                    format: uuid
                    description: ID of the associated deployment
                  deployment:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the deployment
                      name:
                        type: string
                        description: Name of the deployment
                      description:
                        type: string
                        nullable: true
                        description: Description of the deployment
                      provider:
                        type: string
                        description: Cloud provider for the deployment
                      configuration:
                        type: object
                        additionalProperties: {}
                        description: Provider-specific configuration
                      organisationId:
                        type: string
                        format: uuid
                        description: ID of the organisation
                      createdAt:
                        type: string
                        description: Timestamp when the deployment was created
                      updatedAt:
                        type: string
                        description: Timestamp when the deployment was last updated
                      deletedAt:
                        type: string
                        nullable: true
                        description: Timestamp when the deployment was deleted
                    required:
                      - id
                      - name
                      - provider
                      - organisationId
                      - createdAt
                      - updatedAt
                    description: Deployment configuration for the environment
                  projectId:
                    type: string
                    format: uuid
                    description: ID of the project
                  project:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the project
                      name:
                        type: string
                        description: Name of the project
                      key:
                        type: string
                        description: Unique key of the project
                    required:
                      - id
                      - name
                    description: Project the environment belongs to
                  reviewers:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Unique identifier of the member
                      required:
                        - id
                      description: Member assigned as reviewer
                    description: List of members assigned as reviewers
                  requiredReviewers:
                    type: boolean
                    description: Whether reviewers are required
                  addToWorkflow:
                    type: boolean
                    description: Whether the environment is part of the deployment workflow
                  workflowOrder:
                    type: number
                    nullable: true
                    description: Order position in the deployment workflow
                  approvalGroups:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Unique identifier of the group
                        name:
                          type: string
                          description: Name of the group
                        description:
                          type: string
                          description: Description of the group
                        projectId:
                          type: string
                          format: uuid
                          description: ID of the project the group belongs to
                        roleId:
                          type: string
                          format: uuid
                          description: ID of the role assigned to the group
                      required:
                        - id
                        - name
                        - projectId
                    description: Groups that can approve deployments
                  approvalMode:
                    type: string
                    enum:
                      - require_one_per_team
                      - none_create_request
                      - require_any
                      - none
                    description: Approval mode for deployments to this environment
                  changeRequests:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Unique identifier of the change request
                        type:
                          type: string
                          description: Type of change request
                        status:
                          type: string
                          description: Status of the change request
                        createdAt:
                          type: string
                          description: Timestamp when the change request was created
                      required:
                        - id
                        - type
                        - status
                        - createdAt
                      description: Change request associated with the environment
                    description: Pending change requests for this environment
                  createdAt:
                    type: string
                    description: Timestamp when the environment was created
                  updatedAt:
                    type: string
                    description: Timestamp when the environment was last updated
                  deletedAt:
                    type: string
                    nullable: true
                    description: Timestamp when the environment was deleted
                  metadata:
                    type: object
                    additionalProperties:
                      type: string
                    description: Additional metadata from the deployment provider
                required:
                  - id
                  - name
                  - type
                  - projectId
                  - requiredReviewers
                  - addToWorkflow
                  - approvalGroups
                  - approvalMode
                  - createdAt
                  - updatedAt
                description: The updated environment
      security:
        - personalAccessToken: []
        - internalAuth: []
components:
  securitySchemes:
    personalAccessToken:
      type: http
      scheme: bearer
      description: Personal access token is obtained through your profile
    internalAuth:
      type: http
      scheme: internal
      description: Cannot be used directly

````