Skip to main content
PUT
/
template
/
email
/
{identifier}
Update template
curl --request PUT \
  --url https://api.sendx.io/api/v1/rest/template/email/{identifier} \
  --header 'Content-Type: application/json' \
  --header 'X-Team-ApiKey: <api-key>' \
  --data '{
  "name": "Welcome Email Template",
  "htmlCode": "<string>",
  "templateCode": "<string>",
  "editorType": 123
}'
{
"name": "Weekly Newsletter Template v2",
"htmlCode": "<html><head><style>.newsletter{max-width:650px;margin:0 auto;font-family:'Helvetica Neue',Arial,sans-serif}.header{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:white;padding:30px;text-align:center}</style></head><body><div class=\"newsletter\"><div class=\"header\"><h1>{{company.name}}</h1><p>Your Weekly Digest</p></div><div class=\"content\">{{email.content}}</div></div></body></html>",
"templateCode": "{}",
"editorType": 1
}
🔧 Update Capabilities:
  • Modify template name and content
  • Change HTML code and template structure
  • Update editor type (with validation)
⚠️ Important Considerations:
  • Editor type changes may affect template compatibility
  • Active campaigns using this template will use cached version
  • Thumbnails are regenerated automatically
🎯 Common Update Scenarios:
  • Fix template bugs or styling issues
  • Update branding or design elements
  • Add new template variables or sections
  • Optimize template for mobile devices

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 to update.

  • template_f3lJvTEhSjKGVb5Lwc5SWS
Example:

"template_f3lJvTEhSjKGVb5Lwc5SWS"

Body

application/json
name
string
required

Template name

Example:

"Welcome Email Template"

htmlCode
string

HTML email content

templateCode
string

Template code for the selected template type

editorType
integer

Editor type used to create the template.

Values:

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

Response

✅ Template updated successfully

id
string

Unique template identifier with template_ prefix

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"

I