---
title: "Create a new environment"
method: POST
path: "/environments"
tags: ["environments"]
---

# Create a new environment

`POST /environments`

Create a new environment

## Request body

- object
  - `labels` LabelInput[]
    - `key` string, non-empty, required
    - `value` string
  - `name` string, custom-name, required

## Response `200`

Create a new environment

- Environment
  - `appliedIntentsCount` integer, required
  - `id` string, required
  - `labels` Label[]
    - `key` string, required
    - `value` string
  - `name` string, required
  - `namespaces` object[], required
    - `id` string, required
  - `serviceCount` integer, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `408` — Request Timeout
- `409` — Conflict
- `422` — Unprocessable Entity
- `500` — Internal Server Error
- `default`

## Changes

> 33 revisions in range; 1 could not be searched.

- **2025-04-16** `6b4369907cb8` — 3 info
  - removed the pattern `.+` from the request property `labels/items/value`
  - the `labels/items/value` request property type/format was generalized from `string`/`non-empty` to `string`/``
  - added the non-success response with the status `408`
- **2023-11-13** `eb0110bd4dd2` — 1 breaking, 1 warning
  - the `labels/items/key` request property type/format changed from `string`/`label-name` to `string`/`non-empty`
  - changed the pattern of the request property `labels/items/key` from `^[a-z][a-z0-9-]{0,61}[a-z0-9]$` to `.+`
- **2023-02-08** `76634bc9add8` — 6 breaking, 1 info
  - added the pattern `.+` to the request property `labels/items/value`
  - added the pattern `^[A-Za-z][A-Za-z0-9- _]{0,61}[A-Za-z0-9]$` to the request property `name`
  - added the pattern `^[a-z][a-z0-9-]{0,61}[a-z0-9]$` to the request property `labels/items/key`
  - the `labels/items/key` request property type/format changed from `string`/`` to `string`/`label-name`
  - …3 more
- **2023-01-31** `e24061547d5d` — 1 info
  - added the non-success response with the status `401`
- **2023-01-29** `ce813f337cd2` — 1 info
  - the response property `name` became required for the status `200`

[Full history](https://skmtc.dev/otterize/apis/otterize-api-server/changes/environments/post.md)

---

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