curl --request PUT \
--url https://api.sendx.io/api/v1/rest/template/email/{identifier} \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"name": "Welcome Email Template",
"htmlCode": "<string>",
"templateCode": "<string>",
"editorType": 123
}
'import requests
url = "https://api.sendx.io/api/v1/rest/template/email/{identifier}"
payload = {
"name": "Welcome Email Template",
"htmlCode": "<string>",
"templateCode": "<string>",
"editorType": 123
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Welcome Email Template',
htmlCode: '<string>',
templateCode: '<string>',
editorType: 123
})
};
fetch('https://api.sendx.io/api/v1/rest/template/email/{identifier}', 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://api.sendx.io/api/v1/rest/template/email/{identifier}",
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' => 'Welcome Email Template',
'htmlCode' => '<string>',
'templateCode' => '<string>',
'editorType' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <api-key>"
],
]);
$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://api.sendx.io/api/v1/rest/template/email/{identifier}"
payload := strings.NewReader("{\n \"name\": \"Welcome Email Template\",\n \"htmlCode\": \"<string>\",\n \"templateCode\": \"<string>\",\n \"editorType\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Team-ApiKey", "<api-key>")
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://api.sendx.io/api/v1/rest/template/email/{identifier}")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Welcome Email Template\",\n \"htmlCode\": \"<string>\",\n \"templateCode\": \"<string>\",\n \"editorType\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/template/email/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Welcome Email Template\",\n \"htmlCode\": \"<string>\",\n \"templateCode\": \"<string>\",\n \"editorType\": 123\n}"
response = http.request(request)
puts response.read_bodyUpdate template
Updates an existing email template.
curl --request PUT \
--url https://api.sendx.io/api/v1/rest/template/email/{identifier} \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"name": "Welcome Email Template",
"htmlCode": "<string>",
"templateCode": "<string>",
"editorType": 123
}
'import requests
url = "https://api.sendx.io/api/v1/rest/template/email/{identifier}"
payload = {
"name": "Welcome Email Template",
"htmlCode": "<string>",
"templateCode": "<string>",
"editorType": 123
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Welcome Email Template',
htmlCode: '<string>',
templateCode: '<string>',
editorType: 123
})
};
fetch('https://api.sendx.io/api/v1/rest/template/email/{identifier}', 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://api.sendx.io/api/v1/rest/template/email/{identifier}",
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' => 'Welcome Email Template',
'htmlCode' => '<string>',
'templateCode' => '<string>',
'editorType' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <api-key>"
],
]);
$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://api.sendx.io/api/v1/rest/template/email/{identifier}"
payload := strings.NewReader("{\n \"name\": \"Welcome Email Template\",\n \"htmlCode\": \"<string>\",\n \"templateCode\": \"<string>\",\n \"editorType\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Team-ApiKey", "<api-key>")
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://api.sendx.io/api/v1/rest/template/email/{identifier}")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Welcome Email Template\",\n \"htmlCode\": \"<string>\",\n \"templateCode\": \"<string>\",\n \"editorType\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/template/email/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Welcome Email Template\",\n \"htmlCode\": \"<string>\",\n \"templateCode\": \"<string>\",\n \"editorType\": 123\n}"
response = http.request(request)
puts response.read_body- Modify template name and content
- Change HTML code and template structure
- Update editor type (with validation)
- Editor type changes may affect template compatibility
- Active campaigns using this template will use cached version
- Thumbnails are regenerated automatically
- Fix template bugs or styling issues
- Update branding or design elements
- Add new template variables or sections
- Optimize template for mobile devices
Authorizations
Team API key for authentication. Find your API key in SendX Settings → Team API Key.
Example:
X-Team-ApiKey: your_team_api_key_here
Path Parameters
The unique template identifier to update.
template_f3lJvTEhSjKGVb5Lwc5SWS
^(template_)?[a-zA-Z0-9]{22}$"template_f3lJvTEhSjKGVb5Lwc5SWS"
Body
Response
✅ Template updated successfully
Unique template identifier with template_ prefix
^template_[a-zA-Z0-9]{22}$"template_abc123def456ghi789"
Name of the template
"Welcome Email Template"
Email subject line (if applicable)
"Welcome to our platform!"
HTML content of the template
"<html><body><h1>Welcome!</h1></body></html>"
Template code for visual editors (JSON structure)
"{\"blocks\":[{\"type\":\"text\",\"content\":\"Welcome!\"}]}"
Template type.
Values:
0- Email template1- Other types
0
URL to template thumbnail image
"https://cdn.sendx.io/templates/thumb_abc123.png"
Editor type used to create the template.
Values:
0- PlainText1- DragDrop2- SendxEditor
1
Template creation timestamp
"2024-01-10T14:20:00Z"
Template last update timestamp
"2024-01-15T09:15:00Z"
Was this page helpful?