---
title: "POST /environments"
method: POST
path: "/environments"
---

# POST /environments

`POST /environments`

Creates an environment for your thin client devices.

## Request body

- object
  - `name` string, password — The name for the environment.
  - `desktopArn` string, required — The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0.
  - `desktopEndpoint` string, password — The URL for the identity provider login (only for environments that use AppStream 2.0).
  - `softwareSetUpdateSchedule` 'USE_MAINTENANCE_WINDOW' | 'APPLY_IMMEDIATELY' — An option to define if software updates should be applied within a maintenance window.
  - `maintenanceWindow` object — Describes the maintenance window for a thin client device.
    - `type` 'SYSTEM' | 'CUSTOM' — An option to select the default or custom maintenance window.
    - `startTimeHour` integer — The hour for the maintenance window start (<code>00</code>-<code>23</code>).
    - `startTimeMinute` integer — The minutes past the hour for the maintenance window start (<code>00</code>-<code>59</code>).
    - `endTimeHour` integer — The hour for the maintenance window end (<code>00</code>-<code>23</code>).
    - `endTimeMinute` integer — The minutes for the maintenance window end (<code>00</code>-<code>59</code>).
    - `daysOfTheWeek` DayOfWeek[] — The days of the week during which the maintenance window is open.
    - `applyTimeOf` 'UTC' | 'DEVICE' — The option to set the maintenance window during the device local time or Universal Coordinated Time (UTC).
  - `softwareSetUpdateMode` 'USE_LATEST' | 'USE_DESIRED' — An option to define which software updates to apply.
  - `desiredSoftwareSetId` string — The ID of the software set to apply.
  - `kmsKeyArn` string — The Amazon Resource Name (ARN) of the Key Management Service key to use to encrypt the environment.
  - `clientToken` string — <p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
  - `tags` object — A map of the key-value pairs of the tag or tags to assign to the resource.
  - `deviceCreationTags` object — A map of the key-value pairs of the tag or tags to assign to the newly created devices for this environment.

## Response `201`

Success

- CreateEnvironmentResponse
  - `environment` object — Describes an environment.
    - `id` string — The ID of the environment.
    - `name` string, password — The name of the environment.
    - `desktopArn` string — The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0.
    - `desktopEndpoint` string, password — The URL for the identity provider login (only for environments that use AppStream 2.0).
    - `desktopType` 'workspaces' | 'appstream' | 'workspaces-web' — The type of streaming desktop for the environment.
    - `activationCode` string, password — The activation code to register a device to the environment.
    - `softwareSetUpdateSchedule` 'USE_MAINTENANCE_WINDOW' | 'APPLY_IMMEDIATELY' — An option to define if software updates should be applied within a maintenance window.
    - `maintenanceWindow` object — A specification for a time window to apply software updates.
      - `type` 'SYSTEM' | 'CUSTOM', required — An option to select the default or custom maintenance window.
      - `startTimeHour` integer — The hour for the maintenance window start (<code>00</code>-<code>23</code>).
      - `startTimeMinute` integer — The minutes past the hour for the maintenance window start (<code>00</code>-<code>59</code>).
      - `endTimeHour` integer — The hour for the maintenance window end (<code>00</code>-<code>23</code>).
      - `endTimeMinute` integer — The minutes for the maintenance window end (<code>00</code>-<code>59</code>).
      - `daysOfTheWeek` DayOfWeek[] — The days of the week during which the maintenance window is open.
      - `applyTimeOf` 'UTC' | 'DEVICE' — The option to set the maintenance window during the device local time or Universal Coordinated Time (UTC).
    - `softwareSetUpdateMode` 'USE_LATEST' | 'USE_DESIRED' — An option to define which software updates to apply.
    - `desiredSoftwareSetId` string — The ID of the software set to apply.
    - `pendingSoftwareSetId` string — The ID of the software set that is pending to be installed.
    - `createdAt` string, date-time — The timestamp of when the environment was created.
    - `updatedAt` string, date-time — The timestamp of when the device was updated.
    - `arn` string — The Amazon Resource Name (ARN) of the environment.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — ValidationException
- `482` — AccessDeniedException
- `483` — ConflictException
- `484` — ResourceNotFoundException
- `485` — ThrottlingException
- `486` — InternalServerException

---

[API](https://skmtc.net/aws/apis/workspaces-thin-client.md) · [All operations](https://skmtc.net/aws/apis/workspaces-thin-client/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/workspaces-thin-client/revisions/c962e5c56c9c/schema)
