---
title: "Create environment"
method: POST
path: "/v1/workspaces/{workspaceId}/environments"
---

# Create environment

`POST /v1/workspaces/{workspaceId}/environments`

## Path parameters

- `workspaceId` string, required

## Request body

- CreateEnvironmentRequest
  - `description` string
  - `metadata` object
  - `name` string, required
  - `resourceSelector` union
    - JsonSelector
      - `json` object, required
    - CelSelector
      - `cel` string, required

## Response `202`

Accepted response

- EnvironmentRequestAccepted
  - `id` string, required
  - `message` string, required

## Changes

- **2026-02-19** `e61389fc98ac` — 1 breaking, 3 info
  - the `resourceSelector` request property type/format changed from `string`/`` to ``/``
  - added `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` to the `resourceSelector` request property `oneOf` list
  - removed the non-success response with the status `400`
  - removed the non-success response with the status `409`

[Change history](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/changes/v1/workspaces/:workspaceId/environments/post.md)

---

[API](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api.md) · [All operations](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ctrlplanedev/ctrlplane-api/revisions/e61389fc98ac/schema)
