Skip to main content
POST
Call analytics.query_metrics

Authorizations

Authorization
string
header
required

An API key minted at Settings › API & MCP. Send it as Authorization: Bearer <key>. A key carries its holder's own permissions, resolved on every call — revoking a membership closes the key's reach immediately. Keep it in an environment variable (GOOSY_API_KEY), never in a committed file.

Headers

x-request-id
string

Your own id for this request, echoed back and recorded on the audit trail. 1–128 characters from A–Z a–z 0–9 . _ : -, starting with a letter or digit; anything else is replaced by a generated id.

Maximum string length: 128

Body

application/json
metric_keys
enum<string>[]
required

Dictionary metric keys to read. Use analytics.list_available_metrics to discover them.

Required array length: 1 - 12 elements
Available options:
rev_leads,
rev_booked_calls,
rev_calls_showed,
rev_show_rate,
rev_sales_won,
rev_revenue_won,
rev_revenue_by_source,
rev_open_pipeline_value,
email_sent,
email_delivered,
email_delivery_rate,
email_opened,
email_open_rate,
email_clicked,
email_click_rate,
email_replied,
email_complaint_rate,
email_bounce_rate,
list_size,
list_new_subscribers,
list_unsubscribe_rate,
ads_spend,
ads_impressions,
ads_clicks,
ads_ctr,
ads_cpc,
ads_cpm,
ads_reach,
ads_frequency,
ads_conversions,
ads_cost_per_lead,
ads_cost_per_booked_call,
ads_attributed_revenue,
vid_views,
vid_watch_time_minutes,
vid_avg_view_duration,
vid_impressions,
vid_impressions_ctr,
vid_subscribers_gained,
vid_net_subscribers,
vid_breakout_score,
soc_posts_published,
soc_impressions,
soc_engagements,
soc_engagement_rate,
soc_meta_impressions,
soc_meta_engagements,
soc_meta_engagement_rate,
soc_fb_impressions,
soc_fb_engagements,
soc_fb_engagement_rate,
soc_ig_impressions,
soc_ig_reach,
soc_ig_engagements,
soc_ig_engagement_rate,
soc_ig_profile_visits,
soc_ig_new_follows,
sys_produced,
hyros_attributed_revenue,
hyros_attributed_leads,
web_sessions,
web_active_users,
web_conversions,
web_revenue,
web_search_impressions,
web_search_clicks,
web_search_ctr,
web_search_position,
site_views,
site_visitors,
site_sessions,
site_conversions,
site_conversion_rate,
site_scroll_50,
site_cta_clicks,
site_form_starts,
site_video_plays,
site_video_completion,
site_consent_shown,
site_consent_accept_rate,
sales_open_pipeline,
sales_open_deals,
sales_weighted_forecast,
sales_won_value,
sales_won_deals,
sales_win_rate,
sales_days_to_close,
sales_journey_funnel
period
string

The window ending at the start of today (today is excluded), as the span the member names, counted in whole days: 14d for two weeks, 30d for 30 days, 3d for the last three days. Three ids are the analytics page's own presets and read whole COMPLETE periods: 7d = the last 7 complete days, 28d = the last 4 complete weeks, 90d = the last 3 complete calendar months (92 days on a May-Aug read, not 90); use one of them only when the member's span is that one. Any other count, 1d to 366d, reads that many complete days. Omit when supplying from/to, which is for named calendar dates ('in March').

Pattern: ^[1-9][0-9]{0,2}d$
from
string

Window start, ISO-8601 date or timestamp. Inclusive. Requires to.

to
string

Window end, ISO-8601 date or timestamp. EXCLUSIVE.

grain
enum<string>

Granularity the stored rows are read at. LEAVE THIS UNSET unless you have a specific reason: day is where the analytics store is written, and asking for a coarser grain reads a different set of rows that is usually empty. A window is summed from day rows regardless of how long it is, so a month-long window does NOT need grain=month.

Available options:
hour,
day,
week,
month,
quarter,
year,
lifetime
compare
boolean

Also read the immediately preceding window of the same number of COMPLETE periods, for a like-for-like comparison. On a preset that is a calendar step, so the preceding window holds the same number of weeks or months — not necessarily the same number of days.

by
enum<string>

Leave it out unless the member asks for ad numbers by platform. Splits each ad sum (ads_spend, ads_impressions, ads_clicks, ads_conversions) by ad platform — Meta, Google, LinkedIn, TikTok, Snapchat — each with its state: measured (a figure), quiet (connected, nothing ran), unread (we do not read that platform's spend yet) or not_connected. A platform with no figure is never a zero. Other keys come back unsplit. The split is read on a signed-in member's session only: a call made with an API key answers the unsplit figures and a split_note saying so.

Available options:
platform
site
string

Leave it out unless the member names one of the brand's sites: a read without site is the whole brand's, and no value of it means every site. Narrows site_* metrics to that site, by its name as the member says it, like Riverside Bakery, or by its id. The name is looked up in this workspace, so no page.list call is needed first. Add page_path for one page of it; a path (it starts with /) is always page_path, never site. Only with site_* keys.

Required string length: 1 - 200
site_id
string<uuid>

Leave it out unless a read gave you a site's id: the same narrowing as site, by that id alone. Only with site_* keys.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
page_path
string<starts_with>

Leave it out unless the member names one page: narrows site_* metrics to that page by its path, like /pricing, and / is the home page alone, never every page. That path on every site unless site is also given. Only with site_* keys.

Required string length: 1 - 1024
Pattern: ^\/.*
workspace
string

Which workspace to run in — its slug. Omit to use your default. With more than one reachable workspace and no default, the call is refused and the choices are listed.

Minimum string length: 1

Response

The call was admitted and dispatched. ok says whether the tool succeeded — a refusal the tool itself produced is still a 200, exactly as it is a successful JSON-RPC result over MCP.

The tool ran and answered.

ok
boolean
required
window
object
required
previous_window
object | null
required
grain
string
required
definition_version
integer
required
min_delta_periods
integer
required
metrics
object[]
required
all_empty
boolean
required
answer_note
string
required
split_note
string | null
required
site_filter
object | null
required
workspace
string
required

The slug of the workspace this call ran in.

working_in
object
required

Which workspace this call ran in, and how that was decided. Present on every workspace-scoped result.