> ## Documentation Index
> Fetch the complete documentation index at: https://feather.mupeni.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Environment

> Creates a new environment and seeds initial flag versions for all existing flags.

When a new environment is created, a disabled `v1` config is automatically created for every existing flag in the project.

**Environment deletion** is not yet available via the API. A future `DELETE /projects/{projectId}/environments/{envId}?force=true` endpoint is planned — it will require the environment to have zero active flags before proceeding. Until then, contact support to delete an environment.

## Path parameters

<ParamField path="projectId" type="string" required />

## Body

<ParamField body="name" type="string" required>
  Display name.
</ParamField>

<ParamField body="slug" type="string" required>
  Must match `^[a-z0-9-]+$`. Unique within the project.
</ParamField>

<ParamField body="color" type="string">
  Hex color for the dashboard UI, e.g. `#6366f1`. Defaults to `#6366f1`.
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X POST https://nest.feather.mupeni.dev/v1/projects/proj_01hx.../environments \
    -H "Authorization: Bearer <server_key>" \
    -H "Content-Type: application/json" \
    -d '{ "name": "QA", "slug": "qa", "color": "#8b5cf6" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "env_04hx...",
    "orgId": "org_01hx...",
    "projectId": "proj_01hx...",
    "name": "QA",
    "slug": "qa",
    "color": "#8b5cf6",
    "protected": false,
    "createdAt": "2024-04-01T09:00:00.000Z"
  }
  ```

  ```json 409 theme={null}
  {
    "error": { "code": "CONFLICT", "message": "Slug 'qa' already exists in this project." }
  }
  ```

  ```json 207 theme={null}
  {
    "id": "env_04hx...",
    "name": "QA",
    "slug": "qa",
    "syncWarning": "Edge cache sync failed: timeout. Environment created but evaluations may serve stale data."
  }
  ```
</ResponseExample>
