TEMPLATES
Commit Template
Commit the current draft version, making it live. All draft changes across all channels and variants are published as a new version.
For WhatsApp and SMS (DLT) variants, committing moves them to Approval Pending state instead of going live immediately.
PATCH
/
v2
/
{workspace}
/
template
/
{template_slug}
/
commit
/
Commit Template
curl -X PATCH "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/?commit_message=Updated%20copy" \
--header 'Authorization: ServiceToken <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/"
payload = {}
headers = {
"ServiceToken <token>": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'ServiceToken <token>': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/', 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-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ServiceToken <token>: <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://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("ServiceToken <token>", "<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.patch("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/")
.header("ServiceToken <token>", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["ServiceToken <token>"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"$schema": "https://schema.suprsend.com/template/v2/schema.json",
"slug": "order-confirmed",
"created_at": "2026-04-07T10:39:28.502737Z",
"last_triggered_at": null,
"name": "Order Confirmed",
"description": "Sent when an order is placed",
"tags": [
"transactional"
],
"enabled_channels": [
"email",
"sms"
],
"status": "active",
"version_no": 3,
"hash": "637edaabc624d09db3793829ea872a3516ed0362ce79ee3875607fc7317381b9",
"commit_message": "Updated subject line for Q2 campaign",
"active_at": "2026-04-08T12:00:00.000000Z",
"updated_at": "2026-04-08T12:00:00.000000Z",
"updated_by": {
"name": "Dana Lee",
"email": "dana.lee@example.com"
},
"channels": [
{
"channel": "email",
"is_active": true,
"variants_count": 2
},
{
"channel": "sms",
"is_active": true,
"variants_count": 1
}
]
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Query Parameters
Description of changes in this version.
Body
application/json
The body is of type object.
Response
Template committed successfully. Returns the updated template detail.
The response is of type object.
Was this page helpful?
Previous
List All VariantsRetrieve all variants across all channels for a template. Returns variant metadata, conditions, and content.
Next
⌘I
Commit Template
curl -X PATCH "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/?commit_message=Updated%20copy" \
--header 'Authorization: ServiceToken <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/"
payload = {}
headers = {
"ServiceToken <token>": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'ServiceToken <token>': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/', 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-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ServiceToken <token>: <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://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("ServiceToken <token>", "<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.patch("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/")
.header("ServiceToken <token>", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/commit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["ServiceToken <token>"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"$schema": "https://schema.suprsend.com/template/v2/schema.json",
"slug": "order-confirmed",
"created_at": "2026-04-07T10:39:28.502737Z",
"last_triggered_at": null,
"name": "Order Confirmed",
"description": "Sent when an order is placed",
"tags": [
"transactional"
],
"enabled_channels": [
"email",
"sms"
],
"status": "active",
"version_no": 3,
"hash": "637edaabc624d09db3793829ea872a3516ed0362ce79ee3875607fc7317381b9",
"commit_message": "Updated subject line for Q2 campaign",
"active_at": "2026-04-08T12:00:00.000000Z",
"updated_at": "2026-04-08T12:00:00.000000Z",
"updated_by": {
"name": "Dana Lee",
"email": "dana.lee@example.com"
},
"channels": [
{
"channel": "email",
"is_active": true,
"variants_count": 2
},
{
"channel": "sms",
"is_active": true,
"variants_count": 1
}
]
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}