Get template info
Description
Retrieves a single message template information.
Request URL
Method: POST
https://example.com/api/v1.1/templates/get
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| format | string | "json" | No | Response data format. By default – json |
| id | int | 1 | Yes | Template ID |
| channel_sid | array of strings | ["email", "sms", "cc_channel"] | No | Channel filter. If specified, returns only templates for the specified channels. By default - empty array (all channels) |
| get_variable | boolean | true | No | If true, the response includes a list of variables (params) used in the template. By default - false |
Available variable types
Profile data
lead.fname, lead.lname, lead.email, lead.phone
lead.birthdate, lead.gender, lead._city, lead._country
lead._xxh, lead_custom.*
Parameters
campid, workflow_id, workflow_name, msg_type
attribute_value.*, node_id
Date and time
datenow, yearlong, hourse, minutes, ampm
Apicontent variables
apicontent.field_1, apicontent.field_2, apicontent.field_N
Segmentation
segname
Learn more about template variables in this article.
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 1,
"channel_sid": ["email", "sms", "cc_channel"],
"get_variable": true
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>1</id>
<channel_sid>email</channel_sid>
<channel_sid>sms</channel_sid>
<channel_sid>cc_channel</channel_sid>
<get_variable>true</get_variable>
</xml>
Response example
- JSON
- XML
{
"data": {
"id": 1,
"updated_user": "example_user",
"update_time": "2025-05-21T09:17:53.362Z",
"name": "example template name",
"description": "example template description",
"channels": [
{
"id": 1,
"sid": "email",
"fields": {
"text": "example text version",
"html": "example html content",
"subject": "example subject",
"from_email": "example@example.com",
"from_name": "example from name",
"replyto_email": "reply@example.com",
"replyto_name": "example reply name",
"is_not_inline": true,
"attach": []
},
"params": [
"lead.fname",
"datenow",
"segname",
"apicontent.field_name",
"workflow_name"
],
"presets": null
},
{
"id": 2,
"sid": "sms",
"fields": {
"sms": "example sms content",
"sms_max_count": 0,
"add_sms_url_scheme": false
},
"params": [
"lead.fname",
"datenow",
"segname",
"apicontent.field_name",
"workflow_name"
],
"presets": null
}
],
"json_url": "https://example.com/examples/message.json",
"is_draft": true,
"is_confirm": true,
"ui_tags": [
"example_tag_1",
"example_tag_2"
],
"groups": [
{
"id": 2,
"name": "example_group_1"
},
{
"id": 3,
"name": "example_group_2"
}
],
"suppress_id": 1
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<id>1</id>
<updated_user>example_user</updated_user>
<update_time>2025-05-21T09:17:53.362Z</update_time>
<name>example template name</name>
<description>example template description</description>
<channels>
<id>1</id>
<sid>email</sid>
<fields>
<text>example text version</text>
<html>example html content</html>
<subject>example subject</subject>
<from_email>example@example.com</from_email>
<from_name>example from name</from_name>
<replyto_email>reply@example.com</replyto_email>
<replyto_name>example reply name</replyto_name>
<is_not_inline>true</is_not_inline>
<attach array='true'></attach>
</fields>
<params>lead.fname</params>
<params>datenow</params>
<params>segname</params>
<params>apicontent.field_name</params>
<params>workflow_name</params>
<presets></presets>
</channels>
<channels>
<id>2</id>
<sid>sms</sid>
<fields>
<sms>example sms content</sms>
<sms_max_count>0</sms_max_count>
<add_sms_url_scheme>false</add_sms_url_scheme>
</fields>
<params>lead.fname</params>
<params>datenow</params>
<params>segname</params>
<params>apicontent.field_name</params>
<params>workflow_name</params>
</channels>
<json_url>https://example.com/examples/message.json</json_url>
<is_draft>true</is_draft>
<is_confirm>true</is_confirm>
<ui_tags>example_tag_1</ui_tags>
<ui_tags>example_tag_2</ui_tags>
<groups>
<id>2</id>
<name>example_group_1</name>
</groups>
<groups>
<id>3</id>
<name>example_group_2</name>
</groups>
<suppress_id>1</suppress_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| id | int | Template ID |
| name | string | Template name |
| description | string | Template description |
| channels | array of objects | Template settings data for each channel |
| channels[].id | int | Channel ID in template |
| channels[].sid | string | System channel identifier (email, sms, push, etc.) |
| channels[].fields | object | Template content settings for channel |
| channels[].params | array of strings | List of variables used in the template. Returned only when get_variable: true in request. |
| channels[].presets | object|null | Preset channel settings |
| json_url | string | Dynamic JSON URL |
| is_draft | bool | Draft template flag. If this is a draft, the template cannot be sent. |
| is_confirm | bool | Confirm subscription link flag. Is there a confirmation link in the body of the email or not. |
| ui_tags | []String | List of tags to search |
| groups | array of objects | List of groups |
| suppress_id | int | Suppression list ID |
| updated_user | string | By whom the template was updated |
| update_time | string | When the template was updated |