TEMPLATES
Fetch Template content for a Channel
API to fetch content of a particular channel in a template group (live & draft versions).
GET
/
v1
/
template
/
{template_slug}
/
channel
/
{channel_slug}
/
Fetch Template content for a channel
curl --request GET \
--url https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/', 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://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 1121,
"channel": {
"name": "In-App Inbox",
"slug": "inbox",
"is_template_approval_needed": false
},
"is_active": true,
"is_enabled": true,
"created_at": "2022-06-18T04:53:58.690274Z",
"updated_at": "2025-01-21T11:49:23.247217Z",
"disabled_languages": [],
"versions": [
{
"id": 69989,
"templates": [
{
"id": 74660,
"language": {
"name": "English",
"slug": "en"
},
"is_enabled": true,
"approval_status": "auto_approved",
"content": {
"...": null
},
"created_at": "2024-09-15T04:33:22.727005Z",
"updated_at": "2024-09-15T04:36:56.103368Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"approval_cycle": null,
"is_approval_needed": false,
"is_cloned_from_last_version": false
}
],
"status": "active",
"version_tag": "17",
"created_at": "2024-09-15T04:33:22.714274Z",
"updated_at": "2024-09-15T04:36:58.752580Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"version_tag_user": "v1",
"published_languages": [
"en"
],
"apparent_published_languages": [
"en"
],
"system_approval_info": {}
}
]
}{
"code": 404,
"type": "DoesNotExist",
"message": "TemplateGroup matching query does not exist."
}Legacy API. This is the older endpoint to fetch template content for a specific channel. We have released template 2.0 with variant support due to which the content structure and template APIs have changed. The new APIs are listed under Management API → Templates.This endpoint continues to return the live and draft content of templates created before 14 April 2026. Templates created on or after that date are only available through the new APIs.
Authorizations
Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.
Path Parameters
Template group slug you want to fetch content details. You'll get the template slug by clicking on copy button next to template group name on SuprSend dashboard -> template details page.
add one of the template channels - email, sms, whatsapp, inbox, slack, androidpush, iospush, webpush
Response
200
template id generated by SuprSend
Show child attributes
Show child attributes
active templates have atleast 1 live version
disabled channels are not picked for sending the message
Example:
true
Example:
"2023-01-25T04:53:40.011112Z"
Example:
"2023-07-27T14:55:23.939438Z"
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Fetch Template content for a channel
curl --request GET \
--url https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/', 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://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 1121,
"channel": {
"name": "In-App Inbox",
"slug": "inbox",
"is_template_approval_needed": false
},
"is_active": true,
"is_enabled": true,
"created_at": "2022-06-18T04:53:58.690274Z",
"updated_at": "2025-01-21T11:49:23.247217Z",
"disabled_languages": [],
"versions": [
{
"id": 69989,
"templates": [
{
"id": 74660,
"language": {
"name": "English",
"slug": "en"
},
"is_enabled": true,
"approval_status": "auto_approved",
"content": {
"...": null
},
"created_at": "2024-09-15T04:33:22.727005Z",
"updated_at": "2024-09-15T04:36:56.103368Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"approval_cycle": null,
"is_approval_needed": false,
"is_cloned_from_last_version": false
}
],
"status": "active",
"version_tag": "17",
"created_at": "2024-09-15T04:33:22.714274Z",
"updated_at": "2024-09-15T04:36:58.752580Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"version_tag_user": "v1",
"published_languages": [
"en"
],
"apparent_published_languages": [
"en"
],
"system_approval_info": {}
}
]
}{
"code": 404,
"type": "DoesNotExist",
"message": "TemplateGroup matching query does not exist."
}