Message templates
Use this reference for exact request attributes, response envelopes, object shape, and examples. For customer-notification patterns and when to use templates with Chimes, start with the Chimes product guide.
Operations
The message template object
A Message Template stores one channel of content. SMS templates use sms.message_template; email templates use email.subject and email.html. Do not mix SMS and email content in the same template.
Properties
- Name
attachments- Type
- array
- Description
Up to 25 email attachment file IDs. Every entry must be nonempty and match
file_followed by alphanumeric characters. Attachments are accepted only for email templates. Previews return the attachment IDs, but Chime requests currently reject stored templates that contain attachments. Omitted when the template has no attachments.
emailobjectEmail template content. Present whenchannelisemail.Click or tap to expandView from detailsClick or tap to expand
Optional sender mailbox template. Omitted when unset.View headers detailsClick or tap to expand
Optional custom header templates. Delivery, routing, and authentication headers cannot be overridden.View reply_to detailsClick or tap to expand
Optional reply-to mailbox template. Omitted when unset.
Template expressions use {{variable_name}} for values, {{#if variable}}...{{else}}...{{/if}} for conditional text, and {{#each items as item}}...{{/each}} for arrays.
Design templates that render safely
Every reference must match a declared variable. Rendering rejects unknown input
fields, missing required values, invalid value types, and arrays with undeclared
item fields. date values use YYYY-MM-DD; datetime values use RFC 3339; URL
variables must be absolute HTTP or HTTPS URLs without embedded user credentials.
SMS output can contain at most 120 Unicode characters after variables are substituted. Email variables are escaped when inserted into HTML, while subjects, mailboxes, and custom header values reject line breaks and unsafe control characters. Email HTML accepts common message-layout elements but rejects scripts, event handlers, and unsafe link or image schemes. A preview succeeds only when the rendered email contains readable text and passes content safety checks.
Non-success responses return a top-level error object. Use its stable code
and fix_code fields to decide whether to change the template, refresh its state,
or wait before acting again; keep message and detail for humans.
Create a message template
Create a reusable SMS or email template. The new template starts as draft; publish it before using it in Chime sends, schedules, or broadcasts.
Request body
Response
Returns a top-level message_template object. Store message_template.id; it is the value Chime requests use as message_template.template_id.
Returns 200 when created, 400 for an invalid request or template, 401
when authorization fails, and 503 when the template could not be saved.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/create \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: mtpl-create-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{
"name": "Shipping update SMS",
"channel": "sms",
"purpose": "shipping_update",
"variables": [
{ "name": "customer_name", "type": "string", "required": true },
{ "name": "tracking_url", "type": "url", "required": true }
],
"sms": {
"message_template": "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}"
}
}'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.create({
name: "Shipping update SMS",
channel: "sms",
purpose: "shipping_update",
variables: [
{
name: "customer_name",
type: "string",
required: true,
},
{
name: "tracking_url",
type: "url",
required: true,
},
],
sms: {
messageTemplate: "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}",
},
}, {
idempotencyKey: "mtpl-create-shipping-sms-001",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.MessageTemplateCreateParams{
Name: "Shipping update SMS",
Channel: "sms",
Purpose: "shipping_update",
Variables: []inttegro.MessageTemplateVariable{
{
Name: "customer_name",
Type: "string",
Required: true,
},
{
Name: "tracking_url",
Type: "url",
Required: true,
},
},
SMS: &inttegro.MessageTemplateSMSContent{
MessageTemplate: "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}",
},
}
params.IdempotencyKey = "mtpl-create-shipping-sms-001"
result, err := client.MessageTemplates.Create(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.create(inttegro.message_templates.CreateSMSRequest(
name="Shipping update SMS",
channel="sms",
purpose="shipping_update",
variables=[
inttegro.message_templates.Variable(
name="customer_name",
type="string",
required=True,
),
inttegro.message_templates.Variable(
name="tracking_url",
type="url",
required=True,
),
],
sms=inttegro.message_templates.SMSContent(
message_template="Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}",
),
),
idempotency_key="mtpl-create-shipping-sms-001")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->create([
'name' => 'Shipping update SMS',
'channel' => 'sms',
'purpose' => 'shipping_update',
'variables' => [
[
'name' => 'customer_name',
'type' => 'string',
'required' => true,
],
[
'name' => 'tracking_url',
'type' => 'url',
'required' => true,
],
],
'sms' => [
'message_template' => 'Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}',
],
], "mtpl-create-shipping-sms-001");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.create(
name: "Shipping update SMS",
channel: "sms",
purpose: "shipping_update",
variables: [
{
name: "customer_name",
type: "string",
required: true,
},
{
name: "tracking_url",
type: "url",
required: true,
},
],
sms: {
message_template: "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}",
},
idempotency_key: "mtpl-create-shipping-sms-001"
)
import com.inttegro.Client;
import java.util.Map;
import java.util.List;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
Map<String, Object> params = Map.<String, Object>ofEntries(
Map.entry("name", "Shipping update SMS"),
Map.entry("channel", "sms"),
Map.entry("purpose", "shipping_update"),
Map.entry("variables", List.of(
Map.<String, Object>ofEntries(
Map.entry("name", "customer_name"),
Map.entry("type", "string"),
Map.entry("required", true)
),
Map.<String, Object>ofEntries(
Map.entry("name", "tracking_url"),
Map.entry("type", "url"),
Map.entry("required", true)
)
)),
Map.entry("sms", Map.<String, Object>ofEntries(
Map.entry("message_template", "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}")
))
);
var result = client.messageTemplates().create(params, RequestOptions.withIdempotencyKey("mtpl-create-shipping-sms-001"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.CreateAsync(new {
name = "Shipping update SMS",
channel = "sms",
purpose = "shipping_update",
variables = new[] {
new {
name = "customer_name",
type = "string",
required = true,
},
new {
name = "tracking_url",
type = "url",
required = true,
},
},
sms = new {
message_template = "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}",
},
}, "mtpl-create-shipping-sms-001");
Response
{
"message_template": {
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"name": "Shipping update SMS",
"channel": "sms",
"purpose": "shipping_update",
"locale": "en",
"status": "draft",
"version": 1,
"draft_version": 1,
"has_unpublished_changes": true,
"variables": [
{ "name": "customer_name", "type": "string", "required": true },
{ "name": "tracking_url", "type": "url", "required": true }
],
"sms": {
"message_template": "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}"
},
"created_at": "2026-06-22T10:30:00Z",
"updated_at": "2026-06-22T10:30:00Z"
}
}
Update a message template
Update mutable fields by replacing the current draft. The first edit after publication advances the draft version; later edits keep that same draft version until it is published. The published version remains stable until you publish the draft.
Request body
Response
Returns the updated message_template with has_unpublished_changes: true.
An empty about clears that field. Returns 200 when updated, 400 for an
invalid request or template, 401 when authorization fails, 404 when the
template does not exist, 409 when it is archived, and 503 when the changes
could not be saved.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/update \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: mtpl-update-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"sms": {
"message_template": "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}"
}
}'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.update({
id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
sms: {
messageTemplate: "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}",
},
}, {
idempotencyKey: "mtpl-update-shipping-sms-001",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.MessageTemplateUpdateParams{
ID: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
SMS: &inttegro.MessageTemplateSMSContent{
MessageTemplate: "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}",
},
}
params.IdempotencyKey = "mtpl-update-shipping-sms-001"
result, err := client.MessageTemplates.Update(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.update(inttegro.message_templates.UpdateRequest(
id="mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
sms=inttegro.message_templates.SMSContent(
message_template="Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}",
),
),
idempotency_key="mtpl-update-shipping-sms-001")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->update([
'id' => 'mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU',
'sms' => [
'message_template' => 'Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}',
],
], "mtpl-update-shipping-sms-001");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.update(
id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
sms: {
message_template: "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}",
},
idempotency_key: "mtpl-update-shipping-sms-001"
)
import com.inttegro.Client;
import java.util.Map;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
Map<String, Object> params = Map.<String, Object>ofEntries(
Map.entry("id", "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU"),
Map.entry("sms", Map.<String, Object>ofEntries(
Map.entry("message_template", "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}")
))
);
var result = client.messageTemplates().update(params, RequestOptions.withIdempotencyKey("mtpl-update-shipping-sms-001"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.UpdateAsync(new {
id = "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
sms = new {
message_template = "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}",
},
}, "mtpl-update-shipping-sms-001");
Publish a message template
Publish the current draft version. Chime sends, schedules, and broadcasts render only the published version.
Request body
Response
Returns the published message_template with status: "published" and has_unpublished_changes: false. Returns 200 when published, 400 for an invalid request, 401 when authorization fails, 404 when the template or draft version does not exist, 409 when it is archived, and 503 when publication could not be saved.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/publish \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: mtpl-publish-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.publish({
id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
}, {
idempotencyKey: "mtpl-publish-shipping-sms-001",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
result, err := client.MessageTemplates.Publish(ctx, "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", inttegro.WithIdempotencyKey("mtpl-publish-shipping-sms-001"))
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.publish(
"mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
idempotency_key="mtpl-publish-shipping-sms-001"
)
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->publish("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", "mtpl-publish-shipping-sms-001");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.publish(
template_id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
idempotency_key: "mtpl-publish-shipping-sms-001"
)
import com.inttegro.Client;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.messageTemplates().publish("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", RequestOptions.withIdempotencyKey("mtpl-publish-shipping-sms-001"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.PublishAsync("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", "mtpl-publish-shipping-sms-001");
Archive a message template
Archive a template so it cannot be updated, published, rendered, or used for new Chime sends. Archiving preserves the historical record and existing Chimes. Lookup and page requests continue to return the archived record; there is no unarchive operation.
Request body
Response
Returns the archived message_template. Returns 200 when archived, 400
for an invalid request, 401 when authorization fails, 404 when the
template does not exist, and 503 when the archived state could not be saved.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/archive \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: mtpl-archive-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.archive({
id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
}, {
idempotencyKey: "mtpl-archive-shipping-sms-001",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
result, err := client.MessageTemplates.Archive(ctx, "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", inttegro.WithIdempotencyKey("mtpl-archive-shipping-sms-001"))
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.archive(
"mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
idempotency_key="mtpl-archive-shipping-sms-001"
)
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->archive("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", "mtpl-archive-shipping-sms-001");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.archive(
template_id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
idempotency_key: "mtpl-archive-shipping-sms-001"
)
import com.inttegro.Client;
import com.inttegro.RequestOptions;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.messageTemplates().archive("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", RequestOptions.withIdempotencyKey("mtpl-archive-shipping-sms-001"));
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.ArchiveAsync("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU", "mtpl-archive-shipping-sms-001");
Look up a message template
Retrieve one template by ID. Use lookup before editing, publishing, or showing a template detail view in your dashboard.
Request body
Response
Returns the matching message_template. Returns 200 when found, 400 for
an invalid request, 401 when authorization fails, and 404 when no template
matches that ID.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.lookup({
id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
result, err := client.MessageTemplates.Lookup(ctx, "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU")
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.lookup("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU")
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->lookup("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU");
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.lookup(template_id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU")
import com.inttegro.Client;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
var result = client.messageTemplates().lookup("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU");
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.LookupAsync("mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU");
Page message templates
Retrieve a page of your templates, ordered by most recent update. Filter by channel, locale, purpose, or status when building an operator dashboard.
Request body
Response
Returns a top-level page object. number is the page number,
message_templates contains the returned records, and response size is the
number of records actually returned rather than the requested capacity.
Locale and purpose filters are applied to the selected page, so a response can
contain fewer records than the requested capacity even when later records
exist. Returns 200 for a page, 400 for an invalid request, 401 when
authorization fails, and 404 when the page could not be loaded.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/page \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "page": 1, "size": 25, "channel": "sms", "status": "published" }'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.page({
page: 1,
size: 25,
channel: "sms",
status: "published",
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.MessageTemplatePageParams{
Page: 1,
Size: 25,
Channel: "sms",
Status: "published",
}
result, err := client.MessageTemplates.Page(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.page(inttegro.message_templates.PageRequest(
page=1,
size=25,
channel="sms",
status="published",
))
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->page([
'page' => 1,
'size' => 25,
'channel' => 'sms',
'status' => 'published',
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.page(
page: 1,
size: 25,
channel: "sms",
status: "published"
)
import com.inttegro.Client;
import java.util.Map;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
Map<String, Object> params = Map.<String, Object>ofEntries(
Map.entry("page", 1),
Map.entry("size", 25),
Map.entry("channel", "sms"),
Map.entry("status", "published")
);
var result = client.messageTemplates().page(params);
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.PageAsync(new {
page = 1,
size = 25,
channel = "sms",
status = "published",
});
Response
{
"page": {
"number": 1,
"size": 1,
"message_templates": [
{
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"name": "Shipping update SMS",
"channel": "sms",
"purpose": "shipping_update",
"locale": "en",
"status": "published",
"version": 1,
"published_version": 1,
"draft_version": 1,
"has_unpublished_changes": false
}
]
}
}
Render a message template preview
Render a template with variables before sending. Preview rendering is draft-aware, so operators can check unpublished changes before publishing. Chime send, schedule, and broadcast requests still require a published version.
Request body
Response
Returns the template record plus rendered channel content. SMS previews return
rendered.sms.full_message. Email previews return attachments, channel,
and an email object containing the rendered from, headers, html,
reply_to, safety, subject, and text fields when applicable. Optional
fields are omitted rather than returned as null.
Returns 200 when rendered, 400 when the request, variables, rendered
length, or rendered content is invalid, 401 when authorization fails, 404
when the template or selected version does not exist, and 409 when the
template is archived.
Request
- cURL
- TypeScript
- Go
- Python
- PHP
- Ruby
- Java
- C#
curl https://api.inttegro.com/message_templates/render_preview \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message_template": {
"template_id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"variables": {
"customer_name": "Gloria",
"tracking_url": "https://track.example.com/OR-12345"
}
}
}'
import * as Inttegro from '@inttegro/inttegro-sdk'
const inttegro = new Inttegro.InttegroClient({
apiKey: process.env.INTTEGRO_API_KEY!,
})
const result = await inttegro.messageTemplates.renderPreview({
messageTemplate: {
templateId: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
variables: {
customer_name: "Gloria",
tracking_url: "https://track.example.com/OR-12345",
},
},
})
package main
import (
"context"
"log"
"os"
inttegro "github.com/zebodotdev/inttegro-sdk-go/v4"
)
func main() {
ctx := context.Background()
client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))
params := inttegro.MessageTemplateRenderPreviewParams{
MessageTemplate: inttegro.MessageTemplateReference{
TemplateID: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
Variables: map[string]any{
"customer_name": "Gloria",
"tracking_url": "https://track.example.com/OR-12345",
},
},
}
result, err := client.MessageTemplates.RenderPreview(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}
import os
import inttegro
client = inttegro.InttegroClient(api_key=os.environ["INTTEGRO_API_KEY"])
result = client.message_templates.render_preview(inttegro.message_templates.RenderPreviewRequest(
message_template=inttegro.MessageTemplateReferenceInput(
template_id="mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
variables={
"customer_name": "Gloria",
"tracking_url": "https://track.example.com/OR-12345",
},
),
))
<?php
use Inttegro\Client;
$client = new Client($_ENV['INTTEGRO_API_KEY']);
$result = $client->messageTemplates->renderPreview([
'message_template' => [
'template_id' => 'mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU',
'variables' => [
'customer_name' => 'Gloria',
'tracking_url' => 'https://track.example.com/OR-12345',
],
],
]);
require "inttegro"
client = Inttegro::Client.new(api_key: ENV.fetch("INTTEGRO_API_KEY"))
result = client.message_templates.render_preview(
message_template: {
template_id: "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
variables: {
customer_name: "Gloria",
tracking_url: "https://track.example.com/OR-12345",
},
}
)
import com.inttegro.Client;
import java.util.Map;
public class Example {
public static void main(String[] args) throws Exception {
var client = new Client(System.getenv("INTTEGRO_API_KEY"));
Map<String, Object> params = Map.<String, Object>ofEntries(
Map.entry("message_template", Map.<String, Object>ofEntries(
Map.entry("template_id", "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU"),
Map.entry("variables", Map.<String, Object>ofEntries(
Map.entry("customer_name", "Gloria"),
Map.entry("tracking_url", "https://track.example.com/OR-12345")
))
))
);
var result = client.messageTemplates().renderPreview(params);
}
}
using Inttegro;
using var inttegro = new InttegroClient(
Environment.GetEnvironmentVariable("INTTEGRO_API_KEY")!
);
var result = await inttegro.MessageTemplates.RenderPreviewAsync(new {
message_template = new {
template_id = "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
variables = new {
customer_name = "Gloria",
tracking_url = "https://track.example.com/OR-12345",
},
},
});
Response
{
"message_template": {
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"name": "Shipping update SMS",
"channel": "sms",
"status": "published",
"published_version": 1,
"draft_version": 1
},
"rendered": {
"channel": "sms",
"sms": {
"full_message": "Hi Gloria, your order shipped. Track it: https://track.example.com/OR-12345"
}
}
}
Related resources
- Send chime - Send one notification with an inline or stored template.
- Schedule chime - Schedule notifications with stored template rendering.
- Broadcast chimes - Send one rendered template to a same-channel audience.