---
title: "POST /api/v1/Environments"
method: POST
path: "/api/v1/Environments"
tags: ["Environments"]
---

# POST /api/v1/Environments

`POST /api/v1/Environments`

## Request body

- CreateCloudEnvironmentBody
  - `type` string, required
  - `friendlyName` string, required
  - `experimentalFeatures` ExperimentalFeaturesBody
    - `queueResourceAllocation` boolean
    - `enableDynamicHttpsDetection` boolean
    - `usePrebuiltImages` boolean
    - `usePrebuildFastPathIfAvailable` boolean
    - `useStorageV2` boolean
    - `useRawFuse` boolean
    - `copilotWorkspace` boolean
    - `systemOnContainerCommandParams` object, nullable
    - `fileSyncerWithBridge` boolean
    - `sparkCloudspace` boolean
    - `sessionHardLimit` number, double, nullable
    - `useGpsCompute` boolean
  - `features` object, nullable
  - `seed` SeedInfoBody
    - `seedType` string, nullable
    - `seedMoniker` string, nullable
    - `gitConfig` GitConfigOptionsBody
      - `userName` string, nullable
      - `userEmail` string, nullable
    - `recurseClone` boolean
    - `repository` RepositoryInfoBody
      - `repoId` integer
      - `name` string, nullable
      - `url` string, nullable
      - `branchName` string, nullable
      - `owner` string, nullable
      - `commitId` string, nullable
      - `prebuildHash` string, nullable
      - `createType` string, nullable
      - `diskUsage` string, nullable
    - `cloneUrl` string, nullable
  - `personalization` PersonalizationInfoBody
    - `dotfilesRepository` string, nullable
    - `dotfilesTargetPath` string, nullable
    - `dotfilesInstallCommand` string, nullable
  - `containerImage` string, nullable
  - `connection` ConnectionInfoBody
    - `connectionSessionId` string, nullable
    - `connectionSessionPath` string, nullable
    - `connectionServiceUri` string, nullable
    - `hostPublicKeys` string[], nullable
    - `tunnelProperties` TunnelProperties
      - `tunnelId` string, nullable
      - `tunnelName` string, nullable
      - `clusterId` string, nullable
      - `domain` string, nullable
      - `connectTokenExpiration` integer, nullable
      - `connectAccessToken` string, nullable
      - `managePortsTokenExpiration` integer, nullable
      - `managePortsAccessToken` string, nullable
      - `serviceUri` string, nullable
  - `platform` string, nullable
  - `location` string, nullable
  - `skuName` string, nullable
  - `planId` string, nullable
  - `autoShutdownDelayMinutes` integer
  - `secrets` SecretDataBody[], nullable
    - `type` integer
    - `name` string, nullable
    - `value` string, nullable
  - `devContainerJson` string, nullable
  - `devContainerPath` string, nullable
  - `workingDirectory` string, nullable
  - `label` string, nullable
  - `hasDevcontainerJson` boolean
  - `identity` IdentityBody
    - `id` string, nullable
    - `userName` string, nullable
    - `displayName` string, nullable
  - `githubEnvironmentEndpoint` string, nullable
  - `gitHubAppUrl` string, nullable
  - `gitHubApiUrl` string, nullable
  - `createAsPrebuild` boolean
  - `billableOwner` BillableOwnerBody
    - `type` integer
    - `id` string, nullable
    - `login` string, nullable
  - `runtimeConstraints` RuntimeConstraintsBody
    - `allowedPortPrivacySettings` PrivacyEnum[], nullable
    - `imageAllowList` string[], nullable
    - `hostSetupConfig` HostSetupConfig
      - `cloneUrl` string, nullable
      - `branch` string, nullable
      - `path` string, nullable
      - `token` string, nullable
  - `testAccount` boolean
  - `netmonCorrelationData` NetmonCorrelationDataBody
    - `billableOwnerGlobalRelayId` string, nullable
    - `billableOwnerDatabaseId` string, nullable
    - `billableOwnerCreatedAt` string, nullable
    - `billableOwnerPlan` string, nullable
    - `ownerGlobalRelayId` string, nullable
    - `ownerDatabaseId` string, nullable
    - `ownerCreatedAt` string, nullable
    - `ownerPlan` string, nullable
    - `repositoryGlobalRelayId` string, nullable
    - `repositoryDatabaseId` string, nullable
    - `repositoryCreatedAt` string, nullable
    - `repositoryPrivate` boolean
  - `gitHubPfsAuthEndpoint` string, nullable
  - `userTier` string, nullable
  - `analyticsTrackingId` string, nullable
  - `enableAutoPushOnStop` boolean
  - `preferredComputeImageChannel` integer
  - `vnetInjectionSubnetId` string, nullable

## Response `201`

Created

