---
title: "Create an environment"
method: POST
path: "/repositories/{workspace}/{repo_slug}/environments"
tags: ["Deployments"]
---

# Create an environment

`POST /repositories/{workspace}/{repo_slug}/environments`

Create an environment.

## Path parameters

- `workspace` string, required
- `repo_slug` string, required

## Request body

- DeploymentEnvironment — A Bitbucket Deployment Environment.
  - `type` string, required
  - `uuid` string — The UUID identifying the environment.
  - `name` string — The name of the environment.

## Response `201`

The environment was created.

- DeploymentEnvironment — A Bitbucket Deployment Environment.
  - `type` string, required
  - `uuid` string — The UUID identifying the environment.
  - `name` string — The name of the environment.

## Other responses

- `404` — The account or repository does not exist.
- `409` — An environment host with the provided name already exists.

---

[API](https://skmtc.net/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.net/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/versions/4ec8bd2515c5/schema)
