Create a journey message template
Creates an enabled source template in the organization library. Email requires a subject; SMS availability depends on installed messaging support. Embedded story reuse validates permission and review evidence. Requires journeys_manage or group_all.
curl --request POST \
--url https://api.gratona.com/v1/admin/journeys/message-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Welcome message",
"body": "Hello {{first_name}}",
"channel": "email",
"subject": "Welcome",
"impact_story_ids": [
42
],
"design": "<unknown>",
"editor_mode": "email",
"entity_type": "donor"
}
'import requests
url = "https://api.gratona.com/v1/admin/journeys/message-templates"
payload = {
"name": "Welcome message",
"body": "Hello {{first_name}}",
"channel": "email",
"subject": "Welcome",
"impact_story_ids": [42],
"design": "<unknown>",
"editor_mode": "email",
"entity_type": "donor"
}
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: 'Welcome message',
body: JSON.stringify('Hello {{first_name}}'),
channel: 'email',
subject: 'Welcome',
impact_story_ids: [42],
design: '<unknown>',
editor_mode: 'email',
entity_type: 'donor'
})
};
fetch('https://api.gratona.com/v1/admin/journeys/message-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://api.gratona.com/v1/admin/journeys/message-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' => 'Welcome message',
'body' => 'Hello {{first_name}}',
'channel' => 'email',
'subject' => 'Welcome',
'impact_story_ids' => [
42
],
'design' => '<unknown>',
'editor_mode' => 'email',
'entity_type' => 'donor'
]),
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/journeys/message-templates"
payload := strings.NewReader("{\n \"name\": \"Welcome message\",\n \"body\": \"Hello {{first_name}}\",\n \"channel\": \"email\",\n \"subject\": \"Welcome\",\n \"impact_story_ids\": [\n 42\n ],\n \"design\": \"<unknown>\",\n \"editor_mode\": \"email\",\n \"entity_type\": \"donor\"\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/journeys/message-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Welcome message\",\n \"body\": \"Hello {{first_name}}\",\n \"channel\": \"email\",\n \"subject\": \"Welcome\",\n \"impact_story_ids\": [\n 42\n ],\n \"design\": \"<unknown>\",\n \"editor_mode\": \"email\",\n \"entity_type\": \"donor\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/journeys/message-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\": \"Welcome message\",\n \"body\": \"Hello {{first_name}}\",\n \"channel\": \"email\",\n \"subject\": \"Welcome\",\n \"impact_story_ids\": [\n 42\n ],\n \"design\": \"<unknown>\",\n \"editor_mode\": \"email\",\n \"entity_type\": \"donor\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"value": 42,
"label": "Welcome message",
"channel": "email",
"scope_type": "journeys_library",
"set_id": 42,
"set_name": "Example",
"configured": false,
"enabled": false,
"last_updated_at": "2026-10-20T12:00:00Z",
"template_family": "journey_library",
"trigger": "journey_template:welcome",
"subject": "Welcome",
"body": "Hello {{first_name}}",
"body_preview": "Hello Jane",
"editor_mode": "email",
"has_design": false,
"source_scope_label": "Journeys library",
"shared_live_link_warning": "Editing this source updates every journey step that is still live-linked to it.",
"impact_story_ids": [
42
],
"design": "<unknown>",
"merge_schema": [
{}
],
"merge_tags": {},
"preview_context": {},
"preview_subject": "Welcome Jane",
"preview_html": "<p>Hello Jane</p>",
"from_label": "Example Foundation"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Body
Template label; nonblank after trimming.
120"Welcome message"
Nonblank email HTML or SMS message; embedded stories require current publication permission and evidence.
"Hello {{first_name}}"
Message channel.
email, sms "email"
Email subject; required and nonblank by the service for email templates.
255"Welcome"
25Distinct approved story ID for SMS evidence.
x >= 1Email designer document as JSON or a serialized string; nullable.
Accepted editor mode hint; actual mode follows channel.
32"email"
Journey subject type; sponsorship availability follows the workspace lifecycle feature flag.
donor, trip_participant, entity, sponsorship, null "donor"
Response
Create a journey message template completed.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.gratona.com/v1/admin/journeys/message-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Welcome message",
"body": "Hello {{first_name}}",
"channel": "email",
"subject": "Welcome",
"impact_story_ids": [
42
],
"design": "<unknown>",
"editor_mode": "email",
"entity_type": "donor"
}
'import requests
url = "https://api.gratona.com/v1/admin/journeys/message-templates"
payload = {
"name": "Welcome message",
"body": "Hello {{first_name}}",
"channel": "email",
"subject": "Welcome",
"impact_story_ids": [42],
"design": "<unknown>",
"editor_mode": "email",
"entity_type": "donor"
}
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: 'Welcome message',
body: JSON.stringify('Hello {{first_name}}'),
channel: 'email',
subject: 'Welcome',
impact_story_ids: [42],
design: '<unknown>',
editor_mode: 'email',
entity_type: 'donor'
})
};
fetch('https://api.gratona.com/v1/admin/journeys/message-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://api.gratona.com/v1/admin/journeys/message-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' => 'Welcome message',
'body' => 'Hello {{first_name}}',
'channel' => 'email',
'subject' => 'Welcome',
'impact_story_ids' => [
42
],
'design' => '<unknown>',
'editor_mode' => 'email',
'entity_type' => 'donor'
]),
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/journeys/message-templates"
payload := strings.NewReader("{\n \"name\": \"Welcome message\",\n \"body\": \"Hello {{first_name}}\",\n \"channel\": \"email\",\n \"subject\": \"Welcome\",\n \"impact_story_ids\": [\n 42\n ],\n \"design\": \"<unknown>\",\n \"editor_mode\": \"email\",\n \"entity_type\": \"donor\"\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/journeys/message-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Welcome message\",\n \"body\": \"Hello {{first_name}}\",\n \"channel\": \"email\",\n \"subject\": \"Welcome\",\n \"impact_story_ids\": [\n 42\n ],\n \"design\": \"<unknown>\",\n \"editor_mode\": \"email\",\n \"entity_type\": \"donor\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/journeys/message-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\": \"Welcome message\",\n \"body\": \"Hello {{first_name}}\",\n \"channel\": \"email\",\n \"subject\": \"Welcome\",\n \"impact_story_ids\": [\n 42\n ],\n \"design\": \"<unknown>\",\n \"editor_mode\": \"email\",\n \"entity_type\": \"donor\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"value": 42,
"label": "Welcome message",
"channel": "email",
"scope_type": "journeys_library",
"set_id": 42,
"set_name": "Example",
"configured": false,
"enabled": false,
"last_updated_at": "2026-10-20T12:00:00Z",
"template_family": "journey_library",
"trigger": "journey_template:welcome",
"subject": "Welcome",
"body": "Hello {{first_name}}",
"body_preview": "Hello Jane",
"editor_mode": "email",
"has_design": false,
"source_scope_label": "Journeys library",
"shared_live_link_warning": "Editing this source updates every journey step that is still live-linked to it.",
"impact_story_ids": [
42
],
"design": "<unknown>",
"merge_schema": [
{}
],
"merge_tags": {},
"preview_context": {},
"preview_subject": "Welcome Jane",
"preview_html": "<p>Hello Jane</p>",
"from_label": "Example Foundation"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}