---
title: "Update"
method: PATCH
path: "/pwa/v3/projects/:project_slug/environments/:environment_slug"
tags: ["Environment"]
---

# Update

`PATCH /pwa/v3/projects/:project_slug/environments/:environment_slug`

## Request

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

Updates the environment.

## Path parameters

- `project_slug` string, required
- `environment_slug` string, required

## Request body

- PwaEnvironmentV3UpdateRequest: Request type
  - `name` string
  - `cross_org_passwords_enabled` boolean
  - `user_impersonation_enabled` boolean
  - `zero_downtime_session_migration_url` string
  - `use_custom_domain_in_magic_link_emails` boolean
  - `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

- PwaEnvironmentV3UpdateResponse: 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`: 3 info
  - added the new optional request property `use_custom_domain_in_magic_link_emails`
  - 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/:environment_slug/patch.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)
