Skip to content

API reference

Emails

API endpoints for sending and fetching emails on Waypoint.

Send with a template

Send an email message through a Waypoint template. Data variables are used to populate the template.

Request

POST /v1/email_messages
PropertyDescription
templateIdRequired The id of the template you want to send (created on the Waypoint dashboard). You can find the template ID from on each template from your templates page or grab it from the template URL. eg. wptemplate_ABc123XYZ
toRequired Email address of the receiver(s). It can be an email address or use the “Display Name <email address>” format (this will also set the ‘name’ field on your contacts). Separate multiple email addresses in comma separated string for multiple emails (eg. “joe@example.com, jane@example.com”). Max 50 recipients per message.
variablesTemplate variables JSON.
fromEmail address of the sender. This will override a sender that has been set from the template builder and the email domain must be a verified domain within your workspace. Email address can be a string or with a name with email using the “Display Name <email address>” format.
replyToEmail address where replies will be sent. By default, replies are sent to the original sender’s email address.
ccEmail address of the receiver(s) that should be CC’d. Use the same format as ‘to’ attribute.
bccEmail address of the receiver(s) that should be BCC’d. Use the same format as ‘to’ attribute.
metaIdID used for idempotent requests or internal reference. Eg. ‘order_1234’.
attachmentsArray of attachment objects with ‘name’ (filename), ‘contentBlob’ (Base64-encoded string), and ‘contentType’ (MIME content type).
groupIdUnsubscribe group ID
groupKeyUnsubscribe group custom key
const axios = require('axios');
axios({
method: "post",
url: "https://live.waypointapi.com/v1/email_messages",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"templateId": "wptemplate_ABc123XYZ",
"to": "jordan@usewaypoint.com",
"variables": {
"user": {
"displayName": "Jordan",
}
"product": {
"title": "Beechers Mac & Cheese",
"id": "02934203942"
}
}
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Send without a template

Send an email message without a template by passing in the raw HTML body content.

Request

POST /v1/email_messages
PropertyDescription
bodyHtmlRequired HTML body content.
bodyTextPlain text body content.
subjectSubject line of the email.
toRequired Email address of the receiver(s). It can be an email address or use the “Display Name <email address>” format (this will also set the ‘name’ field on your contacts). Separate multiple email addresses in comma separated string for multiple emails (eg. “joe@example.com, jane@example.com”). Max 50 recipients per message.
fromRequired Email address of the sender. The email domain must be a verified domain within your workspace. It can be an email address string or with a name with email using the “Display Name <email address>” format.
replyToEmail address where replies will be sent. By default, replies are sent to the original sender’s email address.
ccEmail address of the receiver(s) that should be CC’d. Use the same format as ‘to’ attribute.
bccEmail address of the receiver(s) that should be BCC’d. Use the same format as ‘to’ attribute.
metaIdID used for idempotent requests or internal reference. Eg. ‘order_1234’.
attachmentsArray of attachment objects with ‘name’ (filename), ‘contentBlob’ (Base64-encoded string), and ‘contentType’ (MIME content type). Learn more.

Send batch emails

Sending a weekly report, product update, or recommendations email? Create a batch email to send multiple emails with highly personalized content with a single API call.

Want to add an unsubscribe link to each email? Learn more in unsubscribe groups.

Request

POST /v1/email_messages_batch
PropertyDescription
emailMessagesAn array of email messages (either with a template or without).
const axios = require('axios');
axios({
method: "post",
url: "https://live.waypointapi.com/v1/email_messages_batch",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"emailMessages": [{
"templateId": "wptemplate_RXL7zGTGsvkXzAP3",
"to": "Jordan Isip <jordan@usewaypoint.com>",
"variables": {
"username": "fixie"
}
}, {
"templateId": "wptemplate_RXL7zGTGsvkXzAP3",
"to": "Carlos Rodriguez <jordan@usewaypoint.com>",
"variables": {
"username": "cohitre"
}
}]
}
})
.then(function(response) {
// handle success
console.log('success');
})
.catch(function(error) {
// handle error
console.log(error.response.data);
})

Send test email

Test emails can be sent from your application’s dev/test environments by including sandbox in the path of the API call.

Emails sent with this sandbox flag will prevent the actual delivery of the email to the address in the ‘to’ field and the resulting email inputs and outputs will simply be stored on the your workspace’s activity logs for debugging and review.

Request

POST /v1/sandbox/email_messages

This sandbox endpoint the same properties as v1/email_messages

const axios = require('axios');
axios({
method: "post",
url: "https://live.waypointapi.com/v1/sandbox/email_messages",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"templateId": "wptemplate_ABc123XYZ",
"to": "jordan@usewaypoint.com",
"variables": {
"user": {
"displayName": "Jordan",
}
"product": {
"title": "Beechers Mac & Cheese",
"id": "02934203942"
}
}
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Send test batch emails

Matching sandbox endpoint for batch email sending.

Request

POST /v1/sandbox/email_messages_batch

This sandbox endpoint the same properties as v1/email_messages_batch

const axios = require('axios');
axios({
method: "post",
url: "https://live.waypointapi.com/v1/sandbox/email_messages_batch",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"emailMessages": [{
"templateId": "wptemplate_RXL7zGTGsvkXzAP3",
"to": "Jordan Isip <jordan@usewaypoint.com>",
"variables": {
"username": "fixie"
}
}, {
"templateId": "wptemplate_RXL7zGTGsvkXzAP3",
"to": "Carlos Rodriguez <carlos@usewaypoint.com>",
"variables": {
"username": "cohitre"
}
}]
}
})
.then(function(response) {
// handle success
console.log('success');
})
.catch(function(error) {
// handle error
console.log(error.response.data);
})

Retrieve email

Get the details of an email message with it’s delivery statuses and other metadata.

Request

GET /v1/sandbox/email_messages/EMAIL_MESSAGE_ID
PropertyDescription
EMAIL_MESSAGE_IDWaypoint email message ID
const axios = require('axios');
axios({
method: 'get',
url: 'https://live.waypointapi.com/v1/email_messages/em_2HxzWrrkPo4V4cXR',
headers: {
'Content-Type': 'application/json'
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
}
})
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Response

{
"data": {
"id": "em_2HxzWrrkPo4V4cXR",
"type": "EmailMessage",
"createdAt": "2024-12-31T14:58:36.962Z",
"updatedAt": "2024-12-31T15:19:51.765Z",
"source": "API",
"status": "SUCCEEDED",
"processedAt": null,
"waypointTemplateId": "wptemplate_WVWNrT7e2yFhnnMv",
"variables": {
"message": "hello world"
},
"to": [
"\"Carlos Rodriguez\" <carlos@usewaypoint.com>"
],
"cc": [],
"bcc": [],
"from": "Waypoint <support@usewaypoint.com>",
"replyTo": "",
"sentAt": "2024-12-31T14:58:43.781Z",
"deliveredAt": "2024-12-31T14:58:45.076Z",
"firstOpenedAt": "2024-12-31T14:58:45.727Z",
"lastOpenedAt": "2024-12-31T15:19:51.609Z",
"firstClickedAt": null,
"lastClickedAt": null,
"firstComplainedAt": null,
"lastComplainedAt": null,
"firstBouncedAt": null,
"lastBouncedAt": null,
"erroredAt": null,
"lastSuppressedAt": null,
"lastUnsubscribedAt": null
}
}
PropertyDescription
IDThe Waypoint message ID.
typeThe type of the message.
createdAtTimestamp of when the message was created.
updatedAtTimestamp of when the message was last updated.
sourceHow the message was created: PREVIEW, API, SANDBOX_API, WORKFLOW, SANDBOX_WORKFLOW, BATCH, SANDBOX_BATCH
statusMessage status: PENDING, SUCCEEDED, PAUSED, FAILED, DELETED
processedAtTimestamp of when the message was processed.
waypointTemplateIdThe associated template ID if sent with a template.
variablesObject with any template variables that were passed in while triggering the email.
toArray of email addresses the message was sent to.
ccArray of email addresses that were CC’d on this message.
bccArray of email addresses that were BCC’d on this message.
from’From’ email address set for this message.
replyTo’Reply to’ email address set for this message.
sentAtTimestamp for when the message was sent by Waypoint.
deliveredAtTimestamp for when the message was first received by the recipient’s email server.
firstOpenedAtTimestamp for when the message was first opened.
lastOpenedAtTimestamp for when the message was last opened.
firstClickedAtTimestamp for when a link on a message was first clicked.
lastClickedAtTimestamp for when a link on a message was last clicked.
firstComplainedAtTimestamp for when the message first received a complaint.
lastComplainedAtTimestamp for when the message last received a complaint.
firstBouncedAtTimestamp for when the message first received a bounce.
lastBouncedAtTimestamp for when the message last received a bounce.
erroredAtTimestamp for when the message ran into an error and didn’t send.
lastSupressedAtTimestamp for when the message was supressed by an unsubscribe group.
lastUnsubscribedAtTimestamp for when a contact unsubscribed from a message unsubscribe group link.

Retrieve email events

Get the delivery timeline events from an email message.

Request

POST /v1/email_messages/EMAIL_MESSAGE_ID/events
PropertyDescription
EMAIL_MESSAGE_IDWaypoint email message ID.
const axios = require('axios');
axios({
method: 'get',
url: 'https://live.waypointapi.com/v1/email_messages/em_2HxzWrrkPo4V4cXR/events',
headers: {
'Content-Type': 'application/json'
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
}
})
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Response

{
"meta": {
"count": 5,
"page": 1,
"limit": 50
},
"data": [
{
"id": "log_Davifvij7cBN96r9",
"type": "EmailMessageLog",
"createdAt": "2024-08-23T18:10:21.868Z",
"updatedAt": "2024-08-23T18:10:21.868Z",
"code": "EMAIL_MESSAGE_OPEN_SES_EVENT",
"message": "Email was opened by a recipient at IP address 66.249.91.165. User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246 Mozilla/5.0"
},
{
"id": "log_8MXy5akcYqwXL7YJ",
"type": "EmailMessageLog",
"createdAt": "2024-08-23T18:10:20.215Z",
"updatedAt": "2024-08-23T18:10:20.215Z",
"code": "EMAIL_MESSAGE_DELIVERED_SES_EVENT",
"message": "Email successfully delivered to jordan@usewaypoint.com. Delivery time: 10 seconds."
},
{
"id": "log_YcTNPR5MYjRpaEh8",
"type": "EmailMessageLog",
"createdAt": "2024-08-23T18:10:19.184Z",
"updatedAt": "2024-08-23T18:10:19.184Z",
"code": "EMAIL_MESSAGE_SENT_SES_EVENT",
"message": "Email was sent."
},
{
"id": "log_nUHH2sZVhZhkKb5N",
"type": "EmailMessageLog",
"createdAt": "2024-08-23T18:10:19.147Z",
"updatedAt": "2024-08-23T18:10:19.147Z",
"code": "EMAIL_MESSAGE_RENDERED",
"message": "Email was processed by Waypoint."
},
{
"id": "log_DkonKJ4aLgJS6Kgr",
"type": "EmailMessageLog",
"createdAt": "2024-08-23T18:10:19.032Z",
"updatedAt": "2024-08-23T18:10:19.032Z",
"code": "EMAIL_MESSAGE_CREATED",
"message": "Email message was created."
}
]
}

A data object with an array of email message event objects containing:

PropertyDescription
IDThe Waypoint message event ID.
typeThe type of the message event.
createdAtTimestamp of when the message event was created.
updatedAtTimestamp of when the message event was last updated.
codeStatus code of the message event (see below).
messageDescription and additional details the event.

Status codes:

  • EMAIL_MESSAGE_BOUNCE_SES_EVENT
  • EMAIL_MESSAGE_CLICKED_SES_EVENT
  • EMAIL_MESSAGE_COMPLAINT_SES_EVENT
  • EMAIL_MESSAGE_CONTACT_UNSUBSCRIBED
  • EMAIL_MESSAGE_CREATED
  • EMAIL_MESSAGE_DELIVERED_SES_EVENT
  • EMAIL_MESSAGE_EMPTY_RECIPIENTS_ERROR
  • EMAIL_MESSAGE_INVALID_PARAMETER_ERROR
  • EMAIL_MESSAGE_INVALID_RECIPIENTS_ERROR
  • EMAIL_MESSAGE_INVALID_SENDER_ERROR
  • EMAIL_MESSAGE_INVALID_TEST_MODE_RECIPIENT_ERROR
  • EMAIL_MESSAGE_OPEN_SES_EVENT

Retrieve email batch

Get a report of all email messages sent that were sent through an email batch. Max 100 messages are shown per API call. Use the offset parameter to fetch additional pages.

Request

GET v1/batches/BATCH_ID/email_messages?offset=0
PropertyDescription
BATCH_IDWaypoint email batch ID (either Live or Sandbox batch).
offsetStarting point of email messages within the batch.
const axios = require('axios');
axios({
method: 'get',
url: 'https://live.waypointapi.com/v1/batches/BATCH_ID/email_messages',
headers: {
'Content-Type': 'application/json'
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
}
})
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Response

Successful response – a data object with an array of associated message logs. See a email message log for response details on each message.

{
"data": [
{
"id": "em_45TWBJqcvwHLoDq5",
"type": "EmailMessage",
"createdAt": "2024-12-31T14:58:36.896Z",
"updatedAt": "2024-12-31T15:58:15.008Z",
"source": "BATCH",
"status": "SUCCEEDED",
"processedAt": null,
"waypointTemplateId": "wptemplate_WVWNrT7e2yFhnnMv",
"variables": {
"message": "hello from a batch"
},
"to": ["\"Jordan Isip\" <jordan@usewaypoint.com>"],
"cc": [],
"bcc": [],
"from": "Waypoint <support@usewaypoint.com>",
"replyTo": "",
"sentAt": "2024-12-31T14:58:43.775Z",
"deliveredAt": "2024-12-31T14:58:44.805Z",
"firstOpenedAt": "2024-12-31T14:58:45.927Z",
"lastOpenedAt": "2024-12-31T15:58:14.801Z",
"firstClickedAt": null,
"lastClickedAt": null,
"firstComplainedAt": null,
"lastComplainedAt": null,
"firstBouncedAt": null,
"lastBouncedAt": null,
"erroredAt": null,
"lastSuppressedAt": null,
"lastUnsubscribedAt": null
},
{
"id": "em_HKbSarUFc391Cng3",
"type": "EmailMessage",
"createdAt": "2024-12-31T14:58:36.962Z",
"updatedAt": "2024-12-31T15:19:51.765Z",
"source": "BATCH",
"status": "SUCCEEDED",
"processedAt": null,
"waypointTemplateId": "wptemplate_WVWNrT7e2yFhnnMv",
"variables": {
"message": "hello from a batch"
},
"to": ["\"Carlos Rodriguez\" <carlos@usewaypoint.com>"],
"cc": [],
"bcc": [],
"from": "Waypoint <support@usewaypoint.com>",
"replyTo": "",
"sentAt": "2024-12-31T14:58:43.781Z",
"deliveredAt": "2024-12-31T14:58:45.076Z",
"firstOpenedAt": "2024-12-31T14:58:45.727Z",
"lastOpenedAt": "2024-12-31T15:19:51.609Z",
"firstClickedAt": null,
"lastClickedAt": null,
"firstComplainedAt": null,
"lastComplainedAt": null,
"firstBouncedAt": null,
"lastBouncedAt": null,
"erroredAt": null,
"lastSuppressedAt": null,
"lastUnsubscribedAt": null
}
]
}


Workflows

API endpoints for workflows on Waypoint.

Trigger workflow

Start a workflow to start a workflow run.

POST /v1/workflow_runs
PropertyDescription
workflowIdWaypoint workflow ID.
workflowKeyYour custom workflow key. Eg. abandoned_cart. Use in replace of a workflowId.
variablesTemplate variables JSON.
metaIdID used for idempotent requests or internal reference. Eg. ‘order_1234’.
const axios = require('axios');
axios({
method: "post",
url: "https://live.waypointapi.com/v1/workflow_runs",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"workflowId": "wf_eXYHR685DrjeGEXz",
"variables": {
"user": {
"displayName": "Jordan",
"email": "jordan@usewaypoint.com"
},
"product": {
"title": "Beechers Mac & Cheese",
"id": "02934203942"
}
}
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Trigger test workflow

Similar to sandbox test emails above, workflows can be triggered as a test workflow. This will start a workflow but not actually send the resulting email.

POST /v1/sandbox/workflow_runs

This sandbox endpoint the same properties as v1/workflow_runs

const axios = require('axios');
axios({
method: "post",
url: "https://live.waypointapi.com/v1/sandbox/workflow_runs",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"workflowId": "wf_eXYHR685DrjeGEXz",
"variables": {
"user": {
"displayName": "Jordan",
"email": "jordan@usewaypoint.com"
},
"product": {
"title": "Beechers Mac & Cheese",
"id": "02934203942"
}
}
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})


Templates

API endpoints for templates on Waypoint.

Retreive processed template

Get the HTML of your template. Uses the template’s test data.

Request

GET /v1/templates/TEMPLATE_ID/preview
PropertyDescription
TEMPLATE_IDWaypoint template ID.
const axios = require('axios');
axios({
method: "get",
url: "https://live.waypointapi.com/v1/templates/wptemplate_qzJuYidNgPYNoba6/preview",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Response

{
"data": {
"id": "wptemplate_qzJuYidNgPYNoba6",
"type": "Template",
"createdAt": "2023-11-28T14:42:09.867Z",
"updatedAt": "2023-12-04T18:32:48.547Z",
"bodyHtml": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html lang=\"en\" dir=\"ltr\" style=\"-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; -webkit-text-size-adjust: 100%;\">\n\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\">\n <style data-emotion=\"css-global o6gwfi\">\n@media print {\n body {\n background-color: #fff;\n }\n}\n</style>\n <style>\n@media screen and (max-width: 599.95px) {\n .block-mobile {\n display: block !important;\n }\n\n .block-desktop {\n display: none !important;\n }\n}\n</style>\n </head>\n\n <body style=\"box-sizing: inherit; margin: 0; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; font-weight: 400; font-size: 1rem; line-height: 1.5; letter-spacing: 0.00938em; background-color: #EEEEEE;\">\n \n <div class=\"MuiBox-root css-b5fgh5\" style=\"box-sizing: inherit; font-weight: 400; font-size: 16px; padding: 32px 0; margin: 0; letter-spacing: 0.15008px; line-height: 1.5; background-color: #EEEEEE; font-family: 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif; color: #242424;\">\n <div id=\"__react-email-preview\" style=\"box-sizing: inherit; display: none; overflow: hidden; line-height: 1px; opacity: 0; max-height: 0; max-width: 0;\">Plus your top performing post last week.<div style=\"box-sizing: inherit;\"> ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍</div>\n </div>\n <table align=\"center\" width=\"100%\" style=\"box-sizing: inherit; background-color: #FFFFFF; max-width: 600px; min-height: 48px;\" role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"#FFFFFF\">\n <tbody style=\"box-sizing: inherit;\">\n <tr style=\"box-sizing: inherit; width: 100%;\">\n <td style=\"box-sizing: inherit;\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 24px 24px 24px 24px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div class style=\"box-sizing: inherit;\">\n <table align=\"center\" width=\"100%\" cellpadding=\"0\" border=\"0\" style=\"box-sizing: inherit; table-layout: fixed; border-collapse: collapse;\">\n <tbody style=\"box-sizing: inherit; width: 100%;\">\n <tr style=\"box-sizing: inherit; width: 100%;\">\n <td style=\"box-sizing: content-box; vertical-align: middle; text-align: left; width: 50%; padding-left: 0; padding-right: 8px;\" width=\"50%\" valign=\"middle\" align=\"left\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\"><img src=\"https://d1iiu589g39o6c.cloudfront.net/live/platforms/platform_A9wwKSL6EV6orh6f/images/wptemplateimage_n3eLjsf37dcjFaj5/Narrative.png\" style=\"box-sizing: inherit; display: inline-block; outline: none; border: none; text-decoration: none; vertical-align: middle; max-width: 100%; height: 16px;\" height=\"16\"></div>\n </div>\n </td>\n <td style=\"box-sizing: content-box; vertical-align: middle; text-align: left; width: 50%; padding-left: 8px; padding-right: 0;\" width=\"50%\" valign=\"middle\" align=\"left\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"font-family: inherit; font-weight: normal; padding: 0px 0px 0px 0px; text-align: right; max-width: 100%; box-sizing: border-box;\"><img alt=\"Jordan\" src=\"https://d1iiu589g39o6c.cloudfront.net/avatars?color=FFFFFF&amp;name=JO&amp;background=24AF7F&amp;size=32&amp;rounded=true\" style=\"box-sizing: inherit; display: inline-block; outline: none; border: none; text-decoration: none; vertical-align: middle; text-align: center; max-width: 100%;\"></div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div style=\"font-family: inherit; font-weight: bold; padding: 24px 24px 0px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <h3 style=\"box-sizing: inherit; margin-top: 40px; margin-bottom: 16px; font-weight: inherit; margin: 0; font-size: 20px;\">Last week, your posts received</h3>\n </div>\n <div style=\"font-family: inherit; font-size: 48px; font-weight: bold; padding: 16px 24px 0px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n \n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">1,511</p>\n </div>\n </div>\n </div>\n <div style=\"font-family: inherit; font-size: 14px; font-weight: bold; padding: 0px 24px 16px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">Post impressions</p>\n </div>\n </div>\n </div>\n <div style=\"font-family: inherit; font-size: 16px; font-weight: bold; padding: 16px 24px 40px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\"><a href=\"https://narrative.example.com/jordanisip/analytics\" target=\"_blank\" style=\"box-sizing: inherit; background-color: #24AF7F; color: #FFFFFF; padding: 0px 0px; border-radius: 4px; width: auto; display: inline-block; line-height: 100%; text-decoration: none; max-width: 100%;\"><span style=\"box-sizing: inherit;\"><!--[if mso]><i style=\"letter-spacing: undefinedpx;mso-font-width:-100%;mso-text-raise:0\" hidden>&nbsp;</i><![endif]--></span><span style=\"box-sizing: inherit; background-color: #24AF7F; color: #FFFFFF; padding: 12px 20px; border-radius: 4px; width: auto; display: inline-block; max-width: 100%; line-height: 120%; text-decoration: none; text-transform: none; mso-padding-alt: 0px; mso-text-raise: 0;\">View your analytics →</span><span style=\"box-sizing: inherit;\"><!--[if mso]><i style=\"letter-spacing: undefinedpx;mso-font-width:-100%\" hidden>&nbsp;</i><![endif]--></span></a></div>\n <div style=\"font-family: inherit; font-weight: bold; padding: 24px 24px 8px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <h3 style=\"box-sizing: inherit; margin-top: 40px; margin-bottom: 16px; font-weight: inherit; margin: 0; font-size: 20px;\">Top performing post last week</h3>\n </div>\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 16px 24px 16px 24px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"border: 1px solid #d0d0d0; border-radius: 8px; font-family: inherit; font-size: 16px; font-weight: normal; padding: 24px 24px 24px 24px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">So excited to now have drag and drop on Waypoint. This builds on top of our new Navigator feature that we shipped earlier this week 🚢.</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div style=\"font-family: inherit; font-size: 16px; font-weight: bold; padding: 16px 24px 16px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\"><a href=\"https://narrative.example.com/jordanisip/posts\" target=\"_blank\" style=\"box-sizing: inherit; background-color: #EEEEEE; color: #000000; padding: 0px 0px; border-radius: 4px; width: auto; display: inline-block; line-height: 100%; text-decoration: none; max-width: 100%;\"><span style=\"box-sizing: inherit;\"><!--[if mso]><i style=\"letter-spacing: undefinedpx;mso-font-width:-100%;mso-text-raise:0\" hidden>&nbsp;</i><![endif]--></span><span style=\"box-sizing: inherit; background-color: #EEEEEE; color: #000000; padding: 12px 20px; border-radius: 4px; width: auto; display: inline-block; max-width: 100%; line-height: 120%; text-decoration: none; text-transform: none; mso-padding-alt: 0px; mso-text-raise: 0;\">Show more</span><span style=\"box-sizing: inherit;\"><!--[if mso]><i style=\"letter-spacing: undefinedpx;mso-font-width:-100%\" hidden>&nbsp;</i><![endif]--></span></a></div>\n <div style=\"padding: 40px 0px 0px 0px; max-width: 100%; box-sizing: border-box;\">\n <hr style=\"box-sizing: inherit; margin: 0px; width: 100%; border: none; border-top: 1px solid #eaeaea; border-color: rgb(233, 233, 233); border-top-width: 1px;\">\n </div>\n <div style=\"color: #474849; font-family: inherit; font-size: 12px; font-weight: normal; padding: 24px 24px 24px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">Questions? Just reply to this email.</p>\n </div>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </body>\n\n</html>"
}
}
PropertyDescription
IDWaypoint template ID.
typeThe type of the template.
createdAtTimestamp of when the template was created.
updatedAtTimestamp of when the template was last updated.
bodyHtmlThe raw HTML body of the email.

Optionally pass in custom data

If you’d like to pass in custom data instead of your template’s test data, you can pass it in with a POST request on this same endpoint. A successful response will be the same as above but processed with different data.

POST /v1/templates/TEMPLATE_ID/preview
axios({
method: "post",
url: "https://live.waypointapi.com/v1/templates/wptemplate_qzJuYidNgPYNoba6/preview",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
data: {
"passcode": "222222",
"expiresIn": "1 minute"
}
})

Retrieve raw template

Get the HTML of your template with raw LiquidJS templating. This is useful for teams that need to keep a copy of the raw template within your codebase or send through a separate service for compliance reasons.

Request

GET /v1/templates/TEMPLATE_ID/raw
PropertyDescription
TEMPLATE_IDWaypoint template ID.
const axios = require('axios');
axios({
method: "get",
url: "https://live.waypointapi.com/v1/templates/wptemplate_qzJuYidNgPYNoba6/raw",
headers: {
"Content-Type": "application/json"
},
auth: {
username: API_KEY_USERNAME,
password: API_KEY_PASSWORD
},
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})

Response

{
"data": {
"id": "wptemplate_qzJuYidNgPYNoba6",
"type": "Template",
"createdAt": "2023-11-28T14:42:09.867Z",
"updatedAt": "2023-12-04T18:32:48.547Z",
"rawSubject": "{{user.displayName}}, you got {{report.metric.value | downcase}} {{report.metric.title | downcase}} {{report.duration | downcase}}",
"rawBodyHtml": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html lang=\"en\" dir=\"ltr\" style=\"-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; -webkit-text-size-adjust: 100%;\">\n\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\">\n <style data-emotion=\"css-global o6gwfi\">\n@media print {\n body {\n background-color: #fff;\n }\n}\n</style>\n <style>\n@media screen and (max-width: 599.95px) {\n .block-mobile {\n display: block !important;\n }\n\n .block-desktop {\n display: none !important;\n }\n}\n</style>\n </head>\n\n <body style=\"box-sizing: inherit; margin: 0; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; font-weight: 400; font-size: 1rem; line-height: 1.5; letter-spacing: 0.00938em; background-color: #EEEEEE;\">\n \n <div class=\"MuiBox-root css-b5fgh5\" style=\"box-sizing: inherit; font-weight: 400; font-size: 16px; padding: 32px 0; margin: 0; letter-spacing: 0.15008px; line-height: 1.5; background-color: #EEEEEE; font-family: 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif; color: #242424;\">\n <div id=\"__react-email-preview\" style=\"box-sizing: inherit; display: none; overflow: hidden; line-height: 1px; opacity: 0; max-height: 0; max-width: 0;\">Plus your top performing post {{report.duration | downcase}}.<div style=\"box-sizing: inherit;\"> ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍ ‌​‍</div>\n </div>\n <table align=\"center\" width=\"100%\" style=\"box-sizing: inherit; background-color: #FFFFFF; max-width: 600px; min-height: 48px;\" role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"#FFFFFF\">\n <tbody style=\"box-sizing: inherit;\">\n <tr style=\"box-sizing: inherit; width: 100%;\">\n <td style=\"box-sizing: inherit;\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 24px 24px 24px 24px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div class style=\"box-sizing: inherit;\">\n <table align=\"center\" width=\"100%\" cellpadding=\"0\" border=\"0\" style=\"box-sizing: inherit; table-layout: fixed; border-collapse: collapse;\">\n <tbody style=\"box-sizing: inherit; width: 100%;\">\n <tr style=\"box-sizing: inherit; width: 100%;\">\n <td style=\"box-sizing: content-box; vertical-align: middle; text-align: left; width: 50%; padding-left: 0; padding-right: 8px;\" width=\"50%\" valign=\"middle\" align=\"left\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\"><img alt src=\"https://d1iiu589g39o6c.cloudfront.net/live/platforms/platform_A9wwKSL6EV6orh6f/images/wptemplateimage_n3eLjsf37dcjFaj5/Narrative.png\" style=\"box-sizing: inherit; display: block; outline: none; border: none; text-decoration: none;\"></div>\n </div>\n </td>\n <td style=\"box-sizing: content-box; vertical-align: middle; text-align: left; width: 50%; padding-left: 8px; padding-right: 0;\" width=\"50%\" valign=\"middle\" align=\"left\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"font-family: inherit; font-weight: normal; padding: 0px 0px 0px 0px; text-align: right; max-width: 100%; box-sizing: border-box;\"><img src=\"{{user.avatarUrl}}\" alt=\"{{user.displayName}}\" style=\"box-sizing: inherit; display: inline-block; object-fit: cover; height: 32px; width: 32px; max-width: 100%; vertical-align: middle; text-align: center; border-radius: 32px;\" width=\"32\" height=\"32\"></div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div style=\"font-family: inherit; font-weight: bold; padding: 24px 24px 0px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <h3 style=\"box-sizing: inherit; margin-top: 40px; margin-bottom: 16px; font-weight: inherit; font-size: 20px; margin: inherit;\">{{report.duration}}, your posts received</h3>\n </div>\n <div style=\"font-family: inherit; font-size: 48px; font-weight: bold; padding: 16px 24px 0px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n \n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">{{report.metric.value}}</p>\n </div>\n </div>\n </div>\n <div style=\"font-family: inherit; font-size: 14px; font-weight: bold; padding: 0px 24px 16px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">{{report.metric.title}}</p>\n </div>\n </div>\n </div>\n <div style=\"font-family: inherit; font-size: 16px; font-weight: bold; padding: 16px 24px 40px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\"><a href=\"https://narrative.example.com/{{user.username}}/analytics\" style=\"box-sizing: inherit; color: #24AF7F; background-color: #24AF7F; padding: 0; border-radius: 4px; width: auto; display: inline-block; text-decoration: none; max-width: 100%; line-height: 100%;\"><span style=\"box-sizing: inherit; color: #FFFFFF; padding: 12px 20px; width: 100%; display: inline-block; max-width: 100%; line-height: 120%; text-decoration: none; text-transform: none;\">View your analytics →</span></a></div>\n <div style=\"font-family: inherit; font-weight: bold; padding: 24px 24px 8px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <h3 style=\"box-sizing: inherit; margin-top: 40px; margin-bottom: 16px; font-weight: inherit; font-size: 20px; margin: inherit;\">Top performing post {{report.duration | downcase}}</h3>\n </div>\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 16px 24px 16px 24px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"border: 1px solid #d0d0d0; border-radius: 8px; font-family: inherit; font-size: 16px; font-weight: normal; padding: 24px 24px 24px 24px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div style=\"font-family: inherit; font-size: 16px; font-weight: normal; padding: 0px 0px 0px 0px; text-align: left; max-width: 100%; box-sizing: border-box;\">\n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">{{report.topPerformingPost}}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div style=\"font-family: inherit; font-size: 16px; font-weight: bold; padding: 16px 24px 16px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\"><a href=\"https://narrative.example.com/{{user.username}}/posts\" style=\"box-sizing: inherit; color: #24AF7F; background-color: #EEEEEE; padding: 0; border-radius: 4px; width: auto; display: inline-block; text-decoration: none; max-width: 100%; line-height: 100%;\"><span style=\"box-sizing: inherit; color: #000000; padding: 12px 20px; width: 100%; display: inline-block; max-width: 100%; line-height: 120%; text-decoration: none; text-transform: none;\">Show more</span></a></div>\n <div style=\"padding: 40px 0px 0px 0px; max-width: 100%; box-sizing: border-box;\">\n <hr style=\"box-sizing: inherit; margin: 0px; width: 100%; border: none; border-top: 1px solid #eaeaea; border-color: rgb(233, 233, 233); border-top-width: 1px;\">\n </div>\n <div style=\"color: #474849; font-family: inherit; font-size: 12px; font-weight: normal; padding: 24px 24px 24px 24px; text-align: center; max-width: 100%; box-sizing: border-box;\">\n <div class=\"MuiBox-root css-vii0ua\" style=\"box-sizing: inherit;\">\n <div style=\"box-sizing: inherit;\">\n <p style=\"box-sizing: inherit; margin-top: 0px; margin-bottom: 0px;\">Questions? Just reply to this email.</p>\n </div>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </body>\n\n</html>"
}
}
PropertyDescription
IDThe template ID.
typeThe type of the template.
createdAtTimestamp of when the template was created.
updatedAtTimestamp of when the template was last updated.
rawSubjectThe subject line of the email with LiquidJS templating.
rawBodyHtmlThe HTML body of the email with LiquidJS templating.