Skip to main content
GET
/
template
/
email
/
{identifier}
Get template by ID
curl --request GET \
  --url https://api.sendx.io/api/v1/rest/template/email/{identifier} \
  --header 'X-Team-ApiKey: <api-key>'
import requests

url = "https://api.sendx.io/api/v1/rest/template/email/{identifier}"

headers = {"X-Team-ApiKey": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-Team-ApiKey': '<api-key>'}};

fetch('https://api.sendx.io/api/v1/rest/template/email/{identifier}', 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.sendx.io/api/v1/rest/template/email/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Team-ApiKey: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.sendx.io/api/v1/rest/template/email/{identifier}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-Team-ApiKey", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.sendx.io/api/v1/rest/template/email/{identifier}")
.header("X-Team-ApiKey", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sendx.io/api/v1/rest/template/email/{identifier}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Team-ApiKey"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": "template_abc123def456ghi789",
  "name": "Welcome Email Template",
  "subject": "Welcome to our platform!",
  "htmlCode": "<html><body><h1>Welcome!</h1></body></html>",
  "templateCode": "{\"blocks\":[{\"type\":\"text\",\"content\":\"Welcome!\"}]}",
  "type": 0,
  "thumbnail": "https://cdn.sendx.io/templates/thumb_abc123.png",
  "editorType": 1,
  "created": "2024-01-10T14:20:00Z",
  "updated": "2024-01-15T09:15:00Z"
}
{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}
{
"status": "error",
"message": "Resource not found"
}
{
"status": "error",
"message": "Internal server error occurred"
}
📧 Template Details Include:
  • Complete HTML and template code
  • Editor type and capabilities
  • Template preview and thumbnail
🔧 Developer Integration:
  • Use for template preview in campaign builder
  • Load template for editing/duplication
  • Access template metadata for UI display
🎯 Common Use Cases:
  • Campaign template selection
  • Template editing interface
  • Template preview modal
  • Template duplication workflow

Authorizations

X-Team-ApiKey
string
header
required

Team API key for authentication. Find your API key in SendX Settings → Team API Key.

Example:

X-Team-ApiKey: your_team_api_key_here

Path Parameters

identifier
string
required

The unique template identifier.

  • template_f3lJvTEhSjKGVb5Lwc5SWS - Standard prefixed ID
Pattern: ^(template_)?[a-zA-Z0-9]{22}$
Example:

"template_f3lJvTEhSjKGVb5Lwc5SWS"

Response

✅ Template retrieved successfully

id
string

Unique template identifier with template_ prefix

Pattern: ^template_[a-zA-Z0-9]{22}$
Example:

"template_abc123def456ghi789"

name
string

Name of the template

Example:

"Welcome Email Template"

subject
string | null

Email subject line (if applicable)

Example:

"Welcome to our platform!"

htmlCode
string

HTML content of the template

Example:

"<html><body><h1>Welcome!</h1></body></html>"

templateCode
string | null

Template code for visual editors (JSON structure)

Example:

"{\"blocks\":[{\"type\":\"text\",\"content\":\"Welcome!\"}]}"

type
integer

Template type.

Values:

  • 0 - Email template
  • 1 - Other types
Example:

0

thumbnail
string | null

URL to template thumbnail image

Example:

"https://cdn.sendx.io/templates/thumb_abc123.png"

editorType
integer

Editor type used to create the template.

Values:

  • 0 - PlainText
  • 1 - DragDrop
  • 2 - SendxEditor
Example:

1

created
string<date-time>

Template creation timestamp

Example:

"2024-01-10T14:20:00Z"

updated
string<date-time>

Template last update timestamp

Example:

"2024-01-15T09:15:00Z"