- CloudEnvironmentResult
  - `id` string, nullable
  - `type` string, nullable
  - `friendlyName` string, nullable
  - `created` string, date-time
  - `updated` string, date-time
  - `ownerId` string, nullable
  - `state` string, nullable
  - `containerImage` string, nullable
  - `seed` SeedInfoBody
    - `seedType` string, nullable
    - `seedMoniker` string, nullable
    - `gitConfig` GitConfigOptionsBody
      - `userName` string, nullable
      - `userEmail` string, nullable
    - `recurseClone` boolean
    - `repository` RepositoryInfoBody
      - `repoId` integer
      - `name` string, nullable
      - `url` string, nullable
      - `branchName` string, nullable
      - `owner` string, nullable
      - `commitId` string, nullable
      - `prebuildHash` string, nullable
      - `createType` string, nullable
      - `diskUsage` string, nullable
    - `cloneUrl` string, nullable
  - `connection` ConnectionInfoBody
    - `connectionSessionId` string, nullable
    - `connectionSessionPath` string, nullable
    - `connectionServiceUri` string, nullable
    - `hostPublicKeys` string[], nullable
    - `tunnelProperties` TunnelProperties
      - `tunnelId` string, nullable
      - `tunnelName` string, nullable
      - `clusterId` string, nullable
      - `domain` string, nullable
      - `connectTokenExpiration` integer, nullable
      - `connectAccessToken` string, nullable
      - `managePortsTokenExpiration` integer, nullable
      - `managePortsAccessToken` string, nullable
      - `serviceUri` string, nullable
  - `portForwardingConnection` ConnectionInfoBody
    - `connectionSessionId` string, nullable
    - `connectionSessionPath` string, nullable
    - `connectionServiceUri` string, nullable
    - `hostPublicKeys` string[], nullable
    - `tunnelProperties` TunnelProperties
      - `tunnelId` string, nullable
      - `tunnelName` string, nullable
      - `clusterId` string, nullable
      - `domain` string, nullable
      - `connectTokenExpiration` integer, nullable
      - `connectAccessToken` string, nullable
      - `managePortsTokenExpiration` integer, nullable
      - `managePortsAccessToken` string, nullable
      - `serviceUri` string, nullable
  - `container` ContainerInfoBody
    - `id` string, nullable
    - `schemaVersion` string, nullable
  - `recentFolders` string[], nullable
  - `active` string, date-time
  - `platform` string, nullable
  - `location` string, nullable
  - `planId` string, nullable
  - `autoShutdownDelayMinutes` integer
  - `skuName` string, nullable
  - `skuDisplayName` string, nullable
  - `lastStateUpdateReason` string, nullable
  - `lastUsed` string, date-time, nullable
  - `features` object, nullable
  - `gitStatus` GitStatus
    - `commit` string, nullable
    - `branch` string, nullable
    - `hasUnpushedChanges` boolean
    - `hasUncommittedChanges` boolean
    - `ahead` integer
    - `behind` integer
    - `noGitRepo` boolean
    - `autoPush` boolean
  - `subscriptionData` SubscriptionData
    - `subscriptionId` string, nullable
    - `subscriptionState` string, nullable
    - `computeQuota` integer
    - `computeUsage` integer
  - `exportedBlobUrl` string, nullable
  - `accessToken` string, nullable
  - `createFromPrebuild` boolean
  - `templateStatus` string, nullable
  - `billableOwnerType` integer
  - `runtimeConstraints` RuntimeConstraintsBody
    - `allowedPortPrivacySettings` PrivacyEnum[], nullable
    - `imageAllowList` string[], nullable
    - `hostSetupConfig` HostSetupConfig
      - `cloneUrl` string, nullable
      - `branch` string, nullable
      - `path` string, nullable
      - `token` string, nullable
  - `organizationId` string, nullable
  - `prebuildType` string, nullable
  - `storageUtilizationInKb` integer, nullable
  - `displayStorageUtilizationInKb` boolean
  - `clientUsage` ClientUsageSession
    - `sessionId` string, nullable
    - `usageData` object, nullable
  - `resourceTier` integer
  - `failoverDetails` FailoverDetails
    - `failoverEnabled` boolean
    - `failoverRegion` integer
  - `enableAutoPushOnStop` boolean
  - `userControlledFailureReason` integer
  - `usingCopilotWorkspaceConfig` boolean
  - `isStorageV2` boolean, nullable
  - `isAllocatedFromPool` boolean

## Other responses

- `307` — Redirect
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `409` — Conflict
- `503` — Server Error

---

[API](https://skmtc.net/visualstudio/apis/vsonline.md) · [All operations](https://skmtc.net/visualstudio/apis/vsonline/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/visualstudio/vsonline/revisions/d55b712ea3ab/schema)
