API endpoints

Waypoint's API consists of a small set of POST endpoints that are used to trigger emails, templates, and workflows in both the live and sandbox environment. All API endpoints use the URL https://live.waypointapi.com and a 'content-type: application/json' to encode the data.

Head to API keys and authentication if you haven't setup an API key for your workspace yet.

💡 New to APIs? Check out our quick start guide for a walk-through with examples.

Endpoints

POST /v1/email_messages

Sending with a template

PropertyDescription
templateIdThe 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
variablesOptional – JSON data object that is passed to the template and available as variables on the template.
toEmail 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").
ccOptional – email address of the receiver(s) that should be CC'd. Use the same format as 'to' attribute.
bccOptional – email address of the receiver(s) that should be BCC'd. Use the same format as 'to' attribute.
metaIdOptional – can be used for internal reference or idempotent requests. Eg. 'order_1234'.

Sending without a template

PropertyDescription
bodyHtmlHTML body content.
bodyTextOptional – plain text body content.
toEmail 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").
ccOptional – email address of the receiver(s) that should be CC'd. Use the same format as 'to' attribute.
bccOptional – email address of the receiver(s) that should be BCC'd. Use the same format as 'to' attribute.
metaIdOptional – can be used for internal reference or idempotent requests. Eg. 'order_1234'.

Related docs:

Code examples

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); })
curl "https://live.waypointapi.com/v1/email_messages" \ -H "Content-Type: application/json" \ -u "API_KEY_USERNAME:API_KEY_PASSWORD" \ -d '{ "templateId": "wptemplate_ABc123XYZ", "to": "jordan@usewaypoint.com", "variables": { "user": { "displayName": "Jordan" }, "product": { "title": "Beechers Mac & Cheese", "id": "02934203942" } } }'

POST /v1/sandbox/email_messages

Uses the same properties as v1/email_messages above.

Related docs:

Code examples

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); })
curl "https://live.waypointapi.com/v1/sandbox/email_messages" \ -H "Content-Type: application/json" \ -u "API_KEY_USERNAME:API_KEY_PASSWORD" \ -d '{ "templateId": "wptemplate_ABc123XYZ", "to": "jordan@usewaypoint.com", "variables": { "user": { "displayName": "Jordan" }, "product": { "title": "Beechers Mac & Cheese", "id": "02934203942" } } }'

POST /v1/workflow_runs

PropertyDescription
workflowIdOptional – The id of the workflow you want to send (created on the Waypoint dashboard). You can access the workflow ID from the URL.
workflowKeyOptional – Your custom workflow key (created on Waypoint's workflow builder). Eg. 'abandoned_cart'. Use in replace of a workflowId.
variablesOptional – JSON data object that is passed to the template and available as variables on the template.
metaIdOptional – can be used for internal reference or idempotent requests. Eg. 'order_1234'.

Related docs:

Code examples

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); })
curl "https://live.waypointapi.com/v1/workflow_runs" \ -H "Content-Type: application/json" \ -u "API_KEY_USERNAME:API_KEY_PASSWORD" \ -d '{ "workflowId": "wf_eXYHR685DrjeGEXz", "variables": { "user": { "displayName": "Jordan", "email": "jordan@usewaypoint.com" }, "product": { "title": "Beechers Mac & Cheese", "id": "02934203942" } } }' ``