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 |
| Yes |
|
Path parameters
Parameter | Type | Required | Description |
| string | Yes | Environment unique identifier (with the |
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 |
| string | Environment unique identifier |
| string | Always |
| string | Environment name |
| string | Environment description |
| Environment config | Environment configuration |
| Metadata object | Custom metadata |
| string|null | Archive time (ISO 8601) |
| string | Creation time (ISO 8601) |
| string | Time of the archive operation (ISO 8601) |
Errors
HTTP | Type | Trigger |
401 |
| PAT invalid or expired |
403 |
| Not authorized for this resource |
404 |
| 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.