Email Templates
Email templates hold a subject line, HTML content, and performance stats like open and click rates. They are used in sequences, workflows, and broadcasts. Use this API to fetch template details and update template content.
Available Endpoints
- GET
/fetch/emails/templates/:idGet Email Template
Fetch one template with HTML and stats.
- PATCH
/fetch/emails/templates/:idUpdate Email Template
Update the subject or HTML for one template.
The Email Template Model
The email template model represents a reusable email with its content and performance statistics.
Properties
- Name
idinteger- Description
The unique identifier for the template
- Name
namestring- Description
The name of the template
- Name
subjectstring- Description
The email subject line
- Name
htmlstring- Description
The HTML content of the email
- Name
created_atdatetime- Description
When the template was created
- Name
statsobject- Description
Performance statistics including open_rate and click_rate
Get Email Template
/v1/fetch/emails/templates/:idRetrieves a single email template by its ID, including the full HTML content and performance statistics.
Path Parameters
- Name
idintegerRequired- Description
The template ID
Query Parameters
- Name
site_uuidstringRequired- Description
Your site's unique identifier
Response
Returns the email template with its full content and stats.
- Name
data.idinteger- Description
Email template ID.
- Name
data.typestring- Description
Resource type, typically
email_template.
- Name
data.attributes.namestring- Description
Template name.
- Name
data.attributes.subjectstring- Description
Template subject line.
- Name
data.attributes.htmlstring- Description
Template HTML.
- Name
data.attributes.statsobject|null- Description
Performance stats when available.
Update Email Template
/v1/fetch/emails/templates/:idUpdates an existing email template. You can update the subject line, HTML content, editor type, or any combination.
type, the template keeps its current editor.Path Parameters
- Name
idintegerRequired- Description
The template ID
Query Parameters
- Name
site_uuidstringRequired- Description
Your site's unique identifier
Request Body
- Name
email_template.subjectstring- Description
The new email subject line (optional)
- Name
email_template.htmlstring- Description
The new HTML content (optional)
- Name
email_template.typestring- Description
The editor type.
plainfor Bento's CSS orrawto use your own HTML (optional)
Response
Returns the updated email template.
- Name
data.idinteger- Description
Updated email template ID.
- Name
data.attributes.subjectstring- Description
Updated subject line.
- Name
data.attributes.htmlstring- Description
Updated HTML content.