Update
curl --request PUT \
--url https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sender_information": {
"from_local_part": "<string>",
"from_domain": "<string>",
"from_name": "<string>",
"reply_to_local_part": "<string>",
"reply_to_name": "<string>"
},
"prebuilt_customization": {
"button_border_radius": 123,
"button_color": "<string>",
"button_text_color": "<string>"
},
"custom_html_customization": {
"html_content": "<string>",
"plaintext_content": "<string>",
"subject": "<string>"
}
}
'import requests
url = "https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id"
payload = {
"name": "<string>",
"sender_information": {
"from_local_part": "<string>",
"from_domain": "<string>",
"from_name": "<string>",
"reply_to_local_part": "<string>",
"reply_to_name": "<string>"
},
"prebuilt_customization": {
"button_border_radius": 123,
"button_color": "<string>",
"button_text_color": "<string>"
},
"custom_html_customization": {
"html_content": "<string>",
"plaintext_content": "<string>",
"subject": "<string>"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sender_information: {
from_local_part: '<string>',
from_domain: '<string>',
from_name: '<string>',
reply_to_local_part: '<string>',
reply_to_name: '<string>'
},
prebuilt_customization: {
button_border_radius: 123,
button_color: '<string>',
button_text_color: '<string>'
},
custom_html_customization: {html_content: '<string>', plaintext_content: '<string>', subject: '<string>'}
})
};
fetch('https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id', 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/email_templates/:template_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'sender_information' => [
'from_local_part' => '<string>',
'from_domain' => '<string>',
'from_name' => '<string>',
'reply_to_local_part' => '<string>',
'reply_to_name' => '<string>'
],
'prebuilt_customization' => [
'button_border_radius' => 123,
'button_color' => '<string>',
'button_text_color' => '<string>'
],
'custom_html_customization' => [
'html_content' => '<string>',
'plaintext_content' => '<string>',
'subject' => '<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/email_templates/:template_id"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sender_information\": {\n \"from_local_part\": \"<string>\",\n \"from_domain\": \"<string>\",\n \"from_name\": \"<string>\",\n \"reply_to_local_part\": \"<string>\",\n \"reply_to_name\": \"<string>\"\n },\n \"prebuilt_customization\": {\n \"button_border_radius\": 123,\n \"button_color\": \"<string>\",\n \"button_text_color\": \"<string>\"\n },\n \"custom_html_customization\": {\n \"html_content\": \"<string>\",\n \"plaintext_content\": \"<string>\",\n \"subject\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sender_information\": {\n \"from_local_part\": \"<string>\",\n \"from_domain\": \"<string>\",\n \"from_name\": \"<string>\",\n \"reply_to_local_part\": \"<string>\",\n \"reply_to_name\": \"<string>\"\n },\n \"prebuilt_customization\": {\n \"button_border_radius\": 123,\n \"button_color\": \"<string>\",\n \"button_text_color\": \"<string>\"\n },\n \"custom_html_customization\": {\n \"html_content\": \"<string>\",\n \"plaintext_content\": \"<string>\",\n \"subject\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sender_information\": {\n \"from_local_part\": \"<string>\",\n \"from_domain\": \"<string>\",\n \"from_name\": \"<string>\",\n \"reply_to_local_part\": \"<string>\",\n \"reply_to_name\": \"<string>\"\n },\n \"prebuilt_customization\": {\n \"button_border_radius\": 123,\n \"button_color\": \"<string>\",\n \"button_text_color\": \"<string>\"\n },\n \"custom_html_customization\": {\n \"html_content\": \"<string>\",\n \"plaintext_content\": \"<string>\",\n \"subject\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"email_template": {
"template_id": "<string>",
"name": "<string>",
"sender_information": {
"from_local_part": "<string>",
"from_domain": "<string>",
"from_name": "<string>",
"reply_to_local_part": "<string>",
"reply_to_name": "<string>"
},
"prebuilt_customization": {
"button_border_radius": 123,
"button_color": "<string>",
"button_text_color": "<string>"
},
"custom_html_customization": {
"html_content": "<string>",
"plaintext_content": "<string>",
"subject": "<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"
}Email Templates
Update Email Template
Update updates an email template for a project.
PUT
/
pwa
/
v3
/
projects
/
:project_slug
/
email_templates
/
:template_id
Update
curl --request PUT \
--url https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sender_information": {
"from_local_part": "<string>",
"from_domain": "<string>",
"from_name": "<string>",
"reply_to_local_part": "<string>",
"reply_to_name": "<string>"
},
"prebuilt_customization": {
"button_border_radius": 123,
"button_color": "<string>",
"button_text_color": "<string>"
},
"custom_html_customization": {
"html_content": "<string>",
"plaintext_content": "<string>",
"subject": "<string>"
}
}
'import requests
url = "https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id"
payload = {
"name": "<string>",
"sender_information": {
"from_local_part": "<string>",
"from_domain": "<string>",
"from_name": "<string>",
"reply_to_local_part": "<string>",
"reply_to_name": "<string>"
},
"prebuilt_customization": {
"button_border_radius": 123,
"button_color": "<string>",
"button_text_color": "<string>"
},
"custom_html_customization": {
"html_content": "<string>",
"plaintext_content": "<string>",
"subject": "<string>"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sender_information: {
from_local_part: '<string>',
from_domain: '<string>',
from_name: '<string>',
reply_to_local_part: '<string>',
reply_to_name: '<string>'
},
prebuilt_customization: {
button_border_radius: 123,
button_color: '<string>',
button_text_color: '<string>'
},
custom_html_customization: {html_content: '<string>', plaintext_content: '<string>', subject: '<string>'}
})
};
fetch('https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id', 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/email_templates/:template_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'sender_information' => [
'from_local_part' => '<string>',
'from_domain' => '<string>',
'from_name' => '<string>',
'reply_to_local_part' => '<string>',
'reply_to_name' => '<string>'
],
'prebuilt_customization' => [
'button_border_radius' => 123,
'button_color' => '<string>',
'button_text_color' => '<string>'
],
'custom_html_customization' => [
'html_content' => '<string>',
'plaintext_content' => '<string>',
'subject' => '<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/email_templates/:template_id"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sender_information\": {\n \"from_local_part\": \"<string>\",\n \"from_domain\": \"<string>\",\n \"from_name\": \"<string>\",\n \"reply_to_local_part\": \"<string>\",\n \"reply_to_name\": \"<string>\"\n },\n \"prebuilt_customization\": {\n \"button_border_radius\": 123,\n \"button_color\": \"<string>\",\n \"button_text_color\": \"<string>\"\n },\n \"custom_html_customization\": {\n \"html_content\": \"<string>\",\n \"plaintext_content\": \"<string>\",\n \"subject\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sender_information\": {\n \"from_local_part\": \"<string>\",\n \"from_domain\": \"<string>\",\n \"from_name\": \"<string>\",\n \"reply_to_local_part\": \"<string>\",\n \"reply_to_name\": \"<string>\"\n },\n \"prebuilt_customization\": {\n \"button_border_radius\": 123,\n \"button_color\": \"<string>\",\n \"button_text_color\": \"<string>\"\n },\n \"custom_html_customization\": {\n \"html_content\": \"<string>\",\n \"plaintext_content\": \"<string>\",\n \"subject\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management.stytch.com/pwa/v3/projects/:project_slug/email_templates/:template_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sender_information\": {\n \"from_local_part\": \"<string>\",\n \"from_domain\": \"<string>\",\n \"from_name\": \"<string>\",\n \"reply_to_local_part\": \"<string>\",\n \"reply_to_name\": \"<string>\"\n },\n \"prebuilt_customization\": {\n \"button_border_radius\": 123,\n \"button_color\": \"<string>\",\n \"button_text_color\": \"<string>\"\n },\n \"custom_html_customization\": {\n \"html_content\": \"<string>\",\n \"plaintext_content\": \"<string>\",\n \"subject\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"email_template": {
"template_id": "<string>",
"name": "<string>",
"sender_information": {
"from_local_part": "<string>",
"from_domain": "<string>",
"from_name": "<string>",
"reply_to_local_part": "<string>",
"reply_to_name": "<string>"
},
"prebuilt_customization": {
"button_border_radius": 123,
"button_color": "<string>",
"button_text_color": "<string>"
},
"custom_html_customization": {
"html_content": "<string>",
"plaintext_content": "<string>",
"subject": "<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
⌘I