Communications
Create an automated SMS receipt variant
Creates an enabled in_kind or soft_credit variant, copying message and administrator numbers from the default when available. An existing matching variant is returned with 200; a newly created one returns 201. The controller accepts the supplied trigger/set without requiring an existing default. Requires permission: one of manage_sms.
POST
/
admin
/
auto_sms
/
template
/
variant
Create an automated SMS receipt variant
curl --request POST \
--url https://api.gratona.com/v1/admin/auto_sms/template/variant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"smsset_id": 1,
"trigger": "Trigger",
"donation_type": "in_kind"
}
'import requests
url = "https://api.gratona.com/v1/admin/auto_sms/template/variant"
payload = {
"smsset_id": 1,
"trigger": "Trigger",
"donation_type": "in_kind"
}
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({smsset_id: 1, trigger: 'Trigger', donation_type: 'in_kind'})
};
fetch('https://api.gratona.com/v1/admin/auto_sms/template/variant', 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.gratona.com/v1/admin/auto_sms/template/variant",
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([
'smsset_id' => 1,
'trigger' => 'Trigger',
'donation_type' => 'in_kind'
]),
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.gratona.com/v1/admin/auto_sms/template/variant"
payload := strings.NewReader("{\n \"smsset_id\": 1,\n \"trigger\": \"Trigger\",\n \"donation_type\": \"in_kind\"\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://api.gratona.com/v1/admin/auto_sms/template/variant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"smsset_id\": 1,\n \"trigger\": \"Trigger\",\n \"donation_type\": \"in_kind\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/auto_sms/template/variant")
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 \"smsset_id\": 1,\n \"trigger\": \"Trigger\",\n \"donation_type\": \"in_kind\"\n}"
response = http.request(request)
puts response.read_body{
"smstemplate": {
"id": 42,
"client_id": 42,
"smsset_id": 42,
"trigger": "pay_receipt",
"message": "Thank you for your [method] gift of [total_amount] to [designations] on [date].",
"to_numbers": "+15551234567,+15557654321",
"variant_type": "default",
"disabled": true,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
}
}{
"smstemplate": {
"id": 42,
"client_id": 42,
"smsset_id": 42,
"trigger": "pay_receipt",
"message": "Thank you for your [method] gift of [total_amount] to [designations] on [date].",
"to_numbers": "+15551234567,+15557654321",
"variant_type": "default",
"disabled": true,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
},
"message": "Variant created successfully."
}{
"message": "Unauthorized",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Body
application/json
Validated request fields for this operation.
Smsset id. Validation: required, integer.
Example:
1
Trigger. Validation: required, string.
Example:
"Trigger"
Donation type. Validation: required, string, in:in_kind,soft_credit; allowed values: in_kind, soft_credit.
Available options:
in_kind, soft_credit Example:
"in_kind"
Response
Existing matching variant returned.
Show child attributes
Show child attributes
⌘I
Create an automated SMS receipt variant
curl --request POST \
--url https://api.gratona.com/v1/admin/auto_sms/template/variant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"smsset_id": 1,
"trigger": "Trigger",
"donation_type": "in_kind"
}
'import requests
url = "https://api.gratona.com/v1/admin/auto_sms/template/variant"
payload = {
"smsset_id": 1,
"trigger": "Trigger",
"donation_type": "in_kind"
}
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({smsset_id: 1, trigger: 'Trigger', donation_type: 'in_kind'})
};
fetch('https://api.gratona.com/v1/admin/auto_sms/template/variant', 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.gratona.com/v1/admin/auto_sms/template/variant",
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([
'smsset_id' => 1,
'trigger' => 'Trigger',
'donation_type' => 'in_kind'
]),
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.gratona.com/v1/admin/auto_sms/template/variant"
payload := strings.NewReader("{\n \"smsset_id\": 1,\n \"trigger\": \"Trigger\",\n \"donation_type\": \"in_kind\"\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://api.gratona.com/v1/admin/auto_sms/template/variant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"smsset_id\": 1,\n \"trigger\": \"Trigger\",\n \"donation_type\": \"in_kind\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/auto_sms/template/variant")
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 \"smsset_id\": 1,\n \"trigger\": \"Trigger\",\n \"donation_type\": \"in_kind\"\n}"
response = http.request(request)
puts response.read_body{
"smstemplate": {
"id": 42,
"client_id": 42,
"smsset_id": 42,
"trigger": "pay_receipt",
"message": "Thank you for your [method] gift of [total_amount] to [designations] on [date].",
"to_numbers": "+15551234567,+15557654321",
"variant_type": "default",
"disabled": true,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
}
}{
"smstemplate": {
"id": 42,
"client_id": 42,
"smsset_id": 42,
"trigger": "pay_receipt",
"message": "Thank you for your [method] gift of [total_amount] to [designations] on [date].",
"to_numbers": "+15551234567,+15557654321",
"variant_type": "default",
"disabled": true,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
},
"message": "Variant created successfully."
}{
"message": "Unauthorized",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}