Skip to main content
PUT
/
templates
/
{templateId}
curl --request PUT \
  --url https://api.autosend.com/v1/templates/A-abc123def456ghi789jk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "templateName": "Updated Welcome Email",
  "subject": "Welcome aboard, {{firstName}}!",
  "emailTemplate": "<h1>Hey {{firstName}}!</h1><p>We are excited to have you at {{companyName}}.</p>",
  "previewText": "Your journey starts here"
}'
{
  "success": true,
  "data": {
    "templateId": "A-abc123def456ghi789jk",
    "templateName": "Updated Welcome Email",
    "description": "Welcome email for new users",
    "subject": "Welcome aboard, {{firstName}}!",
    "previewText": "Your journey starts here",
    "emailTemplate": "<h1>Hey {{firstName}}!</h1><p>We are excited to have you at {{companyName}}.</p>",
    "templateType": "transactional",
    "builderType": "code",
    "createdAt": "2026-01-15T10:30:00.000Z",
    "updatedAt": "2026-03-17T14:45:00.000Z"
  }
}
curl --request PUT \
  --url https://api.autosend.com/v1/templates/A-abc123def456ghi789jk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "templateName": "Updated Welcome Email",
  "subject": "Welcome aboard, {{firstName}}!",
  "emailTemplate": "<h1>Hey {{firstName}}!</h1><p>We are excited to have you at {{companyName}}.</p>",
  "previewText": "Your journey starts here"
}'
{
  "success": true,
  "data": {
    "templateId": "A-abc123def456ghi789jk",
    "templateName": "Updated Welcome Email",
    "description": "Welcome email for new users",
    "subject": "Welcome aboard, {{firstName}}!",
    "previewText": "Your journey starts here",
    "emailTemplate": "<h1>Hey {{firstName}}!</h1><p>We are excited to have you at {{companyName}}.</p>",
    "templateType": "transactional",
    "builderType": "code",
    "createdAt": "2026-01-15T10:30:00.000Z",
    "updatedAt": "2026-03-17T14:45:00.000Z"
  }
}

Authorizations

Authorizations
string | header
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

templateId
string
required
The unique identifier of the template to update.Example: "A-abc123def456ghi789jk"

Body

Template fields to update. All fields are optional — only provided fields will be updated.
templateName
string
Name of the template (max 90 characters).Maximum length: 90Example: "Updated Welcome Email"
subject
string
Email subject line (max 988 characters). Supports Handlebars template variables.Maximum length: 988Example: "Welcome aboard, {{firstName}}!"
description
string
Short description of the template (max 140 characters).Maximum length: 140Example: "Updated welcome email for new users"
previewText
string
Email preview text / preheader (max 140 characters).Maximum length: 140Example: "Your journey starts here"
emailTemplate
string
HTML content of the email template. Supports Handlebars syntax for dynamic variables.Example:
<h1>Hey {{firstName}}!</h1>
<p>We are excited to have you at {{companyName}}.</p>
templateType
string
Type of the template.Allowed values: transactional, marketingExample: "transactional"
dynamicVariables
object
Dynamic variables configuration for the template.Example:
{
  "firstName": "string",
  "companyName": "string"
}
senderId
string
ID of the sender to associate with this template. The sender must belong to the same project.Example: "60d5ec49f1b2c72d9c8b4567"

Response

Template updated successfully
success
boolean
Indicates if the request was successfulExample: true
data
object
The updated template object