Create a template category (superadmin)
curl --request POST \
--url https://your-instance.example.com/api/user/template-categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "introduction",
"displayName": "Introduction",
"description": "First-touch templates for new leads.",
"color": "#3B82F6"
}
'import requests
url = "https://your-instance.example.com/api/user/template-categories"
payload = {
"name": "introduction",
"displayName": "Introduction",
"description": "First-touch templates for new leads.",
"color": "#3B82F6"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'introduction',
displayName: 'Introduction',
description: 'First-touch templates for new leads.',
color: '#3B82F6'
})
};
fetch('https://your-instance.example.com/api/user/template-categories', 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://your-instance.example.com/api/user/template-categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'introduction',
'displayName' => 'Introduction',
'description' => 'First-touch templates for new leads.',
'color' => '#3B82F6'
]),
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://your-instance.example.com/api/user/template-categories"
payload := strings.NewReader("{\n \"name\": \"introduction\",\n \"displayName\": \"Introduction\",\n \"description\": \"First-touch templates for new leads.\",\n \"color\": \"#3B82F6\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://your-instance.example.com/api/user/template-categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"introduction\",\n \"displayName\": \"Introduction\",\n \"description\": \"First-touch templates for new leads.\",\n \"color\": \"#3B82F6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/user/template-categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"introduction\",\n \"displayName\": \"Introduction\",\n \"description\": \"First-touch templates for new leads.\",\n \"color\": \"#3B82F6\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "64d2f9c5e8a1d4e001a0b1c2",
"name": "tours",
"displayName": "Tours",
"description": "Tour-confirmation and follow-up templates.",
"color": "#3B82F6",
"sortOrder": 0,
"isActive": true,
"createdBy": {
"fullName": "Acme Admin",
"email": "admin@acme.example"
},
"createdAt": "2026-05-18T12:34:56.000Z",
"updatedAt": "2026-05-18T12:34:56.000Z"
}{
"error": "User not found",
"details": "No user with id 64ee9a8b1e7f2a0011223399"
}{
"error": "User not found",
"details": "No user with id 64ee9a8b1e7f2a0011223399"
}User
Create a template category (superadmin)
Creates a new template category used to group SMS/campaign/script/automation templates. Superadmin only. Category names must be unique.
POST
/
api
/
user
/
template-categories
Create a template category (superadmin)
curl --request POST \
--url https://your-instance.example.com/api/user/template-categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "introduction",
"displayName": "Introduction",
"description": "First-touch templates for new leads.",
"color": "#3B82F6"
}
'import requests
url = "https://your-instance.example.com/api/user/template-categories"
payload = {
"name": "introduction",
"displayName": "Introduction",
"description": "First-touch templates for new leads.",
"color": "#3B82F6"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'introduction',
displayName: 'Introduction',
description: 'First-touch templates for new leads.',
color: '#3B82F6'
})
};
fetch('https://your-instance.example.com/api/user/template-categories', 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://your-instance.example.com/api/user/template-categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'introduction',
'displayName' => 'Introduction',
'description' => 'First-touch templates for new leads.',
'color' => '#3B82F6'
]),
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://your-instance.example.com/api/user/template-categories"
payload := strings.NewReader("{\n \"name\": \"introduction\",\n \"displayName\": \"Introduction\",\n \"description\": \"First-touch templates for new leads.\",\n \"color\": \"#3B82F6\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://your-instance.example.com/api/user/template-categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"introduction\",\n \"displayName\": \"Introduction\",\n \"description\": \"First-touch templates for new leads.\",\n \"color\": \"#3B82F6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/user/template-categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"introduction\",\n \"displayName\": \"Introduction\",\n \"description\": \"First-touch templates for new leads.\",\n \"color\": \"#3B82F6\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "64d2f9c5e8a1d4e001a0b1c2",
"name": "tours",
"displayName": "Tours",
"description": "Tour-confirmation and follow-up templates.",
"color": "#3B82F6",
"sortOrder": 0,
"isActive": true,
"createdBy": {
"fullName": "Acme Admin",
"email": "admin@acme.example"
},
"createdAt": "2026-05-18T12:34:56.000Z",
"updatedAt": "2026-05-18T12:34:56.000Z"
}{
"error": "User not found",
"details": "No user with id 64ee9a8b1e7f2a0011223399"
}{
"error": "User not found",
"details": "No user with id 64ee9a8b1e7f2a0011223399"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Internal slug for the category; lower-cased and trimmed on save, and must be unique across all categories.
Human-readable label shown to users in the template picker (e.g., "Introduction").
Optional short blurb describing when to use this category.
Tailwind class string (or hex) used for the category badge; defaults to bg-gray-100 text-gray-800 when omitted.
Response
Category created
Template category record used to group SMS / campaign / script / automation templates. Returned by category create/update.
⌘I