curl --request PUT \
--url https://{subdomain}.outseta.com/api/v1/templates/{templateUid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"Subject": "Welcome to {{ CompanyName }}"
}
'import requests
url = "https://{subdomain}.outseta.com/api/v1/templates/{templateUid}"
payload = { "Subject": "Welcome to {{ CompanyName }}" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({Subject: 'Welcome to {{ CompanyName }}'})
};
fetch('https://{subdomain}.outseta.com/api/v1/templates/{templateUid}', 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://{subdomain}.outseta.com/api/v1/templates/{templateUid}",
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([
'Subject' => 'Welcome to {{ CompanyName }}'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{subdomain}.outseta.com/api/v1/templates/{templateUid}"
payload := strings.NewReader("{\n \"Subject\": \"Welcome to {{ CompanyName }}\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{subdomain}.outseta.com/api/v1/templates/{templateUid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"Subject\": \"Welcome to {{ CompanyName }}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.outseta.com/api/v1/templates/{templateUid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Subject\": \"Welcome to {{ CompanyName }}\"\n}"
response = http.request(request)
puts response.read_body{
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"Name": "string",
"Subject": "string",
"Body": "string",
"Design": "string",
"Description": "string",
"SystemName": "string",
"IsInternal": false,
"AvailableTokens": "string",
"RequiredTokens": "string",
"Tag": "string"
}Update an email template, layout or system email.
Send only the fields to change, usually Subject and Body. Fields left out of the request keep their current values; a field sent as null is cleared. The Uid in the request body is ignored.
Subject and Body must be valid Liquid, and Body must keep every token in RequiredTokens (for example ConfirmationUrl in the registration confirmation); otherwise the update is rejected with a validation error. The Name, Description and SystemName of a system email cannot be changed.
A template with a Design (made in the drag-and-drop editor of Email > Email templates) opens in the editor from its Design, not its Body. To change the Body of such a template, send Design as null as well: the editor then opens the new Body as HTML. Otherwise the editor keeps showing the old design, and saving the template there replaces the new Body. System emails have no Design.
A system email the account never edited has a Uid that starts with int_. Updating it stores the account’s own copy, with the default content for the fields left out, and returns it with its new Uid. From then on Outseta sends the copy; the int_ Uid returns 404.
On an Outseta account that is not verified yet, updating a system email pauses all email sending of the account, as it does in the Outseta app.
curl --request PUT \
--url https://{subdomain}.outseta.com/api/v1/templates/{templateUid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"Subject": "Welcome to {{ CompanyName }}"
}
'import requests
url = "https://{subdomain}.outseta.com/api/v1/templates/{templateUid}"
payload = { "Subject": "Welcome to {{ CompanyName }}" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({Subject: 'Welcome to {{ CompanyName }}'})
};
fetch('https://{subdomain}.outseta.com/api/v1/templates/{templateUid}', 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://{subdomain}.outseta.com/api/v1/templates/{templateUid}",
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([
'Subject' => 'Welcome to {{ CompanyName }}'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{subdomain}.outseta.com/api/v1/templates/{templateUid}"
payload := strings.NewReader("{\n \"Subject\": \"Welcome to {{ CompanyName }}\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{subdomain}.outseta.com/api/v1/templates/{templateUid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"Subject\": \"Welcome to {{ CompanyName }}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.outseta.com/api/v1/templates/{templateUid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Subject\": \"Welcome to {{ CompanyName }}\"\n}"
response = http.request(request)
puts response.read_body{
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"Name": "string",
"Subject": "string",
"Body": "string",
"Design": "string",
"Description": "string",
"SystemName": "string",
"IsInternal": false,
"AvailableTokens": "string",
"RequiredTokens": "string",
"Tag": "string"
}Authorizations
Enter your access token (OAuth / JWT).
Path Parameters
The Uid of the template, as returned by the list endpoint.
Body
The fields to change.
The fields of an email template that an update may change. Every field is optional: a field left out keeps its current value.
The HTML of the template. May use Liquid tokens, for example {{ Person.FirstName }}, and must keep every token in the template's RequiredTokens. Cannot be null.
What the template is for. Cannot be changed for a system email.
The design of the template in the drag-and-drop editor, as JSON. Send null with a new Body so the editor opens the new Body as HTML instead of the old design.
The name of the template, shown in the Outseta app. Cannot be changed for a system email. Cannot be null.
The subject line of the email. May use Liquid tokens, for example {{ CompanyName }}.
Response
111 - 2501101000100050