Bellaso Agent API

Tools backed by the email module


Email marketing

POST
https://dtrgbxembnbwlmpvhhms.supabase.co/functions/v1/cortex-mcp
/api/v1/tools/get_email
Bearer (ck_ endpoint token)

Email marketing analytics from the email_campaigns mart. Pick the mode: summary (sends, delivered, opens, clicks, unsubscribes, bounces with prior-period deltas), daily (per-day series), campaigns (the per-campaign table — sortable with sort_by/sort_dir, searchable with search over subject and campaign name, paged with limit/offset), subject_lines (subject leaderboard plus open/click rates broken out by subject feature, length bucket, weekday, hour and split test; min_sends gates who reaches the leaderboard), or filter_options (all-time campaign types, lists, sources and the available date range — call this first when you need a valid filter value). Filters: campaign_type (exact), list_name (substring), source (exact). Open rates are inflated by privacy proxies on some clients — treat click-through and CTOR as the reliable engagement signals, and never present open rate as a deliverability measure. Omit both dates for the default window: the last 30 complete days ending yesterday.

Email marketing › Request Body

mode
​string · enum · required

Which email cut to return — see the tool description for each.

Enum values:
summary
daily
campaigns
subject_lines
filter_options
start_date
​string · pattern: ^\d{4}-\d{2}-\d{2}$

Window start, YYYY-MM-DD (inclusive). Omit both dates for the default window: the last 30 complete days ending yesterday.

end_date
​string · pattern: ^\d{4}-\d{2}-\d{2}$

Window end, YYYY-MM-DD (inclusive).

campaign_type
​string · minLength: 1 · maxLength: 200 · pattern: ^[^'\\]+$

Filter to one campaign type (exact match; get the available values from mode=filter_options).

list_name
​string · minLength: 1 · maxLength: 200 · pattern: ^[^'\\]+$

Filter to campaigns sent to a list whose name CONTAINS this text (substring match).

source
​string · minLength: 1 · maxLength: 200 · pattern: ^[^'\\]+$

Filter to one email source/connector (exact match).

sort_by
​string · minLength: 1 · maxLength: 64

campaigns mode: sort column — sent_at | sends | delivered | unique_opens | unique_clicks | open_rate | click_rate | ctor | unsub_rate | bounce_rate | campaign_name | subject (default sent_at). An invalid value returns the allowed list.

sort_dir
​string · enum

Sort direction for the table mode (default desc).

Enum values:
asc
desc
limit
​integer · min: 1 · max: 500

Table mode: rows to return, 1-500 (default 25).

offset
​integer · min: 0 · max: 100000

Table mode: rows to skip, for paging (default 0).

search
​string · minLength: 1 · maxLength: 200

campaigns mode: case-insensitive match on the subject or campaign name.

min_sends
​integer · min: 0 · max: 100000

subject_lines mode: minimum total sends before a subject enters the leaderboard (default 100; 0 removes the gate). Lower it for a low-volume sender.

Email marketing › Responses

The tool ran

ok
​boolean · const · required
Const value:
tool
​string · required
data
​required

The tool's payload — byte-identical to what the same tool returns over MCP.