Reference

API Reference

Complete API endpoint documentation

Overview

All API endpoints require authentication via either a session cookie (for dashboard requests) or an API key (for programmatic access through v1 endpoints). Responses are returned as JSON. This page serves as a quick-reference index of every available endpoint.

Base URL

All endpoints are relative to the base API URL:

Base URL
http://localhost:3000/api

Authentication

The platform supports two authentication methods:

  • Session cookie — Automatically set when you sign in through the dashboard. Used by all internal API routes.
  • API key — Pass via the x-api-key header. Required for /api/v1/* endpoints and the MCP server. Generate keys from the Settings page.

Contacts

Manage your contact list — create, update, import, and export subscribers.

GET/api/contacts

List all contacts with optional search, pagination, and filtering.

POST/api/contacts

Create a new contact with email, name, and optional metadata.

PUT/api/contacts/[id]

Update an existing contact by ID.

POST/api/contacts/import

Bulk import contacts from a CSV file upload.

GET/api/contacts/export

Export all contacts as a downloadable CSV file.

Templates

Create and manage reusable email templates with merge tag support.

GET/api/templates

List all custom email templates.

GET/api/templates/[id]

Retrieve a single template by ID with full HTML content.

POST/api/templates

Create a new email template with name, subject, and body.

PUT/api/templates/[id]

Update an existing template by ID.

GET/api/templates/builtin

List all built-in starter templates that ship with the platform.

Emails

Send emails and manage scheduled sends.

POST/api/emails

Send an email to one or more recipients with subject, body, and optional attachments.

POST/api/emails/cancel

Cancel a scheduled email before it is sent.

Campaigns

Manage drip campaigns with multi-step automated email sequences.

GET/api/campaigns

List all campaigns with status, recipient count, and schedule info.

GET/api/campaigns/steps

Retrieve the steps (emails in sequence) for a specific campaign.

GET/api/campaigns/stats

Get delivery and engagement statistics for a campaign.

Segments

Group contacts into dynamic segments based on rules and conditions.

GET/api/segments

List all segments with their rule definitions and contact counts.

POST/api/segments

Create a new segment with filter rules.

GET/api/segments/contacts

List contacts that match a specific segment's rules.

A/B Tests

Run split tests on subject lines, content, or send times to optimize engagement.

GET/api/ab-tests

List all A/B tests with variants, status, and results.

POST/api/ab-tests

Create a new A/B test with variant definitions and audience split.

Analytics

Retrieve sending statistics and subscriber engagement metrics.

GET/api/stats

Get overall sending statistics including sent, delivered, opened, clicked, and bounced counts.

GET/api/engagement

Get detailed engagement metrics with time-series data for opens, clicks, and unsubscribes.

AI

AI-powered tools for generating and optimizing email content.

POST/api/ai/generate

Generate email content from a prompt or brief description.

POST/api/ai/improve

Improve existing email content for clarity, tone, or engagement.

GET/api/ai/send-time

Get AI-recommended optimal send time based on subscriber engagement patterns.

API Keys

Manage API keys for programmatic access and third-party integrations.

GET/api/keys

List all API keys with creation date and last used timestamp.

POST/api/keys

Generate a new API key with an optional label.

Webhooks

Configure webhook endpoints to receive real-time delivery and engagement events.

GET/api/webhooks/manage

List all registered webhook endpoints.

POST/api/webhooks/manage

Register a new webhook endpoint with event type filters.

POST/api/webhooks

Incoming webhook receiver for external email provider events (bounces, complaints, deliveries).

External API

Public API endpoints for external integrations. These require API key authentication via the x-api-key header.

POST/api/v1/send

Send an email programmatically from an external application.

GET/api/v1/contacts

Retrieve contacts from an external application with search and pagination.