---
title: "Create an environment"
method: POST
path: "/project/{projectId}/environment"
tags: ["Environments"]
---

# Create an environment

`POST /project/{projectId}/environment`

## Request

- Base URL: `https://api.qovery.com`
- URL: `https://api.qovery.com/project/{projectId}/environment`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/qovery/apis/qovery-api/docs/project/:projectId/environment/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `projectId` string, uuid, required

## Request body

- CreateEnvironmentRequest
  - `name` string, required: name is case insensitive
  - `cluster` string, uuid
  - `mode` 'DEVELOPMENT' | 'PRODUCTION' | 'STAGING'

## Response `201`

Create environment

- Environment
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time
  - `name` string, required: name is case insensitive
  - `organization` ReferenceObject, required
    - `id` string, uuid, required
  - `project` ReferenceObject, required
    - `id` string, uuid, required
  - `last_updated_by` string, uuid: uuid of the user that made the last update
  - `cloud_provider` object, required
    - `provider` string
    - `cluster` string
  - `mode` 'DEVELOPMENT' | 'PREVIEW' | 'PRODUCTION' | 'STAGING', required
  - `cluster_id` string, uuid, required
  - `cluster_name` string, string

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access forbidden
- `404`: Resource not found
- `409`: Environment name within the project is already taken

---

[API](https://skmtc.dev/qovery/apis/qovery-api.md) - [All operations](https://skmtc.dev/qovery/apis/qovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qovery/apis/qovery-api/revisions/93c4960a44ba?raw)
