Mixmax API Client

1.5.0 · maintenance · verified Sun Apr 19

The `mixmax-api` library is a Node.js wrapper that provides a programmatic interface for interacting with the Mixmax platform. It simplifies common operations such as managing email sequences, adding recipients, and leveraging features like polls, Q&A, and sidebars within Mixmax. The current stable version is 1.5.0, with the last release dating back to December 2020. This indicates a slow or paused release cadence, meaning new Mixmax API features might not be immediately supported by this library. Its primary differentiator is offering a convenient JavaScript interface over the raw Mixmax REST API, which is designed for lightweight, real-time interactions and has a rate limit of 120 requests per minute per user and IP address.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the Mixmax API client with an API key and then add a new recipient to a specified email sequence. It highlights the basic authentication and sequence management functionality.

const MixmaxAPI = require('mixmax-api');

// IMPORTANT: Replace with your actual Mixmax API key from settings.
// You can retrieve this key from your Mixmax settings page (Settings -> Integrations -> API).
// Do NOT hardcode in production; use environment variables.
const apiKey = process.env.MIXMAX_API_KEY ?? 'YOUR_SUPER_SECRET_MIXMAX_API_KEY'; 

if (!apiKey || apiKey === 'YOUR_SUPER_SECRET_MIXMAX_API_KEY') {
  console.error('Mixmax API Key is missing. Please set the MIXMAX_API_KEY environment variable or replace the placeholder.');
  process.exit(1);
}

const api = new MixmaxAPI(apiKey);

async function addRecipientToSequence() {
  // Replace with an actual sequence ID from your Mixmax account
  const sequenceID = 'your-mixmax-sequence-id'; 
  const recipientEmail = 'test-recipient@example.com';

  try {
    const sequence = api.sequences.sequence(sequenceID);
    const results = await sequence.addRecipients([
      {
        email: recipientEmail,
        variables: {
          firstName: 'Test',
          lastName: 'User'
        }
      }
    ]);
    console.log('Successfully added recipient to sequence:', results);
  } catch (error) {
    console.error('Error adding recipient to sequence:', error.message);
    if (error.response && error.response.data) {
      console.error('API Error Details:', error.response.data);
    }
  }
}

addRecipientToSequence();

view raw JSON →