Skip to main content
ZooTools Transactional Emails API makes it easy to send transactional communications.

Overview

Endpoint:
https://api.zootools.co/v1/messages
Payload:
{
  "name": "welcome-email", // this is the ID of your transactional message you created in the dashboard
  "to": "[email protected]", // target email
  "data": {
    // any variables to be used in the email template
  }
}

Get started

1. New transactional email

Create a new transactional email on your zootools dashboard. Use a friendly name, so both you and the marketer can understand what’s the email is about. Alt Text

2. Open the transactional email

Follow the instructions based on your programming language. Alt Text

3. (optional) Edit email template and add many variables.

ZooTools will automatically extract the variables from the email content, and easily expose them to you in the API examples.
Alt Text

4. Copy the payload with your name, data and to.

As you saw, ZooTools automatically updated the code example to include the new variables you added. The property name is the one you defined when creating the transactional email. This name should be unique. Alt Text

5. Call the API passing the transactional name, and the data.

If you or your marketing team modify the template and add new variable, make sure to update your API call so the template should always get the right variables. In the future we may response with an error in the API if you don’t pass all the variables. Our suggestion is to first make the change in the backend passing the extra variables, and then update the template on ZooTools.

Parameters

to
string or array
required
Email or list of emails that should receive your transactional email
name
string
required
Unique identifier of the transactional email. You can update this value on ZooTools dashboard.
data
object
You can make your email personalized for every user’s passing custom data. Each variable in the html template is replaced by the data you provide.ZooTools has default properties that are automatically added to your account, and you can define custom properties.You can create as many variables as you want while creating or editing the template.

Examples

const axios = require("axios");

const token = "YOUR_BEARER_TOKEN";

axios
  .post(
    "https://api.zootools.co/v1/messages",
    {
      name: "password-reset",
      to: "[email protected]",
      data: {
        firstName: "Jorge",
        lastName: "Ferreiro",
        passwordResetUrl: "https://example.com/reset-password?token=123123123",
      },
    },
    {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    }
  )
  .then((response) => console.log("API response:", response.data))
  .catch((error) => console.error("API request failed:", error));