Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

POST /v1/environments Creates a new cloud execution environment for hosting Agent sessions.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
Content-TypeYesapplication/json

Request body

FieldTypeRequiredDescription
namestringYesEnvironment name
descriptionstringNoEnvironment description
configobjectYesEnvironment configuration object
config.typestringYesAlways "cloud"
config.networkingobjectNoNetwork access configuration
config.networking.typestringNoNetwork type: "unrestricted", "limited", or "allowlist"
config.networking.allowed_hostsarrayNoAllowlist of hosts (only for allowlist type)
config.networking.allow_package_managersbooleanNoWhether to allow package manager network access
config.packagesobjectNoPre-installed package configuration
config.packages.aptarrayNoList of apt packages to install
config.packages.piparrayNoList of pip packages to install
config.packages.npmarrayNoList of npm packages to install
metadataobjectNoCustom metadata key-value pairs

Example request

curl -s -X POST 'https://openapi.qoder.sh/api/v1/cloud/environments' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "doc-test-env",
    "config": {
      "type": "cloud",
      "networking": {
        "type": "limited"
      },
      "packages": {
        "apt": ["curl"]
      }
    }
  }'

Example response

HTTP 200 OK
{
  "id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "type": "environment",
  "name": "doc-test-env",
  "description": "",
  "status": "ready",
  "config": {
    "type": "cloud",
    "networking": {
      "type": "limited"
    },
    "packages": {
      "apt": [
        "curl"
      ]
    }
  },
  "created_at": "2026-05-18T15:28:07.017808Z",
  "updated_at": "2026-05-18T15:28:07.017808Z"
}

Response fields

FieldTypeDescription
idstringEnvironment unique identifier with the env_ prefix
typestringAlways "environment"
namestringEnvironment name
descriptionstringEnvironment description
statusstringEnvironment status (such as "ready")
configobjectEnvironment configuration
created_atstringCreation time (ISO 8601)
updated_atstringLast update time (ISO 8601)

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid request parameters (such as missing config.type)
401authentication_errorPAT invalid or expired
403permission_errorNot authorized for this operation
409conflict_errorAn environment with the same name already exists
See Errors for the full error envelope.