All Products
Search
Document Center

:Update an Environment

Last Updated:Jul 16, 2026

Update the properties of a specified environment, such as name, description, and configuration.

POST /api/v1/cloud/environments/{environment_id}

Updates the properties of a specified environment (such as name, description, and configuration).

Request headers

Header

Required

Description

Authorization

Yes

Bearer <PAT>

Content-Type

Yes

application/json

Path parameters

Parameter

Type

Required

Description

environment_id

string

Yes

Environment unique identifier (prefixed with env_)

Request body

Include only the fields you want to update. Omitted fields remain unchanged.

Field

Type

Required

Description

name

string

No

Environment name

description

string

No

Environment description

config

Environment config

No

Replaces the saved Environment configuration

metadata

object

No

Metadata patch. String values add or update keys; null values remove keys from the saved metadata

Example request

curl -s -X POST "https://api.qoder.com.cn/api/v1/cloud/environments/env_019e3bb39b6774d8878cd0b9d237574b" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Environment for API documentation testing"
  }'

Example response

HTTP 200 OK

{
  "id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "type": "environment",
  "name": "doc-test-env",
  "description": "Environment for API documentation testing",
  "config": {
    "type": "cloud",
    "networking": {
      "type": "limited",
      "allowed_hosts": [],
      "allow_package_managers": false,
      "allow_mcp_servers": false
    },
    "packages": {
      "type": "packages",
      "apt": ["curl"],
      "npm": [],
      "pip": []
    }
  },
  "metadata": {},
  "archived_at": null,
  "created_at": "2026-05-18T15:28:07.017808Z",
  "updated_at": "2026-05-18T15:28:08.093156Z"
}

Response fields

Field

Type

Description

id

string

Environment unique identifier

type

string

Resource type, always "environment"

name

string

Environment name

description

string

Updated description

config

Environment config

Environment configuration

metadata

Metadata object

Custom metadata

archived_at

string|null

Archive time (ISO 8601); null when not archived

created_at

string

Creation time (ISO 8601)

updated_at

string

Last update time (reflects the latest change)

Errors

HTTP

type

Description

400

invalid_request_error

Request body, config, or metadata field values are invalid

401

authentication_error

Authentication failed; PAT invalid or expired

403

permission_error

Not authorized to access this resource

404

not_found_error

Environment with the specified ID does not exist

Notes

  • Omitted fields remain unchanged

  • Providing config explicitly replaces the saved configuration entirely

  • Providing metadata explicitly merges string values into the saved metadata object; null values remove existing keys