Developer docs

REST entry points for templates, events, and automations.

Use the API to trigger flows, render templates, and push real events into Envoi. The public docs should explain how execution works, not only list endpoints.

Quickstart

Authenticate with a bearer API key.
Trigger flows or events from your app.
Render templates before send or QA review.
Recommended flow

1. Create or select a template.

2. Track an event or trigger an automation.

3. Render content with recipient variables.

4. Let Envoi handle delivery, preview, and lifecycle execution.

Capabilities

Trigger flows

Kick off operational or lifecycle automations from external systems.

Render templates

Request final HTML with runtime variables before send or preview.

Manage content

Fetch templates and metadata for external orchestration or QA.

Track events

Send purchase, signup, or product events that can trigger downstream messaging.

Sections

Trigger EmailsTemplatesAutomationsEvents
Authentication
Authorization: Bearer YOUR_API_KEY

Example request

const response = await fetch(
  'https://your-domain.com/api/public/trigger/auto_abc123',
  {
    method: 'POST',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      email: 'recipient@example.com',
      name: 'John Doe',
      variables: {
        first_name: 'John',
        order_number: '12345',
      },
    }),
  }
);

const data = await response.json();
console.log(data);

Trigger Emails

POST/api/public/trigger/{automation_id}

Trigger an automated email flow for a specific recipient.

Headers

{
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request body

{
  "email": "recipient@example.com",
  "name": "John Doe",
  "variables": {
    "first_name": "John",
    "order_number": "12345"
  }
}

Response

{
  "success": true,
  "executionId": "exec_abc123",
  "scheduledFor": "2026-03-16T10:30:00Z"
}

Templates

GET/api/public/templates

List templates available to your workspace.

Headers

{
  "Authorization": "Bearer YOUR_API_KEY"
}

Response

{
  "templates": [
    {
      "id": "tpl_abc123",
      "name": "Welcome Email",
      "description": "Onboarding email for new users"
    }
  ]
}
POST/api/public/templates/{id}/render

Render a template with variables to produce final HTML.

Headers

{
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request body

{
  "variables": {
    "first_name": "John",
    "company_name": "Acme Inc"
  }
}

Response

{
  "html": "<!DOCTYPE html>...",
  "subject": "Welcome to Acme Inc, John!",
  "previewText": "Get started with your account"
}

Automations

GET/api/public/automations

List automations and current status.

Headers

{
  "Authorization": "Bearer YOUR_API_KEY"
}

Response

{
  "automations": [
    {
      "id": "auto_abc123",
      "name": "Welcome Flow",
      "status": "active",
      "triggerType": "api"
    }
  ]
}
PUT/api/public/automations/{id}/status

Activate or pause an automation.

Headers

{
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request body

{
  "status": "paused"
}

Response

{
  "success": true
}

Events

POST/api/public/events/track

Track a custom event that can trigger automations.

Headers

{
  "Authorization": "Bearer YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request body

{
  "event": "purchase_completed",
  "email": "customer@example.com",
  "properties": {
    "order_total": 99.99,
    "order_id": "ord_123"
  }
}

Response

{
  "success": true,
  "eventId": "evt_abc123",
  "triggeredAutomations": [
    "auto_xyz789"
  ]
}