Update an email channel's template
curl --request PATCH \
--url http://localhost:8080/email/channels/{emailChannelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html_template": "<string>"
}
'import requests
url = "http://localhost:8080/email/channels/{emailChannelId}"
payload = { "html_template": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({html_template: '<string>'})
};
fetch('http://localhost:8080/email/channels/{emailChannelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/email/channels/{emailChannelId}",
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([
'html_template' => '<string>'
]),
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 := "http://localhost:8080/email/channels/{emailChannelId}"
payload := strings.NewReader("{\n \"html_template\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/email/channels/{emailChannelId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"html_template\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/email/channels/{emailChannelId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html_template\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"connection_status": "connected",
"is_default": true,
"sender_name": "<string>",
"html_template": "<string>",
"sender_signature": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}AI Email
Update an email channel's template
Set an email address’s reply template. Every reply sent from the address uses the new version immediately.
PATCH
/
email
/
channels
/
{emailChannelId}
Update an email channel's template
curl --request PATCH \
--url http://localhost:8080/email/channels/{emailChannelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html_template": "<string>"
}
'import requests
url = "http://localhost:8080/email/channels/{emailChannelId}"
payload = { "html_template": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({html_template: '<string>'})
};
fetch('http://localhost:8080/email/channels/{emailChannelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/email/channels/{emailChannelId}",
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([
'html_template' => '<string>'
]),
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 := "http://localhost:8080/email/channels/{emailChannelId}"
payload := strings.NewReader("{\n \"html_template\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/email/channels/{emailChannelId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"html_template\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/email/channels/{emailChannelId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html_template\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"connection_status": "connected",
"is_default": true,
"sender_name": "<string>",
"html_template": "<string>",
"sender_signature": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Send
null or an empty string to reset the address to the default template. A template without {{content}} is rejected with 400. Requires the email:write scope.
See Reply Templates for every variable, including the per-agent {{agent_name}}, {{agent_title}} and {{agent_email}}.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Email channel ID
Body
application/json
Full HTML template wrapping outbound emails. When null/empty, falls back to a built-in default. Required slot: {{content}}. Optional slots: {{ticket_number}}, {{zendesk_ticket_id}}, {{session.language}}, {{agent_name}}, {{agent_title}}, {{agent_email}}, {{quoted_content}}. Agent slots are empty while only the AI has handled the session; {{agent_email}} is also empty when an alias masks the agent (showing first names only does not hide it). Supports {{#if expr}}...{{else}}...{{/if}} conditionals.
Was this page helpful?