Tools API (v2)

Execute any Lumail tool via REST API - unified endpoint for all operations

The Tools API provides a unified REST interface to execute any Lumail tool. Instead of learning multiple endpoints, you can use a single pattern to access all functionality.

Quick Start

All tools are available at /api/v2/tools/{tool_name}.

List all available tools:

curl https://lumail.io/api/v2/tools \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Execute a tool:

curl -X POST https://lumail.io/api/v2/tools/list_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"limit": 10}'

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer lum_your_api_token_here

Get your API token from Settings → API Tokens in your Lumail dashboard.

Response Format

All tool responses follow this structure:

Success:

{
  "success": true,
  "data": {
    /* tool-specific response */
  }
}

Error:

{
  "success": false,
  "error": "Error message"
}

Dangerous Action Confirmation

Publishing, activating, archiving, deleting, sending, or otherwise high-impact tools use a two-call confirmation flow. The first request returns CONFIRMATION_REQUIRED and a five-digit confirmationCode. Repeat the exact same request with that code within five minutes to execute it.

Draft-only tools such as configure_workflow_draft do not require confirmation because they never publish or send.

Rate Limits

Rate limits apply per organization based on your plan:

PlanRequests/minute
Free100
Premium700
Enterprise2,000

Available Tools (92 total)

