Email endpoints sit under /api/brands/{brand}/emails/ with moduleAccess:emails middleware. Authenticate with EF-Access-Key.
List Emails
GET /api/brands/{brand}/emails
Results per page (1–100, default: 25)
Search by name or subject
newest, oldest, created_at, updated_at
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 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
Email template name (max 256). Defaults to "Untitled Email" if empty after validation.
Email subject line (max 512)
Preheader / preview text (max 512)
Sender display name (max 256)
Sender email address (max 256)
Reply-to address (max 256)
Link this email to a specific automation
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
}'
200 Created
422 Missing required field
{
"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}
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
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"
Builder config response
?html=1 response
{
"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
Builder config as a JSON string (not a JSON object — must be JSON.stringify’d before sending)
Comments data for the email template
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
Email linked to automation
No automation linked
{
"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 / PATCH — code strings only work for GET, show, and DELETE
The all endpoint merges CSS inline into the HTML for direct use in rendering/preview contexts