curl --request POST \
--url https://your-instance.example.com/api/user/sms-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Intro - new lead",
"template": "Hi {{firstName}}, thanks for reaching out — when is a good time to chat?",
"type": "sms",
"category": "introduction"
}
'import requests
url = "https://your-instance.example.com/api/user/sms-templates"
payload = {
"name": "Intro - new lead",
"template": "Hi {{firstName}}, thanks for reaching out — when is a good time to chat?",
"type": "sms",
"category": "introduction"
}
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: 'Intro - new lead',
template: 'Hi {{firstName}}, thanks for reaching out — when is a good time to chat?',
type: 'sms',
category: 'introduction'
})
};
fetch('https://your-instance.example.com/api/user/sms-templates', 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/sms-templates",
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' => 'Intro - new lead',
'template' => 'Hi {{firstName}}, thanks for reaching out — when is a good time to chat?',
'type' => 'sms',
'category' => 'introduction'
]),
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/sms-templates"
payload := strings.NewReader("{\n \"name\": \"Intro - new lead\",\n \"template\": \"Hi {{firstName}}, thanks for reaching out — when is a good time to chat?\",\n \"type\": \"sms\",\n \"category\": \"introduction\"\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/sms-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Intro - new lead\",\n \"template\": \"Hi {{firstName}}, thanks for reaching out — when is a good time to chat?\",\n \"type\": \"sms\",\n \"category\": \"introduction\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/user/sms-templates")
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\": \"Intro - new lead\",\n \"template\": \"Hi {{firstName}}, thanks for reaching out — when is a good time to chat?\",\n \"type\": \"sms\",\n \"category\": \"introduction\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "64d2f9c5e8a1d4e001a0b1c2",
"name": "Tour confirm — Maple Court",
"template": "Hi {{firstName}}! Confirming your tour for {{tour.date}} at {{tour.time}}.",
"type": "sms",
"category": "tours",
"organizationId": "64a1b2c3d4e5f60012345678",
"userId": "64a1b2c3d4e5f60012345679",
"createdBy": "64a1b2c3d4e5f60012345679",
"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"
}Create a new SMS template
Creates a reusable template (sms, campaign, script, or automation) for the authenticated user organization. Templates may include placeholders like {{firstName}} resolved at send time.
curl --request POST \
--url https://your-instance.example.com/api/user/sms-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Intro - new lead",
"template": "Hi {{firstName}}, thanks for reaching out — when is a good time to chat?",
"type": "sms",
"category": "introduction"
}
'import requests
url = "https://your-instance.example.com/api/user/sms-templates"
payload = {
"name": "Intro - new lead",
"template": "Hi {{firstName}}, thanks for reaching out — when is a good time to chat?",
"type": "sms",
"category": "introduction"
}
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: 'Intro - new lead',
template: 'Hi {{firstName}}, thanks for reaching out — when is a good time to chat?',
type: 'sms',
category: 'introduction'
})
};
fetch('https://your-instance.example.com/api/user/sms-templates', 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/sms-templates",
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' => 'Intro - new lead',
'template' => 'Hi {{firstName}}, thanks for reaching out — when is a good time to chat?',
'type' => 'sms',
'category' => 'introduction'
]),
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/sms-templates"
payload := strings.NewReader("{\n \"name\": \"Intro - new lead\",\n \"template\": \"Hi {{firstName}}, thanks for reaching out — when is a good time to chat?\",\n \"type\": \"sms\",\n \"category\": \"introduction\"\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/sms-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Intro - new lead\",\n \"template\": \"Hi {{firstName}}, thanks for reaching out — when is a good time to chat?\",\n \"type\": \"sms\",\n \"category\": \"introduction\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/user/sms-templates")
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\": \"Intro - new lead\",\n \"template\": \"Hi {{firstName}}, thanks for reaching out — when is a good time to chat?\",\n \"type\": \"sms\",\n \"category\": \"introduction\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "64d2f9c5e8a1d4e001a0b1c2",
"name": "Tour confirm — Maple Court",
"template": "Hi {{firstName}}! Confirming your tour for {{tour.date}} at {{tour.time}}.",
"type": "sms",
"category": "tours",
"organizationId": "64a1b2c3d4e5f60012345678",
"userId": "64a1b2c3d4e5f60012345679",
"createdBy": "64a1b2c3d4e5f60012345679",
"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
Human-readable template title shown in the composer picker (e.g., "Intro - new lead").
Template body containing {{firstName}}-style placeholders resolved against the contact at send time.
Template kind: sms, campaign, script, or automation. Automation templates ignore category.
Category slug (matches TemplateCategory.name) used to group templates in the picker; defaults to other when omitted for non-automation types.
Response
Template created
A reusable template (type: sms / campaign / script / automation). Returned by create/update template endpoints.
Template body with {{firstName}}-style placeholders.
sms, email, campaign, script, automation