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
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
Kick off operational or lifecycle automations from external systems.
Request final HTML with runtime variables before send or preview.
Fetch templates and metadata for external orchestration or QA.
Send purchase, signup, or product events that can trigger downstream messaging.
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
/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
/api/public/templatesList 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"
}
]
}/api/public/templates/{id}/renderRender 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
/api/public/automationsList automations and current status.
Headers
{
"Authorization": "Bearer YOUR_API_KEY"
}Response
{
"automations": [
{
"id": "auto_abc123",
"name": "Welcome Flow",
"status": "active",
"triggerType": "api"
}
]
}/api/public/automations/{id}/statusActivate or pause an automation.
Headers
{
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}Request body
{
"status": "paused"
}Response
{
"success": true
}Events
/api/public/events/trackTrack 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"
]
}