curl --request PATCH \
--url https://api.1club.ai/v1/platform/templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"content": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/templates/{id}"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"content": "<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({
name: '<string>',
subject: '<string>',
previewText: '<string>',
content: '<string>'
})
};
fetch('https://api.1club.ai/v1/platform/templates/{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://api.1club.ai/v1/platform/templates/{id}",
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>',
'subject' => '<string>',
'previewText' => '<string>',
'content' => '<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 := "https://api.1club.ai/v1/platform/templates/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"content\": \"<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("https://api.1club.ai/v1/platform/templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"type": "message",
"subject": "<string>",
"previewText": "<string>",
"content": {
"html": "<string>",
"blocks": {
"blocks": [
{
"type": "paragraph",
"data": {},
"id": "<string>",
"tunes": {}
}
],
"time": 123,
"version": "<string>"
}
},
"contentType": "html",
"systemTemplateKey": "<string>",
"translatedLocales": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Update a message template
Edits a template. Send only what changes; an empty body is a 400. content replaces the whole body when sent. subject or previewText set to null clears it.
Variables are checked against the type the template will have: the fields you send when the type stays, the whole template when it changes. The type of an organization’s copy of a system email cannot change (TEMPLATE_TYPE_LOCKED). Editing the body does not touch the per-locale copies managed in the admin portal. Not available on the Free plan (403, code PLAN_FEATURE_LOCKED).
curl --request PATCH \
--url https://api.1club.ai/v1/platform/templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"content": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/templates/{id}"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": "<string>",
"content": "<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({
name: '<string>',
subject: '<string>',
previewText: '<string>',
content: '<string>'
})
};
fetch('https://api.1club.ai/v1/platform/templates/{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://api.1club.ai/v1/platform/templates/{id}",
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>',
'subject' => '<string>',
'previewText' => '<string>',
'content' => '<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 := "https://api.1club.ai/v1/platform/templates/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"content\": \"<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("https://api.1club.ai/v1/platform/templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"type": "message",
"subject": "<string>",
"previewText": "<string>",
"content": {
"html": "<string>",
"blocks": {
"blocks": [
{
"type": "paragraph",
"data": {},
"id": "<string>",
"tunes": {}
}
],
"time": 123,
"version": "<string>"
}
},
"contentType": "html",
"systemTemplateKey": "<string>",
"translatedLocales": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Organization-scoped bearer credential: a customer API key (1club_sk_live_...) or an MCP OAuth access token.
Headers
Retry-safe key; a repeat of the same request replays the first response
255Path Parameters
Template id
Body
Fields accepted when updating a template. Send only what changes; content replaces the whole body. The type of an organization's copy of a system email cannot change.
Name, shown to staff when picking a template.
1 - 255message: applied in the message composer. transactional: sent by automations. Decides which {{variables}} the template may use.
message, transactional Email subject. May use variables. null clears it.
255The line an inbox shows after the subject. null clears it.
255The body. A string is HTML (or plain text with contentType: text). The object form is { html } and/or { blocks } in the block editor's format. An HTML block over the email size limit is refused (CONTENT_TOO_LARGE), and so is a button whose link has a {{variable}} inside the address rather than as the whole address (LINK_HAS_BURIED_VARIABLE).
500000How a string body is read.
html, text Response
The updated template
A reusable message template.
receipt is a legacy type: listed where it exists, never created.
message, transactional, receipt A template body: html, blocks, or both.
Show child attributes
Show child attributes
html, text Set on the organization's own copy of a system email: the key of the email it replaces, which is then sent as this template.
Locales with their own copy of this template. Per-locale copy is managed in the admin portal.
Was this page helpful?