---
title: "Create"
method: POST
path: "/pwa/v3/projects/:project_slug/environments"
tags: ["Environment"]
---

# Create

`POST /pwa/v3/projects/:project_slug/environments`

## Request

- Base URL: `https://management.stytch.com`
- URL: `https://management.stytch.com/pwa/v3/projects/:project_slug/environments`
- Auth: HTTP basic

Creates a new environment in a project.

## Path parameters

- `project_slug` string, required

## Request body

- PwaEnvironmentV3CreateRequest: Request type
  - `name` string, required
  - `type` 'LIVE' | 'TEST'
  - `environment_slug` string
  - `cross_org_passwords_enabled` boolean
  - `user_impersonation_enabled` boolean
  - `zero_downtime_session_migration_url` string
  - `user_lock_self_serve_enabled` boolean
  - `user_lock_threshold` integer
  - `user_lock_ttl` integer
  - `idp_authorization_url` string
  - `idp_dynamic_client_registration_enabled` boolean
  - `idp_dynamic_client_registration_access_token_template_content` string

## Response `200`

Successful response

- PwaEnvironmentV3CreateResponse: Response type
  - `request_id` string, required
  - `environment` PwaEnvironmentV3Environment, required
    - `environment_slug` string, required
    - `project_slug` string, required
    - `name` string, required
    - `oauth_callback_id` string, required
    - `cross_org_passwords_enabled` boolean, required
    - `user_impersonation_enabled` boolean, required
    - `zero_downtime_session_migration_url` string, required
    - `use_custom_domain_in_magic_link_emails` boolean, required
    - `user_lock_self_serve_enabled` boolean, required
    - `user_lock_threshold` integer, required
    - `user_lock_ttl` integer, required
    - `idp_authorization_url` string, required
    - `idp_dynamic_client_registration_enabled` boolean, required
    - `idp_dynamic_client_registration_access_token_template_content` string, required
    - `project_id` string, required
    - `type` 'LIVE' | 'TEST'
    - `created_at` string
  - `status_code` integer, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `429`: Too Many Requests
- `500`: Internal server error

## Changes

- **2026-01-05** `32d1b433e44f`: 2 info
  - added the required property `environment/project_id` to the response with the `200` status
  - added the required property `environment/use_custom_domain_in_magic_link_emails` to the response with the `200` status

[Operation history](https://skmtc.dev/stytch/apis/stytch-api-2/changes/pwa/v3/projects/:project_slug/environments/post.md)

---

[API](https://skmtc.dev/stytch/apis/stytch-api-2.md) - [All operations](https://skmtc.dev/stytch/apis/stytch-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/stytch/apis/stytch-api-2/revisions/32d1b433e44f?raw)
