Skip to main content
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

HeaderRequiredDescription
AuthorizationYesBearer <PAT>

Path parameters

ParameterTypeRequiredDescription
environment_idstringYesEnvironment unique identifier (with the env_ prefix)

Request body

No request body.

Example request

curl -s -X POST 'https://api.qoder.com/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

FieldTypeDescription
idstringEnvironment unique identifier
typestringAlways "environment"
namestringEnvironment name
descriptionstringEnvironment description
configEnvironment configEnvironment configuration
metadataMetadata objectCustom metadata
archived_atstring|nullArchive time (ISO 8601)
created_atstringCreation time (ISO 8601)
updated_atstringTime of the archive operation (ISO 8601)

Errors

HTTPTypeTrigger
401authentication_errorPAT invalid or expired
403permission_errorNot authorized for this resource
404not_found_errorEnvironment 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.

Cloud environment setup

Choose the container, network, and dependencies your agent runs in.