Skip to main content
Email endpoints sit under /api/brands/{brand}/emails/ with moduleAccess:emails middleware. Authenticate with EF-Access-Key.

List Emails

GET /api/brands/{brand}/emails
per_page
number
Results per page (1–100, default: 25)
q
string
Search by name or subject
sort
string
newest, oldest, created_at, updated_at
cURL
curl https://app.elasticfunnels.io/api/brands/{brand_id}/emails \
  -H "EF-Access-Key: your_api_key_here"
{
  "current_page": 1,
  "data": [
    {
      "id": 3,
      "code": "welcome-email",
      "name": "Welcome Email",
      "subject": "Welcome to our community!",
      "from_name": "Jane at MyBrand",
      "from_email": "hello@mybrand.com",
      "reply_to_email": null,
      "automation_id": 12,
      "created_at": "2024-11-01T00:00:00.000000Z"
    }
  ],
  "per_page": 25,
  "total": 7,
  "last_page": 1
}

List Emails (Unpaginated)

Returns all emails with rendered HTML included (CSS is merged inline).
GET /api/brands/{brand}/emails/all
[
  {
    "id": 3,
    "name": "Welcome Email",
    "subject": "Welcome to our community!",
    "from_name": "Jane at MyBrand",
    "from_email": "hello@mybrand.com",
    "html": "<style>/* ... */</style><html>..."
  }
]

Get Email

GET /api/brands/{brand}/emails/{email}
email
string
required
Email numeric ID or code slug
{
  "id": 3,
  "code": "welcome-email",
  "name": "Welcome Email",
  "subject": "Welcome to our community!",
  "preview_text": "Thanks for joining!",
  "from_name": "Jane at MyBrand",
  "from_email": "hello@mybrand.com",
  "reply_to_email": null,
  "automation_id": 12,
  "variable_scope": null,
  "html": "...",
  "css": "...",
  "inline": null,
  "screenshot": null,
  "config": {}
}

Create Email

POST /api/brands/{brand}/emails
name
string
required
Email template name (max 256). Defaults to "Untitled Email" if empty after validation.
subject
string
Email subject line (max 512)
preview_text
string
Preheader / preview text (max 512)
from_name
string
Sender display name (max 256)
from_email
string
Sender email address (max 256)
reply_to_email
string
Reply-to address (max 256)
automation_id
number
Link this email to a specific automation
cURL
curl -X POST https://app.elasticfunnels.io/api/brands/{brand_id}/emails \
  -H "EF-Access-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome Email",
    "subject": "Welcome to our community!",
    "from_name": "Jane at MyBrand",
    "from_email": "hello@mybrand.com",
    "automation_id": 12
  }'
{
  "id": 3,
  "email": {
    "id": 3,
    "code": "welcome-email",
    "name": "Welcome Email",
    "subject": "Welcome to our community!",
    "from_name": "Jane at MyBrand",
    "from_email": "hello@mybrand.com",
    "automation_id": 12,
    "brand_id": 42,
    "created_at": "2024-12-11T10:00:00.000000Z"
  }
}

Update Email

PUT /api/brands/{brand}/emails/{email}
Use the numeric ID in the path when updating — using a code slug will cause a 404 because the UpdateEmail authorization query only looks up by numeric ID.
Same body as Create. name is required.

Delete Email

DELETE /api/brands/{brand}/emails/{email}
{ "success": true }

Get Builder Config

Retrieve the visual email builder config. Add ?html=1 to get the rendered HTML version.
GET /api/brands/{brand}/emails/{email}/builder
html
boolean
If 1, returns rendered HTML output instead of builder config
cURL — get builder config
curl https://app.elasticfunnels.io/api/brands/{brand_id}/emails/3/builder \
  -H "EF-Access-Key: your_api_key_here"

# Get rendered HTML
curl "https://app.elasticfunnels.io/api/brands/{brand_id}/emails/3/builder?html=1" \
  -H "EF-Access-Key: your_api_key_here"
{
  "assets": [ /* brand file assets */ ],
  "data": { /* email content blocks */ },
  "pageComponents": [ /* reusable components */ ],
  "fonts": [ "Montserrat", "Open Sans" ]
}

Save Builder Config

POST /api/brands/{brand}/emails/{email}/builder
config
string
required
Builder config as a JSON string (not a JSON object — must be JSON.stringify’d before sending)
html
string
Raw HTML content
css
string
CSS styles
comments
array
Comments data for the email template
cURL
curl -X POST https://app.elasticfunnels.io/api/brands/{brand_id}/emails/3/builder \
  -H "EF-Access-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "config": "{\"data\": {}}",
    "html": "<html>...</html>",
    "css": "body { font-family: sans-serif; }"
  }'
{
  "id": 3,
  "name": "Welcome Email"
}

Get Automation Variables

Lists the merge-tag variables available for use in this email’s content, based on the automation it belongs to.
GET /api/brands/{brand}/emails/{email}/automation-variables
{
  "variables": [
    { "key": "{{first_name}}", "value": "First Name", "group": "Customer" },
    { "key": "{{product_name}}", "value": "Product Name", "group": "Order" },
    { "key": "{{order_total}}", "value": "Order Total", "group": "Order" }
  ],
  "automation": {
    "id": 12,
    "title": "Welcome Email Sequence"
  },
  "context": { /* automation context */ }
}

Notes

  • The config field in the builder POST must be sent as a JSON string (double-encoded), not a JSON object
  • Saving the builder config automatically regenerates inline CSS and the inline version of the email
  • Use numeric IDs in the URL for PUT / PATCHcode strings only work for GET, show, and DELETE
  • The all endpoint merges CSS inline into the HTML for direct use in rendering/preview contexts