ToolDescription
list_tagsList all tags in your organization.
create_tagCreate a new tag in your organization.
delete_tagDelete a tag by ID or name. This will remove the tag from al...
get_or_create_tagsGet existing tags or create new ones by name. Tags are label...
list_subscribersList subscribers in your organization. Filter by tag, status...
query_subscribersList subscribers matching composed filters - the same engine...
count_subscribersCount subscribers matching composed filters - same engine as...
get_subscriberGet detailed information about a specific subscriber by ID o...
add_subscriberAdd a new subscriber or update an existing one. Supports tag...
update_subscriberUpdate a subscriber by ID or email. Omitted resubscribe does...
unsubscribeUnsubscribe a subscriber by ID or email. The subscriber will...
bulk_add_tagsAdd one or more tags to multiple subscribers at once. Max 10...
bulk_remove_tagsRemove one or more tags from multiple subscribers. Max 100 s...
create_eventCreate a custom event for a subscriber. Useful for tracking ...
list_subscriber_eventsList events for a subscriber. Use this to check if an email ...
get_subscriber_emailsGet emails sent to a subscriber with their delivery status. ...
list_campaignsList email campaigns in your organization with optional filt...
create_campaignCreate a new email campaign. The campaign will be created in...
get_campaignGet detailed information about a specific campaign by ID.
get_campaign_progressGet the sending progress of a campaign that is currently bei...
get_campaign_analyticsGet detailed analytics for a sent campaign including opens, ...
duplicate_campaignCreate a complete copy of a campaign including all content a...
edit_campaignThe ONLY tool for modifying campaigns (name, subject, previe...
auto_fit_campaign_imagesApply the editor's magic-wand auto-fit to a draft campaign's...
get_available_filtersGet the machine-readable filter schema (types, operators, re...
update_campaign_filtersUpdate the recipient filters of a DRAFT campaign. Filters ar...
send_test_emailSend a test email for a campaign to one or more email addres...
render_campaignRender a campaign to its final HTML and plain text exactly a...
schedule_campaignSchedule a DRAFT campaign (status becomes SCHEDULED). The ca...
cancel_campaign_scheduleCancel a scheduled campaign, reverting it back to DRAFT stat...
list_campaign_historyList version history entries for a campaign. Returns entries...
get_campaign_history_entryGet a specific campaign history entry with full content. Use...
restore_campaign_historyRestore a campaign to a previous version from its history. T...
archive_campaignArchive a DRAFT campaign. Archived campaigns are hidden from...
unarchive_campaignRestore an ARCHIVED campaign back to DRAFT status so it can ...
list_workflowsList graph-based workflow automations.
get_workflowGet a Workflow draft graph, published version information, s...
create_workflowCreate a graph-based Workflow draft. It must be configured a...
configure_workflow_draftConfigure an entire Workflow draft (steps, edges, waits, bra...
update_workflow_draftReplace a Workflow draft graph atomically. The full {steps, ...
publish_workflowValidate and publish the current Workflow draft as a new imm...
update_workflow_statusActivate, pause, or archive a published Workflow.
add_subscriber_to_workflowManually enroll a subscriber in an active, published Workflo...
add_subscribers_to_workflowManually enroll a filtered subscriber set — same as Select a...
remove_subscriber_from_workflowCancel active Workflow runs for a subscriber.
get_subscriber_workflow_runsList a subscriber's workflow runs: status, current step, nex...
fast_forward_workflow_subscriberExpire the current WAIT or WAIT_UNTIL and resume the runner now.
delete_workflowDelete an unused Workflow draft, or archive it when publishe...
list_workflow_groupsList Workflow groups with their conflict strategy and assign...
get_workflow_groupGet a Workflow group, its assigned workflows, and current ac...
create_workflow_groupCreate a Workflow group. The operation is idempotent when a ...
update_workflow_groupRename a Workflow group or change its conflict strategy for ...
set_workflow_groupAssign a Workflow to an existing group, or detach it with gr...
delete_workflow_groupPermanently delete a Workflow group after a fresh read. Refu...
list_segmentsList saved subscriber segments in your organization.
get_segmentGet detailed information about a specific segment including ...
create_segmentCreate a new subscriber segment with filter configuration.
update_segmentUpdate a segment's name or filter configuration.
delete_segmentPermanently delete a segment.
duplicate_segmentCreate a copy of a segment with all its filters.
get_org_statsGet overall organization statistics including subscriber cou...
get_subscriber_growthAnalyze subscriber growth over a specified time period. Show...
get_subscriber_statsGet subscriber growth and status statistics for your organiz...
get_subscribers_by_tagGet all subscribers that have a specific tag. Useful for und...
count_subscribers_by_statusGet subscriber count by status. Optionally filter by a speci...
get_writing_styleGet the organization's default writing style for content gen...
update_writing_styleModify writing style settings (persona, audience, vocabulary...
get_email_sendersList all configured email senders (from addresses) for this ...
get_custom_fieldsList all custom subscriber field definitions for this organi...
get_email_snippetsList email snippets (reusable content blocks) for this organ...
get_email_snippetGet a single email snippet by id (snp_...) including its ful...
create_email_snippetCreate a new email snippet (reusable content block). Content...
update_email_snippetUpdate an email snippet by id (snp_...): name, description, ...
archive_email_snippetArchive an email snippet by id (snp_...). Archived snippets ...
unarchive_email_snippetRestore an archived email snippet by id (snp_...).
update_organization_settingsUpdate organization name and timezone
fetch_web_pageFetch a web page and convert to markdown format
send_emailSend a transactional email to a subscriber. The 'from' addre...
get_available_variablesGet all available variables for email content (built-in, org...
get_skillGet task-specific documentation. Call it BEFORE writing cont...
list_domainsList the organization's email sending domains with their ver...
create_domainRegister a new email sending domain and return the DNS recor...
get_domain_dns_recordsGet a domain's DNS records with their per-record verificatio...
verify_domainRe-check a domain's verification, DKIM and MAIL FROM state a...
create_email_senderCreate an email sender (from-address) as localPart@domain on...
get_deliverability_healthAssess the organization's deliverability health (sender repu...
list_suppressed_subscribersList suppressed subscribers (BOUNCED and/or COMPLAINED), mos...
reactivate_subscriberReactivate a suppressed subscriber (BOUNCED, COMPLAINED, or ...
upload_imageImport an image from a public http/https URL into your organ...
list_imagesSearch the organization media library. The query matches bot...
describe_imageSet or update the description of an image already in the med...
import_subscribersBulk import subscribers (up to 500 per call). Existing subsc...
export_subscribersExport subscribers from your organization. Optionally filter...

Subscriber Tools

List Subscribers

Endpoint: POST /api/v2/tools/list_subscribers

List subscribers in your organization. Filter by tag, status, or search query. Returns results with email, name, status, tags, sorted by creation date descending.

Parameters:

ParameterTypeRequiredDescription
limitintegerNo(default: 50)
status"all" | "SUBSCRIBED" | "UNSUBSCRIBED" | "PENDING_CONFIRMATION" | "BOUNCED" | "BANNED" | "COMPLAINED" | "TRANSACTIONAL"No(default: "all")
tagstringNoFilter by tag name (case-insensitive)
querystringNo
cursorstringNoCursor for pagination (subscriber ID from previous page)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Query Subscribers

Endpoint: POST /api/v2/tools/query_subscribers

List subscribers matching composed filters - the same engine the UI uses, cursor-paginated. Use it instead of list_subscribers when you need conditional filters (e.g. clicked link X in campaign Y AND is BANNED). Call get_skill({ type: "filters" }) for the filter shapes and operators.

Parameters:

ParameterTypeRequiredDescription
filtersarrayNoArray of filter objects - same shape as update_campaign_filters and create_segment. See get_skill({ type: "filters" }). (default: [])
status"PENDING_CONFIRMATION" | "SUBSCRIBED" | "UNSUBSCRIBED" | "BOUNCED" | "BANNED" | "COMPLAINED" | "TRANSACTIONAL" | "ALL"NoSubscriber status filter - applied in addition to the filters array. Defaults to ALL. (default: "ALL")
querystringNoFree-text search across email, name, and tag name.
limitintegerNo(default: 50)
cursorstringNoCursor for pagination (subscriber ID from previous page).
fieldsarrayNoSubset of fields to include per subscriber. Defaults to id, email, name, status, createdAt, tags. Available: id, email, name, phone, status, createdAt, updatedAt, tags, customFields, revenue, emailCount, openCount, clickCount.

Example:

curl -X POST https://lumail.io/api/v2/tools/query_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Count Subscribers

Endpoint: POST /api/v2/tools/count_subscribers

Count subscribers matching composed filters - same engine as query_subscribers but returns only the total. Useful for previews before scheduling a campaign or building a segment.

Parameters:

ParameterTypeRequiredDescription
filtersarrayNoArray of filter objects - same shape as update_campaign_filters and create_segment. (default: [])
status"PENDING_CONFIRMATION" | "SUBSCRIBED" | "UNSUBSCRIBED" | "BOUNCED" | "BANNED" | "COMPLAINED" | "TRANSACTIONAL" | "ALL"NoSubscriber status filter - applied in addition to the filters array. Defaults to ALL. (default: "ALL")
querystringNoFree-text search across email, name, and tag name.

Example:

curl -X POST https://lumail.io/api/v2/tools/count_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Subscriber

Endpoint: POST /api/v2/tools/get_subscriber

Get detailed information about a specific subscriber by ID or email.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringNo
emailstringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/get_subscriber \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Add Subscriber

Endpoint: POST /api/v2/tools/add_subscriber

Add a new subscriber or update an existing one. Supports tags and custom fields.

Parameters:

ParameterTypeRequiredDescription
emailstringYes
namestringNo
phonestringNo
tagsarrayNo(default: [])
fieldsobjectNo
replaceTagsbooleanNo(default: false)
resubscribebooleanNoRe-subscribe if they were unsubscribed. (default: true)
triggerWorkflowsbooleanNoFire matching workflows. (default: true). Pass false to skip.
skipDoubleOptInbooleanNoCreate or promote as SUBSCRIBED even if organization double opt-in is on. Default false. Does not resubscribe UNSUBSCRIBED alone, and does not write confirmation evidence.
ipAddressstringNo
countrystringNoISO-3166 alpha-2

Example:

curl -X POST https://lumail.io/api/v2/tools/add_subscriber \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Subscriber

Endpoint: POST /api/v2/tools/update_subscriber

Update a subscriber by ID or email. Same fields as add_subscriber, but omitted resubscribe / triggerWorkflows are left unset (a name-only patch does not resubscribe).

Parameters:

ParameterTypeRequiredDescription
subscriberstringYesID or email
emailstringNo
namestringNo
phonestringNo
tagsarrayNo
fieldsobjectNo
replaceTagsbooleanNo
resubscribebooleanNoDefault unset / false. Pass true to re-subscribe.
triggerWorkflowsbooleanNoPass false to skip automations.
skipDoubleOptInbooleanNoPromote pending contacts to SUBSCRIBED before tag events. Default false.
ipAddressstringNo
countrystringNoISO-3166 alpha-2

Example:

curl -X POST https://lumail.io/api/v2/tools/update_subscriber \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"subscriber":"[email protected]","name":"Ada"}'

Unsubscribe

Endpoint: POST /api/v2/tools/unsubscribe

Unsubscribe a subscriber by ID or email. The subscriber will no longer receive emails.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringNo
emailstringNo
reasonstringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/unsubscribe \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Bulk Add Tags

Endpoint: POST /api/v2/tools/bulk_add_tags

Add one or more tags to multiple subscribers at once. Max 100 subscribers and 20 tags per call. Emits a tag.added event for each newly added tag, so tag-based workflow triggers (including Workflow event triggers) will fire exactly like when tags are added from the app.

Parameters:

ParameterTypeRequiredDescription
subscriberIdsarrayYes
tagNamesarrayYes

Example:

curl -X POST https://lumail.io/api/v2/tools/bulk_add_tags \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Bulk Remove Tags

Endpoint: POST /api/v2/tools/bulk_remove_tags

Remove one or more tags from multiple subscribers. Max 100 subscribers and 20 tags per call. Emits a tag.removed event for each removed tag, so tag-based workflow triggers and exit rules react exactly like when tags are removed from the app.

Parameters:

ParameterTypeRequiredDescription
subscriberIdsarrayYes
tagNamesarrayYes

Example:

curl -X POST https://lumail.io/api/v2/tools/bulk_remove_tags \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Event

Endpoint: POST /api/v2/tools/create_event

Create a custom event for a subscriber. Useful for tracking purchases, conversions, or other actions.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringNo
emailstringNo
eventType"SUBSCRIBER_PAYMENT" | "SUBSCRIBER_REFUND"Yes
amountnumberNo
currencystringNo(default: "USD")
metadataobjectNo

Example:

curl -X POST https://lumail.io/api/v2/tools/create_event \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

List Subscriber Events

Endpoint: POST /api/v2/tools/list_subscriber_events

List events for a subscriber. Use this to check if an email was delivered, opened, clicked, bounced, etc. Filter by event type to find specific events.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringNo
emailstringNo
eventType"SUBSCRIBED" | "UNSUBSCRIBED" | "TAG_ADDED" | "TAG_REMOVED" | "EMAIL_OPENED" | "EMAIL_CLICKED" | "EMAIL_SENT" | "EMAIL_DELIVERY_DELAYED" | "WORKFLOW_STARTED" | "WORKFLOW_COMPLETED" | "WORKFLOW_CANCELED" | "FIELD_UPDATED" | "EMAIL_BOUNCED" | "EMAIL_COMPLAINED" | "EMAIL_RECEIVED" | "WEBHOOK_EXECUTED" | "SUBSCRIBER_PAYMENT" | "SUBSCRIBER_REFUND"No
limitintegerNo(default: 50)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_subscriber_events \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Subscriber Emails

Endpoint: POST /api/v2/tools/get_subscriber_emails

Get emails sent to a subscriber with their delivery status. Use this to check if emails were delivered, bounced, or are pending. Shows campaign name, subject, and detailed status.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringNo
emailstringNo
status"PENDING" | "SENT" | "DELIVERED" | "BOUNCED" | "COMPLAINED"No
limitintegerNo(default: 20)

Example:

curl -X POST https://lumail.io/api/v2/tools/get_subscriber_emails \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Tag Tools

List Tags

Endpoint: POST /api/v2/tools/list_tags

List all tags in your organization.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/list_tags \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Tag

Endpoint: POST /api/v2/tools/create_tag

Create a new tag in your organization.

Parameters:

ParameterTypeRequiredDescription
namestringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/create_tag \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete Tag

Endpoint: POST /api/v2/tools/delete_tag

Delete a tag by ID or name. This will remove the tag from all subscribers.

Parameters:

ParameterTypeRequiredDescription
tagIdstringNo
namestringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/delete_tag \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Or Create Tags

Endpoint: POST /api/v2/tools/get_or_create_tags

Get existing tags or create new ones by name. Tags are labels used to categorize subscribers and trigger workflows. This tool automatically creates any tags that don't exist yet.

Parameters:

ParameterTypeRequiredDescription
namesarrayYesArray of tag names to get or create

Example:

curl -X POST https://lumail.io/api/v2/tools/get_or_create_tags \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Campaign Tools

List Campaigns

Endpoint: POST /api/v2/tools/list_campaigns

List email campaigns in your organization with optional filtering by status and search.

Parameters:

ParameterTypeRequiredDescription
limitintegerNo(default: 20)
pageintegerNo(default: 1)
status"DRAFT" | "SCHEDULED" | "SENDING" | "SENT" | "ARCHIVED" | "FAILED"No
querystringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/list_campaigns \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Campaign

Endpoint: POST /api/v2/tools/create_campaign

Create a new email campaign. The campaign will be created in DRAFT status. If no senderId is provided, it will use the default sender, then last used sender, then any available sender.

Parameters:

ParameterTypeRequiredDescription
subjectstringYesEmail subject line (required)
namestringNoCampaign name (default: "Untitled")
previewunknownNoPreview/preheader text shown in email clients
contentunknownNoTipTap JSON content (object or JSON-stringified). If not provided, a default template with Hello World and unsubscribe link is used. Call get_skill({ type: "campaign" }) for the full TipTap format reference.
contentType"MAILY" | "PLATE" | "MARKDOWN"NoContent format type (default: "MAILY")
senderIdstringNoEmail sender ID. If not provided, uses default sender. Call get_email_senders to list available senders.
replyTounknownNoReply-to email address

Example:

curl -X POST https://lumail.io/api/v2/tools/create_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Campaign

Endpoint: POST /api/v2/tools/get_campaign

Get detailed information about a specific campaign by ID. Returns senderId, sender (id, name, email), replyTo, recipientFilters, content, preview, and contentType.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/get_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Campaign Progress

Endpoint: POST /api/v2/tools/get_campaign_progress

Get the sending progress of a campaign that is currently being sent.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/get_campaign_progress \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Campaign Analytics

Endpoint: POST /api/v2/tools/get_campaign_analytics

Get detailed analytics for a sent campaign including opens, clicks, and link performance.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/get_campaign_analytics \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Duplicate Campaign

Endpoint: POST /api/v2/tools/duplicate_campaign

Create a complete copy of a campaign including all content and settings. The duplicate will be a DRAFT.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYes
newNamestringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/duplicate_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Edit Campaign

Endpoint: POST /api/v2/tools/edit_campaign

The ONLY tool for modifying campaigns (name, subject, preview, senderId, replyTo, content).

TWO exclusive modes:

  • "content": full TipTap JSON document ({ type: "doc", content: [...] }) — for new content or a complete rewrite.
  • "operations": array of surgical edits on the existing content (replace_text, insert_node, append_node, prepend_node, remove_node, replace_node) — cheaper for a typo, a link, adding a CTA, removing a paragraph. Metadata fields (name, subject, preview, senderId, replyTo) can be combined with either mode. NEVER send content and operations together.

BEFORE writing any content or operations, call get_skill({ type: "campaign" }). It documents the TipTap node types, text marks, "Show if" tag conditions, the exact operations syntax and the mandatory rules. Do not guess the format from memory.

WHEN NOT TO USE:

  • Listing/searching campaigns -> use list_campaigns
  • Getting campaign details -> use get_campaign
  • Updating recipient filters -> use update_campaign_filters

Parameters:

ParameterTypeRequiredDescription
idstringYesCampaign ID to update
namestringNoNew campaign name
subjectstringNoNew subject line
previewunknownNoNew preview/preheader text
contentunknownNoFull TipTap JSON document ({ type: 'doc', content: [...] }). Send as a parsed object (preferred) or a JSON-stringified value - both are accepted. Use for complete content rewrites. Cannot be combined with operations.
operationsarrayNoArray of surgical edit operations to apply to existing content. Cannot be combined with content.
senderIdstringNoEmail sender ID. Call get_email_senders to list available senders.
replyTounknownNoReply-to email address. Pass null to clear.
contentType"MAILY" | "PLATE" | "MARKDOWN"NoContent format type.

Example:

curl -X POST https://lumail.io/api/v2/tools/edit_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Auto Fit Campaign Images

Endpoint: POST /api/v2/tools/auto_fit_campaign_images

Apply the editor's magic-wand auto-fit to a draft campaign's images: reads each image's natural dimensions and fits it without upscaling. Always run with dryRun=true first to inspect the proposed sizes. Call get_skill({ type: "images" }) for the full sequence, sizing rules and safety limits.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign or internal workflow email ID.
imageIndexesarrayNoOptional image indexes from this tool's dry-run output. Omit to auto-fit every image in document traversal order.
maxWidthintegerNo(default: 600)
maxHeightintegerNo(default: 400)
dryRunbooleanNoInspect and calculate dimensions without changing the campaign. (default: false)

Example:

curl -X POST https://lumail.io/api/v2/tools/auto_fit_campaign_images \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Available Filters

Endpoint: POST /api/v2/tools/get_available_filters

Get the machine-readable filter schema (types, operators, required fields) used by update_campaign_filters, query_subscribers and segments. Prefer get_skill({ type: 'filters' }), which also documents how to resolve each ID.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_available_filters \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Campaign Filters

Endpoint: POST /api/v2/tools/update_campaign_filters

Update the recipient filters of a DRAFT campaign. Filters are combined with AND. Call get_skill({ type: 'filters' }) first for the filter shapes, operators and how to resolve each ID.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to update
filtersarrayYesArray of filters to apply

Example:

curl -X POST https://lumail.io/api/v2/tools/update_campaign_filters \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Send Test Email

Endpoint: POST /api/v2/tools/send_test_email

Send a test email for a campaign to one or more email addresses (max 5). The test email will have '[Test]' prefix in the subject. Test emails are not tracked in analytics.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to send test for
emailsarrayYesEmail addresses to send test to (1-5)

Example:

curl -X POST https://lumail.io/api/v2/tools/send_test_email \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Render Campaign

Endpoint: POST /api/v2/tools/render_campaign

Render a campaign to its final HTML and plain text exactly as delivered (snippets inlined, variables resolved, unsubscribe footer added). Nothing is sent. Use it to self-verify content before schedule_campaign. Pass subscriberId to resolve variables and "Show if" conditions for that subscriber; otherwise all conditional blocks are shown.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to render
subscriberIdstringNoOptional subscriber ID to resolve variables and conditional blocks for
format"html" | "text" | "both"NoWhich output to return (default: both)

Example:

curl -X POST https://lumail.io/api/v2/tools/render_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Schedule Campaign

Endpoint: POST /api/v2/tools/schedule_campaign

Schedule a DRAFT campaign (status becomes SCHEDULED). The campaign must contain an unsubscribe link. No date sends immediately; a date without time sends at midnight in the given timezone.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to schedule
datestringNoDate to schedule (ISO format, e.g. '2025-03-20'). If omitted, sends immediately.
hoursintegerNoHour to send (0-23)
minutesintegerNoMinutes (0-59)
timezonestringNoTimezone for the scheduled time (e.g. 'Europe/Paris', 'America/New_York') (default: "Europe/Paris")

Example:

curl -X POST https://lumail.io/api/v2/tools/schedule_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Cancel Campaign Schedule

Endpoint: POST /api/v2/tools/cancel_campaign_schedule

Cancel a scheduled campaign, reverting it back to DRAFT status. Only works on SCHEDULED campaigns (not SENDING or SENT).

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to cancel schedule for

Example:

curl -X POST https://lumail.io/api/v2/tools/cancel_campaign_schedule \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

List Campaign History

Endpoint: POST /api/v2/tools/list_campaign_history

List version history entries for a campaign. Returns entries sorted by most recent first with cursor-based pagination. Each entry shows when it was saved and the source (autosave, manual, or ai).

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to get history for
cursorstringNoCursor for pagination (history entry ID from previous page)
limitintegerNoNumber of entries to return (default 20, max 100) (default: 20)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_campaign_history \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Campaign History Entry

Endpoint: POST /api/v2/tools/get_campaign_history_entry

Get a specific campaign history entry with full content. Use this to inspect what the campaign looked like at a specific point in time before restoring it.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID
historyIdstringYesHistory entry ID to retrieve

Example:

curl -X POST https://lumail.io/api/v2/tools/get_campaign_history_entry \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Restore Campaign History

Endpoint: POST /api/v2/tools/restore_campaign_history

Restore a campaign to a previous version from its history. This updates the campaign's subject and content to match the selected history entry, and creates a new history entry recording the restoration.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to restore
historyIdstringYesHistory entry ID to restore from

Example:

curl -X POST https://lumail.io/api/v2/tools/restore_campaign_history \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Archive Campaign

Endpoint: POST /api/v2/tools/archive_campaign

Archive a DRAFT campaign. Archived campaigns are hidden from the main campaign list but can be restored with unarchive_campaign. Only DRAFT campaigns can be archived.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to archive

Example:

curl -X POST https://lumail.io/api/v2/tools/archive_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Unarchive Campaign

Endpoint: POST /api/v2/tools/unarchive_campaign

Restore an ARCHIVED campaign back to DRAFT status so it can be edited and scheduled again.

Parameters:

ParameterTypeRequiredDescription
campaignIdstringYesCampaign ID to unarchive

Example:

curl -X POST https://lumail.io/api/v2/tools/unarchive_campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Workflow Tools

List Workflows

Endpoint: POST /api/v2/tools/list_workflows

List graph-based workflow automations.

Parameters:

ParameterTypeRequiredDescription
limitintegerNo(default: 20)
querystringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/list_workflows \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Workflow

Endpoint: POST /api/v2/tools/get_workflow

Get a Workflow draft graph, published version information, settings, and active subscriber count.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/get_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Workflow

Endpoint: POST /api/v2/tools/create_workflow

Create a graph-based Workflow draft. It must be configured and published before it can enroll subscribers.

Parameters:

ParameterTypeRequiredDescription
namestringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/create_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Configure Workflow Draft

Endpoint: POST /api/v2/tools/configure_workflow_draft

Configure an entire Workflow draft (steps, edges, waits, branches, actions, goals, settings) in one atomic operation. Never publishes or sends. Call get_skill({ type: 'workflow' }) then get_workflow first - the skill documents the step types, edges, eventFilters keys and the EMAIL-step rule that replaces create_campaign.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
expectedUpdatedAtstringYesExact updatedAt returned by get_workflow
settingsobjectNo
stepsarrayYesComplete replacement list of Workflow steps
edgesarrayYesComplete replacement list of directed graph edges
successGoalsarrayNo

Example:

curl -X POST https://lumail.io/api/v2/tools/configure_workflow_draft \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Workflow Draft

Endpoint: POST /api/v2/tools/update_workflow_draft

Replace a Workflow draft graph atomically. The full {steps, edges} definition is validated before it is saved. Every EMAIL step is ownership-checked; foreign or broadcast campaign IDs are duplicated into dedicated internal WORKFLOW emails before saving.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
expectedUpdatedAtstringYes
definitionobjectYesComplete Workflow graph. Use configure_workflow_draft to add EMAIL steps with inline content. Existing campaign IDs are ownership-checked and duplicated rather than linked when they do not belong to that exact step.

Example:

curl -X POST https://lumail.io/api/v2/tools/update_workflow_draft \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Publish Workflow

Endpoint: POST /api/v2/tools/publish_workflow

Validate and publish the current Workflow draft as a new immutable version. Activation: publishing never deactivates a live workflow and never re-activates a paused one; pass activate:true to go live, activate:false to publish paused. When omitted, only a first publish (DRAFT) activates.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
activatebooleanNotrue: activate after publishing. false: keep the workflow paused. Omitted: first publish activates, a paused workflow stays paused.

Example:

curl -X POST https://lumail.io/api/v2/tools/publish_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Workflow Status

Endpoint: POST /api/v2/tools/update_workflow_status

Activate, pause, or archive a published Workflow.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
status"ACTIVE" | "PAUSED" | "ARCHIVED"Yes

Example:

curl -X POST https://lumail.io/api/v2/tools/update_workflow_status \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Add Subscriber To Workflow

Endpoint: POST /api/v2/tools/add_subscriber_to_workflow

Manually enroll a subscriber in an active, published Workflow.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
subscriberIdstringNo
emailstringNo
stepIdstringNoPublished step to start from

Example:

curl -X POST https://lumail.io/api/v2/tools/add_subscriber_to_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Add Subscribers To Workflow

Endpoint: POST /api/v2/tools/add_subscribers_to_workflow

Manually enroll a filtered subscriber set in an active published Workflow — same as Subscribers → Select all → Add to workflow. Call with dryRun: true first.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
stepIdstringNoPublished step to start from
filtersarrayNoSame filters as query_subscribers
querystringNoFree-text search
statusstringNoDefaults to SUBSCRIBED
subscriberIdsarrayNoExplicit IDs instead of filters. Max 500
dryRunbooleanNoPreview match count and published steps

Example:

curl -X POST https://lumail.io/api/v2/tools/add_subscribers_to_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workflowId":"workflow-id","dryRun":true,"filters":[]}'

Remove Subscriber From Workflow

Endpoint: POST /api/v2/tools/remove_subscriber_from_workflow

Cancel active Workflow runs for a subscriber.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
subscriberIdstringNo
emailstringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/remove_subscriber_from_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Subscriber Workflow Runs

Endpoint: POST /api/v2/tools/get_subscriber_workflow_runs

List a subscriber's workflow runs in this organization: status, current step, and nextActionAt. Active and waiting runs first, then recent completed or failed runs.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringNo
emailstringNo
workflowIdstringNoIf set, only return runs for this workflow.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_subscriber_workflow_runs \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]"}'

Fast Forward Workflow Subscriber

Endpoint: POST /api/v2/tools/fast_forward_workflow_subscriber

Expire the current WAIT or WAIT_UNTIL timer on one subscriber's run and resume the runner immediately. The next EMAIL or ACTION executes for real. One call completes one wait. WAIT_UNTIL follows the TIMEOUT edge.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
subscriberIdstringNo
emailstringNo
workflowSubscriberIdstringNoRequired when more than one waiting run exists

Example:

curl -X POST https://lumail.io/api/v2/tools/fast_forward_workflow_subscriber \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workflowId":"workflow-id","email":"[email protected]"}'

Delete Workflow

Endpoint: POST /api/v2/tools/delete_workflow

Delete an unused Workflow draft, or archive it when published versions or run history must be preserved.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/delete_workflow \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

List Workflow Groups

Endpoint: POST /api/v2/tools/list_workflow_groups

List Workflow groups with their conflict strategy and assigned workflow count. Call this before assigning a groupId; never invent a group ID.

Parameters:

ParameterTypeRequiredDescription
querystringNo
limitintegerNo(default: 50)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_workflow_groups \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Workflow Group

Endpoint: POST /api/v2/tools/get_workflow_group

Get a Workflow group, its assigned workflows, and current active-run counts.

Parameters:

ParameterTypeRequiredDescription
groupIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/get_workflow_group \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Workflow Group

Endpoint: POST /api/v2/tools/create_workflow_group

Create a Workflow group. The operation is idempotent when a case-insensitive name match already has the requested strategy.

Parameters:

ParameterTypeRequiredDescription
namestringYes
conflictStrategy"CANCEL_EXISTING" | "SKIP_NEW" | "RUN_FIRST_STEP"No(default: "CANCEL_EXISTING")

Example:

curl -X POST https://lumail.io/api/v2/tools/create_workflow_group \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Workflow Group

Endpoint: POST /api/v2/tools/update_workflow_group

Rename a Workflow group or change its conflict strategy for future enrollments. Requires a fresh get_workflow_group read and optimistic concurrency.

Parameters:

ParameterTypeRequiredDescription
groupIdstringYes
expectedUpdatedAtstringYes
namestringNo
conflictStrategy"CANCEL_EXISTING" | "SKIP_NEW" | "RUN_FIRST_STEP"No

Example:

curl -X POST https://lumail.io/api/v2/tools/update_workflow_group \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Set Workflow Group

Endpoint: POST /api/v2/tools/set_workflow_group

Assign a Workflow to an existing group, or detach it with groupId:null, without replacing its graph or publishing. The change affects future enrollments only.

Parameters:

ParameterTypeRequiredDescription
workflowIdstringYes
expectedUpdatedAtstringYes
groupIdunknownYes

Example:

curl -X POST https://lumail.io/api/v2/tools/set_workflow_group \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete Workflow Group

Endpoint: POST /api/v2/tools/delete_workflow_group

Permanently delete a Workflow group after a fresh read. Refuses to delete an assigned group unless unassignWorkflows:true is explicit.

Parameters:

ParameterTypeRequiredDescription
groupIdstringYes
expectedNamestringYes
expectedUpdatedAtstringYes
unassignWorkflowsbooleanNo(default: false)

Example:

curl -X POST https://lumail.io/api/v2/tools/delete_workflow_group \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Segment Tools

List Segments

Endpoint: POST /api/v2/tools/list_segments

List saved subscriber segments in your organization.

Parameters:

ParameterTypeRequiredDescription
limitintegerNo(default: 20)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_segments \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Segment

Endpoint: POST /api/v2/tools/get_segment

Get detailed information about a specific segment including all filter configurations.

Parameters:

ParameterTypeRequiredDescription
segmentIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/get_segment \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Segment

Endpoint: POST /api/v2/tools/create_segment

Create a new subscriber segment with filter configuration.

Parameters:

ParameterTypeRequiredDescription
namestringYes
filtersarrayNo(default: [])

Example:

curl -X POST https://lumail.io/api/v2/tools/create_segment \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Segment

Endpoint: POST /api/v2/tools/update_segment

Update a segment's name or filter configuration.

Parameters:

ParameterTypeRequiredDescription
segmentIdstringYes
namestringNo
filtersarrayNo

Example:

curl -X POST https://lumail.io/api/v2/tools/update_segment \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete Segment

Endpoint: POST /api/v2/tools/delete_segment

Permanently delete a segment.

Parameters:

ParameterTypeRequiredDescription
segmentIdstringYes

Example:

curl -X POST https://lumail.io/api/v2/tools/delete_segment \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Duplicate Segment

Endpoint: POST /api/v2/tools/duplicate_segment

Create a copy of a segment with all its filters.

Parameters:

ParameterTypeRequiredDescription
segmentIdstringYes
newNamestringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/duplicate_segment \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Analytics Tools

Get Org Stats

Endpoint: POST /api/v2/tools/get_org_stats

Get overall organization statistics including subscriber counts, campaign metrics, and resource totals.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_org_stats \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Subscriber Growth

Endpoint: POST /api/v2/tools/get_subscriber_growth

Analyze subscriber growth over a specified time period. Shows new subscribers, unsubscribes, and net growth.

Parameters:

ParameterTypeRequiredDescription
daysintegerNo(default: 30)

Example:

curl -X POST https://lumail.io/api/v2/tools/get_subscriber_growth \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Subscriber Stats

Endpoint: POST /api/v2/tools/get_subscriber_stats

Get subscriber growth and status statistics for your organization.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_subscriber_stats \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Subscribers By Tag

Endpoint: POST /api/v2/tools/get_subscribers_by_tag

Get all subscribers that have a specific tag. Useful for understanding tag usage.

Parameters:

ParameterTypeRequiredDescription
tagNamestringYes
limitintegerNo(default: 10)

Example:

curl -X POST https://lumail.io/api/v2/tools/get_subscribers_by_tag \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Count Subscribers By Status

Endpoint: POST /api/v2/tools/count_subscribers_by_status

Get subscriber count by status. Optionally filter by a specific status.

Parameters:

ParameterTypeRequiredDescription
status"SUBSCRIBED" | "UNSUBSCRIBED" | "BOUNCED" | "BANNED" | "COMPLAINED"No

Example:

curl -X POST https://lumail.io/api/v2/tools/count_subscribers_by_status \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Settings Tools

Get Writing Style

Endpoint: POST /api/v2/tools/get_writing_style

Get the organization's default writing style for content generation including persona, audience, vocabulary, and rules.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_writing_style \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Writing Style

Endpoint: POST /api/v2/tools/update_writing_style

Modify writing style settings (persona, audience, vocabulary, rules)

Parameters:

ParameterTypeRequiredDescription
namestringNo
personastringNo
audiencestringNo
vocabularystringNo
rulesstringNo

Example:

curl -X POST https://lumail.io/api/v2/tools/update_writing_style \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Email Senders

Endpoint: POST /api/v2/tools/get_email_senders

List all configured email senders (from addresses) for this organization.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_email_senders \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Custom Fields

Endpoint: POST /api/v2/tools/get_custom_fields

List all custom subscriber field definitions for this organization.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_custom_fields \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Email Snippets

Endpoint: POST /api/v2/tools/get_email_snippets

List email snippets (reusable content blocks) for this organization. Use get_email_snippet to read a snippet's content.

Parameters:

ParameterTypeRequiredDescription
includeArchivedbooleanNoInclude archived snippets (default: false)

Example:

curl -X POST https://lumail.io/api/v2/tools/get_email_snippets \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Email Snippet

Endpoint: POST /api/v2/tools/get_email_snippet

Get a single email snippet by id (snp_...) including its full TipTap JSON content. Use this before update_email_snippet to read the current content.

Parameters:

ParameterTypeRequiredDescription
idstringYesSnippet id, e.g. snp_...

Example:

curl -X POST https://lumail.io/api/v2/tools/get_email_snippet \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Email Snippet

Endpoint: POST /api/v2/tools/create_email_snippet

Create a new email snippet (reusable content block). Content is TipTap JSON with the same node types as campaigns: { type: "doc", content: [...] }. Snippets can then be referenced inside campaign content.

Parameters:

ParameterTypeRequiredDescription
namestringYesSnippet name
descriptionstringNoOptional description
contentunknownNoTipTap JSON content: { type: "doc", content: [...] }. Omit to create an empty snippet.

Example:

curl -X POST https://lumail.io/api/v2/tools/create_email_snippet \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Email Snippet

Endpoint: POST /api/v2/tools/update_email_snippet

Update an email snippet by id (snp_...): name, description, and/or its TipTap JSON content ({ type: "doc", content: [...] }, same node types as campaigns). Content updates apply everywhere the snippet is used. Read the current content with get_email_snippet first when editing.

Parameters:

ParameterTypeRequiredDescription
idstringYesSnippet id, e.g. snp_...
namestringNoNew snippet name
descriptionstringNoNew description
contentunknownNoNew TipTap JSON content: { type: "doc", content: [...] }. Replaces the entire snippet content.

Example:

curl -X POST https://lumail.io/api/v2/tools/update_email_snippet \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Archive Email Snippet

Endpoint: POST /api/v2/tools/archive_email_snippet

Archive an email snippet by id (snp_...). Archived snippets are hidden from the snippet list but existing campaigns referencing them keep working. Restore with unarchive_email_snippet.

Parameters:

ParameterTypeRequiredDescription
idstringYesSnippet id, e.g. snp_...

Example:

curl -X POST https://lumail.io/api/v2/tools/archive_email_snippet \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Unarchive Email Snippet

Endpoint: POST /api/v2/tools/unarchive_email_snippet

Restore an archived email snippet by id (snp_...).

Parameters:

ParameterTypeRequiredDescription
idstringYesSnippet id, e.g. snp_...

Example:

curl -X POST https://lumail.io/api/v2/tools/unarchive_email_snippet \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Organization Settings

Endpoint: POST /api/v2/tools/update_organization_settings

Update organization name and timezone

Parameters:

ParameterTypeRequiredDescription
namestringNoOrganization name
timezonestringNoTimezone in IANA format

Example:

curl -X POST https://lumail.io/api/v2/tools/update_organization_settings \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Skill Tools

Get Available Variables

Endpoint: POST /api/v2/tools/get_available_variables

Get all available variables for email content (built-in, organization, custom fields, snippets)

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/get_available_variables \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Skill

Endpoint: POST /api/v2/tools/get_skill

Get task-specific documentation. Call it BEFORE writing content, filters, or a workflow graph - never guess a format from memory. Types: 'campaign' (TipTap content + edit_campaign operations), 'filters' (subscriber/recipient filter shapes), 'workflow' (draft graph), 'sending' (domain, DNS and sender setup), 'images', 'snippets', 'templates', 'variables', 'copywriter', 'onboarding', 'docs' (full product docs catalog, or one page with page).

Parameters:

ParameterTypeRequiredDescription
type"campaign" | "snippets" | "templates" | "variables" | "copywriter" | "filters" | "images" | "sending" | "workflow" | "onboarding" | "docs"YesSkill type to retrieve
pagestringNoWith type: "docs", the page slug (example: workflows/workflow-manual-enrollment)

Example:

curl -X POST https://lumail.io/api/v2/tools/get_skill \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Email Tools

Send Email

Endpoint: POST /api/v2/tools/send_email

Send a transactional email to a subscriber. The 'from' address must use a verified domain.

Parameters:

ParameterTypeRequiredDescription
fromstringYesVerified domain mailbox
tostringYesOne address, or a one-item array
subjectstringYes
htmlstringNoExactly one of html or tiptap
tiptapunknownNoExactly one of html or tiptap
textstringNoGenerated from HTML when omitted. "" skips generation
reply_tostringNoSingle address (string or one-item array)
replyTostringNoAlias of reply_to
ccarrayNo
headersobjectNo
tagsarrayNo{ name, value }
previewstringNo
idempotencyKeystringNo

content, contentType, and markdown are rejected.

Example:

curl -X POST https://lumail.io/api/v2/tools/send_email \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Domain Tools

List Domains

Endpoint: POST /api/v2/tools/list_domains

List the organization's email sending domains with their verification status. Call get_skill({ type: 'sending' }) for the full domain and sender setup flow.

Parameters:

No parameters required.

Example:

curl -X POST https://lumail.io/api/v2/tools/list_domains \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Domain

Endpoint: POST /api/v2/tools/create_domain

Register a new email sending domain and return the DNS records the user must add. Call get_skill({ type: 'sending' }) first for the full setup flow.

Parameters:

ParameterTypeRequiredDescription
domainstringYesThe domain to register, e.g. mail.example.com

Example:

curl -X POST https://lumail.io/api/v2/tools/create_domain \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Domain Dns Records

Endpoint: POST /api/v2/tools/get_domain_dns_records

Get a domain's DNS records with their per-record verification status, to show the user what to configure and what is still pending.

Parameters:

ParameterTypeRequiredDescription
domainIdstringYesThe MailDomain id

Example:

curl -X POST https://lumail.io/api/v2/tools/get_domain_dns_records \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Verify Domain

Endpoint: POST /api/v2/tools/verify_domain

Re-check a domain's verification, DKIM and MAIL FROM state and return the updated per-record DNS statuses. Call get_skill({ type: 'sending' }) for what to do with the result.

Parameters:

ParameterTypeRequiredDescription
domainIdstringYesThe MailDomain id

Example:

curl -X POST https://lumail.io/api/v2/tools/verify_domain \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Create Email Sender

Endpoint: POST /api/v2/tools/create_email_sender

Create an email sender (from-address) as localPart@domain on an already VERIFIED domain. Call get_skill({ type: 'sending' }) for the prerequisites.

Parameters:

ParameterTypeRequiredDescription
displayNamestringYesThe display name shown in the From header
localPartstringYesThe part before the @, e.g. 'hello' in [email protected]
domainIdstringYesThe verified MailDomain id
replyTounknownNoOptional reply-to email address

Example:

curl -X POST https://lumail.io/api/v2/tools/create_email_sender \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Deliverability Tools

Get Deliverability Health

Endpoint: POST /api/v2/tools/get_deliverability_health

Assess the organization's deliverability health (sender reputation). Omit sinceDays for the all-time trust score; pass it for a windowed sent/delivered/bounced/complained report with verdicts.

Parameters:

ParameterTypeRequiredDescription
sinceDaysintegerNo

Example:

curl -X POST https://lumail.io/api/v2/tools/get_deliverability_health \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

List Suppressed Subscribers

Endpoint: POST /api/v2/tools/list_suppressed_subscribers

List suppressed subscribers (BOUNCED and/or COMPLAINED), most recently suppressed first, with pagination. Each entry includes the most recent bounce/complaint event details (bounceCategory, reason, bounceType, provider, complaintFeedbackType).

Parameters:

ParameterTypeRequiredDescription
status"BOUNCED" | "COMPLAINED"No
pageintegerNo(default: 1)
pageSizeintegerNo(default: 50)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_suppressed_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Reactivate Subscriber

Endpoint: POST /api/v2/tools/reactivate_subscriber

Reactivate a suppressed subscriber (BOUNCED, COMPLAINED, or UNSUBSCRIBED) by setting their status back to SUBSCRIBED. Refuses hard bounces (bounceCategory NO_SUCH_USER or INTERNAL / SES suppression list) unless 'force' is true.

Parameters:

ParameterTypeRequiredDescription
subscriberIdstringYes
forcebooleanNo

Example:

curl -X POST https://lumail.io/api/v2/tools/reactivate_subscriber \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Image Tools

Upload Image

Endpoint: POST /api/v2/tools/upload_image

Import an image from a public http/https URL into your organization media library. Fetches the image, validates it is an image under 2MB, uploads it to storage, and returns the hosted image with a URL that can be used directly in campaign image blocks.

Parameters:

ParameterTypeRequiredDescription
urlstringYesPublic http(s) URL of the image to import.
namestringNoOptional display name for the imported image.
descriptionstringNoShort description of what the image shows (subject, colors, intended usage). Strongly recommended: this is what makes the image findable later with list_images.

Example:

curl -X POST https://lumail.io/api/v2/tools/upload_image \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

List Images

Endpoint: POST /api/v2/tools/list_images

Search the organization media library. The query matches both the image name and its description, so you can search by what the image shows (e.g. 'logo', 'hero photo'). Newest first.

Parameters:

ParameterTypeRequiredDescription
querystringNoOptional case-insensitive search matched against both the image name and its description.
capturePageIdstringNoOnly return images uploaded for this capture page. Omit to search the whole library.
pageintegerNo(default: 1)
pageSizeintegerNo(default: 50)

Example:

curl -X POST https://lumail.io/api/v2/tools/list_images \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Describe Image

Endpoint: POST /api/v2/tools/describe_image

Set or update the description of an image already in the media library. Use it right after a user uploads an image so it becomes findable later with list_images. Accepts either the image id or its URL.

Parameters:

ParameterTypeRequiredDescription
imageIdstringNoId of the image. Provide either imageId or url.
urlstringNoURL of the image. Provide either imageId or url.
descriptionstringYesWhat the image shows: subject, dominant colors, and how it should be used on the page.
namestringNoOptional human-readable name replacing the raw filename.

Example:

curl -X POST https://lumail.io/api/v2/tools/describe_image \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Import and export Tools

Import Subscribers

Endpoint: POST /api/v2/tools/import_subscribers

Bulk import subscribers (up to 500 per call). Existing subscribers are updated, new ones created, and workflows are NOT triggered by default. Returns imported/updated/failed counts with per-row errors.

Parameters:

ParameterTypeRequiredDescription
subscribersarrayYes
resubscribebooleanNoRe-subscribe previously unsubscribed contacts. (default: false)
triggerWorkflowsbooleanNoTrigger automation workflows on import. Defaults to false for bulk imports. (default: false)

Example:

curl -X POST https://lumail.io/api/v2/tools/import_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Export Subscribers

Endpoint: POST /api/v2/tools/export_subscribers

Export subscribers from your organization. Optionally filter by status and tag name. Returns JSON objects or a CSV string with email, name, phone, status, tags, custom fields, and creation date. Respects a configurable limit (default 1000, max 10000).

Parameters:

ParameterTypeRequiredDescription
status"PENDING_CONFIRMATION" | "SUBSCRIBED" | "UNSUBSCRIBED" | "BOUNCED" | "BANNED" | "COMPLAINED" | "TRANSACTIONAL"No
tagstringNoFilter by tag name (case-insensitive).
format"json" | "csv"No(default: "json")
limitintegerNo(default: 1000)

Example:

curl -X POST https://lumail.io/api/v2/tools/export_subscribers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Web Tools

Fetch Web Page

Endpoint: POST /api/v2/tools/fetch_web_page

Fetch a web page and convert to markdown format

Parameters:

ParameterTypeRequiredDescription
urlstringYesThe full URL of the web page to fetch (must start with http:// or https://)

Example:

curl -X POST https://lumail.io/api/v2/tools/fetch_web_page \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'