POST emails/save

Save content and header information for an email. Can pass an email object (i.e. response from /emails/lookup) or just key/value pairs.

* required

Parameters

Name Type Description
emailID integer Unique ID of email
templateID integer ID of template used by email. Set htmlVersionEditable property to true to provide full HTML Version without using a template
userID integer ID of system user email belongs to
title string Title of email (for internal use)
subject string Subject of email
fromName string Name used in From header
fromAddress email-address Email address used in From header
replyToName string Name used in Reply-to header
replyToAddress email-address Email address used in Reply-to header
recipients struct
contactIDs array[integer] Contacts assigned to receive email
excludeGroupIDs array[integer] Exclude contacts in these groups from receiving email
groupIDs array[integer] Groups assigned to receive email
content struct
body_slot1...body_slot10 string Content for email template slots (1 to 10)
htmlHead string Markup that will be placed in the <head> of the HTML version. Only applies to emails using a template that has the htmlHeadEditable property set to true.
htmlVersion string HTML version of email. Auto-generated by default using template in conjunction with body_slot* and htmlHead properties. If htmlVersionEditable==true, user can manually set (no template is used)
textVersion string Text version of email. Auto-generated by default, but can be manually set
htmlVersionEditable boolean If true, no template is used and user provides the full HTML version of email (see htmlVersion property). The HTML Version must contain the unsubscribe link variable: $$url[unsubscribe]. The value of htmlVersionEditable cannot be changed on an existing email.
0

Response Data

Returns a full representation of an email (same as when doing a lookup)
Name Type Description
approval struct
approvalsCurrent integer Number of users who have approved email
approvalsNeeded integer Number of users who must approve email
approved boolean Overall approved status
requiresApproval boolean Indicates if email requires approval (can vary based on user and template settings)
users array Array of structs containing approval data per user
automation struct Automation settings. Automated emails cannot be managed via the API at this time.
active boolean Is automation active?
recipientDelay integer Delay (in minutes) before contacts will receive email
schedule array Array of structs with daily schedule details. e.g. [{"dayOfWeek":1,"scheduledSendTime": "07:00:00"},{"dayOfWeek":2,"scheduledSendTime": "07:00:00"},etc...]
content struct
body_slot1...body_slot10 string Content for email template slots (1 to 10)
htmlHead string Markup that will be placed in the <head> of the HTML version. Only applies to emails using a template that has the htmlHeadEditable property set to true.
htmlVersion string HTML version of email. Auto-generated by default using template in conjunction with body_slot* and htmlHead properties. If htmlVersionEditable==true, user can manually set (no template is used)
textVersion string Text version of email. Auto-generated by default, but can be manually set
dateAdded datetime Date record was added
dateModified datetime Date record was modified
dateSent datetime Date email was sent
deliveryType string How email gets delivered. One of: Manual, Automated, Transactional
emailID integer Unique ID of email
fromAddress string Email address used in From header
fromName string Name used in From header
htmlVersionEditable boolean If true, no template is used and user provides the full HTML version of email (see htmlVersion property). The HTML Version must contain the unsubscribe link variable: $$url[unsubscribe]. The value of htmlVersionEditable cannot be changed on an existing email.
ignoreContactSuppression boolean Indicates whether or not suppressed contacts can receive the email. Applies to transactional emails only.
metrics struct Summary deliverability metrics
bounces integer Total number of bounces
clicks integer Total number of clicks
clickToViewRate decimal Percentage of unique contacts who viewed the email and also clicked (unique views / unique clicks)
complaints integer Total number of spam complaints
forwards integer Total number of forwards (forward-to-friend)
recipients integer Total email recipients
shares integer Total number of shares
uniqueClicks integer Unique contacts that clicked a link
uniqueForwards integer Unique contacts that forwarded email
uniqueShares integer Unique contacts that shared email
uniqueViews integer Unique contacts that viewed email
uniqueWebViews integer Unique contacts that viewed as a web page
unsubscribes integer Total number of unsubscribes
views integer Total number of views
webViews integer Total number of web views
parentEmailID integer ID of parent email record (for automated emails)
recipients struct
contactIDs array[integer] Contacts assigned to receive email
excludeGroupIDs array[integer] Exclude contacts in these groups from receiving email
groupIDs array[integer] Groups assigned to receive email
replyToAddress string Email address used in Reply-to header
replyToName string Name used in Reply-to header
schedule struct
confirmed boolean Is schedule delivery confirmed?
dateScheduled datetime Date/time of scheduled delivery
status string Current status of email delivery. One of: Draft, Sent, Scheduled
subject string Subject of email
templateID integer ID of template used by email. Set htmlVersionEditable property to true to provide full HTML Version without using a template
title string Title of email (for internal use)
userID integer ID of system user email belongs to

Permissions

Method requires the Compose Mail permission

Example Calls

Create email using template

New emails must have at least the following defined: templateID,subject,fromName,fromAddress

POST
/emails/save
cURL
Copy
Response Data

Create email without a template

When not using a template, set htmlVersionEditable=1 and set htmlVersion to the full HTML document

POST
/emails/save
cURL
Copy
Response Data

Update single email property

Updates can pass in just the changes

POST
/emails/save
cURL
Copy
Response Data

Update email using object

Updates can pass in a fully populated email object. An email object can be obtained by calling emails/lookup. They are also returned after a save operation.

POST
/emails/save
cURL
Copy
Response Data

API Console

The console uses production data, so BE CAREFUL!
POST
emails/save
Request Body
{"fromAddress":"","htmlVersionEditable":0,"fromName":"","templateID":0,"userID":0,"replyToName":"","subject":"","title":"","content":{},"recipients":{},"emailID":0,"replyToAddress":""}
Access token: *