Update
curl --request PATCH \
--url https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cross_org_passwords_enabled": true,
"user_impersonation_enabled": true,
"zero_downtime_session_migration_url": "<string>",
"use_custom_domain_in_magic_link_emails": true,
"user_lock_self_serve_enabled": true,
"user_lock_threshold": 123,
"user_lock_ttl": 123,
"idp_authorization_url": "<string>",
"idp_dynamic_client_registration_enabled": true,
"idp_dynamic_client_registration_access_token_template_content": "<string>"
}
'import requests
url = "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug"
payload = {
"name": "<string>",
"cross_org_passwords_enabled": True,
"user_impersonation_enabled": True,
"zero_downtime_session_migration_url": "<string>",
"use_custom_domain_in_magic_link_emails": True,
"user_lock_self_serve_enabled": True,
"user_lock_threshold": 123,
"user_lock_ttl": 123,
"idp_authorization_url": "<string>",
"idp_dynamic_client_registration_enabled": True,
"idp_dynamic_client_registration_access_token_template_content": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
cross_org_passwords_enabled: true,
user_impersonation_enabled: true,
zero_downtime_session_migration_url: '<string>',
use_custom_domain_in_magic_link_emails: true,
user_lock_self_serve_enabled: true,
user_lock_threshold: 123,
user_lock_ttl: 123,
idp_authorization_url: '<string>',
idp_dynamic_client_registration_enabled: true,
idp_dynamic_client_registration_access_token_template_content: '<string>'
})
};
fetch('https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'cross_org_passwords_enabled' => true,
'user_impersonation_enabled' => true,
'zero_downtime_session_migration_url' => '<string>',
'use_custom_domain_in_magic_link_emails' => true,
'user_lock_self_serve_enabled' => true,
'user_lock_threshold' => 123,
'user_lock_ttl' => 123,
'idp_authorization_url' => '<string>',
'idp_dynamic_client_registration_enabled' => true,
'idp_dynamic_client_registration_access_token_template_content' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"cross_org_passwords_enabled\": true,\n \"user_impersonation_enabled\": true,\n \"zero_downtime_session_migration_url\": \"<string>\",\n \"use_custom_domain_in_magic_link_emails\": true,\n \"user_lock_self_serve_enabled\": true,\n \"user_lock_threshold\": 123,\n \"user_lock_ttl\": 123,\n \"idp_authorization_url\": \"<string>\",\n \"idp_dynamic_client_registration_enabled\": true,\n \"idp_dynamic_client_registration_access_token_template_content\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"cross_org_passwords_enabled\": true,\n \"user_impersonation_enabled\": true,\n \"zero_downtime_session_migration_url\": \"<string>\",\n \"use_custom_domain_in_magic_link_emails\": true,\n \"user_lock_self_serve_enabled\": true,\n \"user_lock_threshold\": 123,\n \"user_lock_ttl\": 123,\n \"idp_authorization_url\": \"<string>\",\n \"idp_dynamic_client_registration_enabled\": true,\n \"idp_dynamic_client_registration_access_token_template_content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"cross_org_passwords_enabled\": true,\n \"user_impersonation_enabled\": true,\n \"zero_downtime_session_migration_url\": \"<string>\",\n \"use_custom_domain_in_magic_link_emails\": true,\n \"user_lock_self_serve_enabled\": true,\n \"user_lock_threshold\": 123,\n \"user_lock_ttl\": 123,\n \"idp_authorization_url\": \"<string>\",\n \"idp_dynamic_client_registration_enabled\": true,\n \"idp_dynamic_client_registration_access_token_template_content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"environment": {
"environment_slug": "<string>",
"project_slug": "<string>",
"name": "<string>",
"oauth_callback_id": "<string>",
"cross_org_passwords_enabled": true,
"user_impersonation_enabled": true,
"zero_downtime_session_migration_url": "<string>",
"use_custom_domain_in_magic_link_emails": true,
"user_lock_self_serve_enabled": true,
"user_lock_threshold": 123,
"user_lock_ttl": 123,
"idp_authorization_url": "<string>",
"idp_dynamic_client_registration_enabled": true,
"idp_dynamic_client_registration_access_token_template_content": "<string>",
"project_id": "<string>",
"created_at": "<string>"
},
"status_code": 123
}{
"status_code": 401,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "unauthorized_credentials",
"error_message": "Unauthorized credentials.",
"error_url": "https://stytch.com/docs/api/errors/401"
}{
"status_code": 429,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "too_many_requests",
"error_message": "Too many requests have been made.",
"error_url": "https://stytch.com/docs/api/errors/429"
}{
"status_code": 500,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "internal_server_error",
"error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
"error_url": "https://stytch.com/docs/api/errors/500"
}Environments
Update Environment
Updates the environment.
PATCH
/
pwa
/
v3
/
projects
/
:project_slug
/
environments
/
:environment_slug
Update
curl --request PATCH \
--url https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cross_org_passwords_enabled": true,
"user_impersonation_enabled": true,
"zero_downtime_session_migration_url": "<string>",
"use_custom_domain_in_magic_link_emails": true,
"user_lock_self_serve_enabled": true,
"user_lock_threshold": 123,
"user_lock_ttl": 123,
"idp_authorization_url": "<string>",
"idp_dynamic_client_registration_enabled": true,
"idp_dynamic_client_registration_access_token_template_content": "<string>"
}
'import requests
url = "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug"
payload = {
"name": "<string>",
"cross_org_passwords_enabled": True,
"user_impersonation_enabled": True,
"zero_downtime_session_migration_url": "<string>",
"use_custom_domain_in_magic_link_emails": True,
"user_lock_self_serve_enabled": True,
"user_lock_threshold": 123,
"user_lock_ttl": 123,
"idp_authorization_url": "<string>",
"idp_dynamic_client_registration_enabled": True,
"idp_dynamic_client_registration_access_token_template_content": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
cross_org_passwords_enabled: true,
user_impersonation_enabled: true,
zero_downtime_session_migration_url: '<string>',
use_custom_domain_in_magic_link_emails: true,
user_lock_self_serve_enabled: true,
user_lock_threshold: 123,
user_lock_ttl: 123,
idp_authorization_url: '<string>',
idp_dynamic_client_registration_enabled: true,
idp_dynamic_client_registration_access_token_template_content: '<string>'
})
};
fetch('https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'cross_org_passwords_enabled' => true,
'user_impersonation_enabled' => true,
'zero_downtime_session_migration_url' => '<string>',
'use_custom_domain_in_magic_link_emails' => true,
'user_lock_self_serve_enabled' => true,
'user_lock_threshold' => 123,
'user_lock_ttl' => 123,
'idp_authorization_url' => '<string>',
'idp_dynamic_client_registration_enabled' => true,
'idp_dynamic_client_registration_access_token_template_content' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"cross_org_passwords_enabled\": true,\n \"user_impersonation_enabled\": true,\n \"zero_downtime_session_migration_url\": \"<string>\",\n \"use_custom_domain_in_magic_link_emails\": true,\n \"user_lock_self_serve_enabled\": true,\n \"user_lock_threshold\": 123,\n \"user_lock_ttl\": 123,\n \"idp_authorization_url\": \"<string>\",\n \"idp_dynamic_client_registration_enabled\": true,\n \"idp_dynamic_client_registration_access_token_template_content\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"cross_org_passwords_enabled\": true,\n \"user_impersonation_enabled\": true,\n \"zero_downtime_session_migration_url\": \"<string>\",\n \"use_custom_domain_in_magic_link_emails\": true,\n \"user_lock_self_serve_enabled\": true,\n \"user_lock_threshold\": 123,\n \"user_lock_ttl\": 123,\n \"idp_authorization_url\": \"<string>\",\n \"idp_dynamic_client_registration_enabled\": true,\n \"idp_dynamic_client_registration_access_token_template_content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management.stytch.com/pwa/v3/projects/:project_slug/environments/:environment_slug")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"cross_org_passwords_enabled\": true,\n \"user_impersonation_enabled\": true,\n \"zero_downtime_session_migration_url\": \"<string>\",\n \"use_custom_domain_in_magic_link_emails\": true,\n \"user_lock_self_serve_enabled\": true,\n \"user_lock_threshold\": 123,\n \"user_lock_ttl\": 123,\n \"idp_authorization_url\": \"<string>\",\n \"idp_dynamic_client_registration_enabled\": true,\n \"idp_dynamic_client_registration_access_token_template_content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"environment": {
"environment_slug": "<string>",
"project_slug": "<string>",
"name": "<string>",
"oauth_callback_id": "<string>",
"cross_org_passwords_enabled": true,
"user_impersonation_enabled": true,
"zero_downtime_session_migration_url": "<string>",
"use_custom_domain_in_magic_link_emails": true,
"user_lock_self_serve_enabled": true,
"user_lock_threshold": 123,
"user_lock_ttl": 123,
"idp_authorization_url": "<string>",
"idp_dynamic_client_registration_enabled": true,
"idp_dynamic_client_registration_access_token_template_content": "<string>",
"project_id": "<string>",
"created_at": "<string>"
},
"status_code": 123
}{
"status_code": 401,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "unauthorized_credentials",
"error_message": "Unauthorized credentials.",
"error_url": "https://stytch.com/docs/api/errors/401"
}{
"status_code": 429,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "too_many_requests",
"error_message": "Too many requests have been made.",
"error_url": "https://stytch.com/docs/api/errors/429"
}{
"status_code": 500,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "internal_server_error",
"error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
"error_url": "https://stytch.com/docs/api/errors/500"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Request type
⌘I