メインコンテンツへスキップ

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 新しいクラウド実行 Environment を作成し、Agent セッションをホスティングします。

ヘッダー

ヘッダーフィールド必須説明
AuthorizationBearer $QODER_PATはい個人アクセストークン
Content-Typeapplication/jsonはいリクエストボディの形式

リクエストボディ

フィールド必須説明
namestringはいEnvironment 名、その識別に使用
descriptionstringいいえEnvironment の説明
configobjectはいEnvironment 設定オブジェクト
config.typestringはい固定値 "cloud"
config.networkingobjectいいえネットワークアクセス設定
config.networking.typestringいいえネットワークタイプ: "unrestricted"(無制限)、"limited"(制限)、"allowlist"(ホワイトリスト)
config.networking.allowed_hostsarrayいいえアクセスを許可するホストリスト(allowlist タイプのみ必要)
config.networking.allow_package_managersbooleanいいえパッケージマネージャーのネットワークアクセスを許可するか
config.packagesobjectいいえ事前インストールパッケージ設定
config.packages.aptarrayいいえ事前インストールが必要な apt パッケージリスト
config.packages.piparrayいいえ事前インストールが必要な pip パッケージリスト
config.packages.npmarrayいいえ事前インストールが必要な npm パッケージリスト
metadataobjectいいえカスタムメタデータのキーバリュー

リクエスト例

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"]
      }
    }
  }'

レスポンス例

{
  "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"
}

レスポンスフィールド

フィールド説明
idstringEnvironment の一意識別子、env_ プレフィックス
typestringリソースタイプ、固定値 "environment"
namestringEnvironment 名
descriptionstringEnvironment の説明
statusstringEnvironment ステータス("ready" など)
configobjectEnvironment 設定
created_atstring作成時刻(ISO 8601 形式)
updated_atstring最終更新時刻(ISO 8601 形式)

エラーコード

HTTP ステータスコードエラータイプ説明
400invalid_request_errorリクエストパラメータ無効(config.type フィールドの欠落など)
401authentication_error認証失敗、PAT が無効または期限切れ
403permission_errorこの操作を実行する権限がない
409conflict_error同名の Environment が既に存在