All Products
Search
Document Center

:Archive an environment

Last Updated:Jul 15, 2026

Archive an environment. Archived environments cannot host new sessions but existing sessions are unaffected.

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

Archives the specified environment. Once archived, archived_at is set and the environment cannot host new sessions; existing sessions are unaffected.

Headers

Header

Required

Description

Authorization

Yes

Bearer <PAT>

Path parameters

Parameter

Type

Required

Description

environment_id

string

Yes

Environment unique identifier (with the env_ prefix)

Request body

No request body.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/cloud/environments/env_019e3bb39b6774d8878cd0b9d237574b/archive' \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK

{
  "id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "type": "environment",
  "name": "doc-test-env",
  "description": "Environment used 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": "2026-05-18T15:28:08.459536Z",
  "created_at": "2026-05-18T15:28:07.017808Z",
  "updated_at": "2026-05-18T15:28:08.459536Z"
}

Response fields

Field

Type

Description

id

string

Environment unique identifier

type

string

Always "environment"

name

string

Environment name

description

string

Environment description

config

Environment config

Environment configuration

metadata

Metadata object

Custom metadata

archived_at

string|null

Archive time (ISO 8601)

created_at

string

Creation time (ISO 8601)

updated_at

string

Time of the archive operation (ISO 8601)

Errors

HTTP

Type

Trigger

401

authentication_error

PAT invalid or expired

403

permission_error

Not authorized for this resource

404

not_found_error

Environment with the given ID does not exist

See Errors for the full error envelope.

Notes

  • The operation is idempotent; archiving an already-archived environment does not raise an error.