API reference
Read published data
POST /v1/query
One route, one request body: the query IR (QueryRequest), answered with the result
envelope (QueryResult). The legacy GA4 body (workspaceId, propertyId, startDate,
endDate, metric, dimensions) was removed on 11 October
2026: a body in that shape has no profile and is refused as any invalid query is, with
400 invalid_query and nothing read. The route stays on /v1 with no version header: there
are no external users, so the removal is an accepted breaking change.
Names a profile (the profiles, with their metrics, dimensions and dimension
sets, are not listed by any HTTP route yet), one connection, one account, a
window, the metrics, and the dimensions to group by. The workspace is never in the
body: it is the key’s own, and a workspaceId field is refused as invalid_query.
limit is at most 10,000 rows (default 1,000). The answer carries no totals and no
row count. A result is whole or it is refused: if the page is cut, whether by the
10,000-row or 5 MB cap or by a limit smaller than the full result, the answer is
413 result_too_large, never a truncated 200. Narrow the window or the filters,
or raise limit (or, when the 5 MB cap was the one hit, ask for fewer metrics or
dimensions). Where the deployment serves the export routes, the message also points to
POST /v1/query/export for a result this large as a CSV file, for a request with up to
10 sources too (the export’s own cap; a request with more keeps the scheduled-exports
text below); an export has its own size limits, so that is not a promise to deliver the
refused result. Elsewhere it points to scheduled exports (today, a Google Sheets destination, with
its own row limits) as the way to receive data regularly in bulk. Cursors do not exist yet; any
cursor is 400 cursor_invalid. A query that exceeds the 20-second execution budget
is 503 query_unavailable.
YouTube (youtube.channel_daily) is switched off on this route in production. YouTube serving on REST and MCP is off by default (restServing and mcpServing in
@sb/schema) and is on in the staging deployment only (the deployment’s own rollout row); the app, Sheets and CSV are not affected. Where the switch is off, a
query naming a YouTube profile is answered 403 serving_disabled before the body is
validated, a connection is looked up or anything is read from ClickHouse, whatever
the body says. Where it is on: YouTube data is daily data, two to three days behind YouTube; the only dimension set is [date]
(the native grain, one Pacific Time day per row, nothing added across days, no
derived metric and no value combined with another source), the window is at most 90
days and may not start before 36 calendar months back (400 invalid_query), a day
YouTube did not report has no row and a window with such a day is 409 data_incomplete
or data_not_ready (never a zero), provenance.accounts[0].finality lists
preliminary when a day in the window can still change, settled when every day is
final, and both (preliminary and settled) for a window that mixes them,
dataThrough is the window’s last day, provenance.flags carries the profile’s
limitations, and sourceAttribution names YouTube as the source (the label, a notice
sentence and the channel’s YouTube and YouTube Studio links). A channel that was disconnected or is being erased is
404 connection_unavailable. The ClickHouse view the profile reads and its tenant row
policy are provisioned in the staging deployment only.
Klaviyo (klaviyo.campaign_daily, klaviyo.flow_daily) is switched off on this route
too (KLAVIYO_SERVING, the same shape): 403 serving_disabled before the body is
validated or anything is read. Their ClickHouse views are defined and not provisioned, and
no loader is scheduled, so even with the switch on a query would end in 503 query_unavailable. When served, a result for a money metric (attributed_revenue) states the
account’s currency in provenance.accounts[0].currency and is 503 query_unavailable
when the pinned days name none or two; every Klaviyo result states
provenance.accounts[0].attribution.fingerprint (unknown when none is recorded).
Google Ads (google-ads.campaign_daily) is served on this route, and by the MCP tool query_metrics with the same result, one connection
and one Google Ads customer id per request, from the campaign-day view the published report heads pin.
spend is the stored cost_micros divided by 1,000,000 in the account’s currency, exact to six places
while the value stays below 2^33 currency units (about 8.59e9; a double cannot hold every six-place value from there) per row and day; above that it is the
nearest double, and POST /v1/query/ads returns exact spend_micros strings); the conversion values are in that currency too, and provenance.accounts[0].currency states it
whenever a money metric is asked for (503 query_unavailable when the pinned days name none or two).
currency_code is a dimension, so a request that does not group by it can still not mix two
currencies. Finality is stated for the whole result: provenance.accounts[0].finality lists the states of
the pinned days (preliminary, restating, settled) and restatingFrom is the first pinned day not
yet settled, or null; restatingUntil is present only while a pinned day is not yet settled and the
store records when it will be, and is the earliest such date; per-day finality stays on POST /v1/query/ads. Conversions are Google’s own
attribution, never added to GA4 key events, Klaviyo conversions or each other; cpa, conversion_rate
and roas are not metrics of this profile (use POST /v1/query/ads). A day with no published head makes
the query 409 data_incomplete (or data_not_ready when none is published), with the dates. This route
is not the multi-account route: POST /v1/query/ads is unchanged.
The CRM pipeline snapshot (hubspot.pipeline_snapshot_daily,
salesforce.pipeline_snapshot_daily) is switched off on this route too (CRM_SERVING, the
same shape): 403 serving_disabled before the body is validated or anything is read. Its
ClickHouse view is defined and not provisioned, so even with the switch on a query would end in
503 query_unavailable. When served, a row is one pipeline and stage on the UTC day a
generation of the account’s deals was published, currency_code is always a dimension of the
request, an amount is in each deal’s own currency and is never summed across currencies or
converted, and the result states that in provenance.accounts[0].conversionRule
(per_currency). A window with a day that has no published snapshot is 409 data_incomplete
or data_not_ready, never a zero.
Shopify commerce (shopify.sales_daily, shopify.product_sales_daily) is switched off
on this route too (SHOPIFY_COMMERCE_SERVING, the same shape): 403 serving_disabled
before the body is validated or anything is read. Their ClickHouse views are defined and
not yet applied on staging, so nothing answers them. The account is the shop GID. When a
reviewed change turns them on: a result is pinned to the shop’s newest published generation of
orders, and a partial one is answered with provenance.completeness: partial, its history
limitations in flags and the days it covers in provenance.accounts[0].coverageWindow, never
as complete; provenance.generations[0].identity.safePoint is the instant after which a change
is not in the result; provenance.accounts[0] names the shop’s currency and its permanent
shopDomain (null until the shop’s settings are next read) beside the GID; money is in the shop’s currency and
currency is in every dimension set, so two currencies never share a row and nothing is
converted; a day is the shop’s local day, and each metric’s definition says which day its
amounts land on; net_sales and total_sales are sums, computed in the same row as their
parts; aov, units_per_order and refund_rate are ratios of sums, null (never 0) when
the denominator is zero; the profile declares every day restating, never final (the result’s
finality is null: a generation records none per day); the window is at most 90
shop-local days (400 invalid_query beyond). provenance.flags carries the profile’s
limitations: orders_restate_on_edit, children_may_change_without_updated_at,
order_window_60d_without_read_all_orders, customer_metrics_unavailable,
not_independently_reconciled and tax_inclusive_gross_unmeasured, and on the product
profile also product_rows_do_not_sum_to_shop_totals.
The organic-social profiles (<platform>.account_daily, <platform>.post_snapshot) are switched off on this
route too, platform by platform (SOCIAL_SERVING): 403 serving_disabled before the body is validated or anything
is read. Their ClickHouse views are defined and not provisioned and no social connection exists, so even with a switch on
a query would end in 404 connection_unavailable or 409 data_not_ready, not in data. When served, a post counter is a
lifetime counter the platform restates, summed across posts at one snapshot date and never across dates; reach counts
distinct people, is never summed across posts, and is readable per post only (dimensions snapshot_date and post_id,
400 invalid_query otherwise); a counter the platform did not return is null and never 0 (a sum over posts of which
some did not return it is the sum of the others), nothing is derived or combined with another source, and a window may
not start before the platform’s history cap (400 invalid_query).
Authorization is checked before the read and again before the response is released, so a key revoked while ClickHouse is in flight yields 401 and no data. Workspace headers are ignored.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Client attribution: looker-studio/<semver>, optionally followed by ; sample, and nothing else. It is untrusted.
It labels one structured gateway log line and, on POST /v1/query, selects the Looker Studio presentation switch. It never
changes authorization, the scope, the workspace or what a result contains.
Request Body required
Section titled “Request Body required ”The query IR v1 body of POST /v1/query, strict: an unknown field is refused. The
workspace is not a field; it is the API key’s own. A profile’s metrics, dimensions, allowed
dimension sets and longest window are not listed by any HTTP route yet; a request outside them is invalid_query. A profile’s metric is
computed from sums (a ratio is never an average of row ratios), and a metric that
cannot be summed over the requested dimensions or window is non_additive_metric.
GA4 coverage beyond sessions (ga4.users_daily, ga4.events_daily) is switched off on
this route in production (GA4_COVERAGE_SERVING and the deployment’s rollout row, the same shape):
403 serving_disabled before the body is validated or anything is read. The staging deployment
serves them since its run was recorded; ga4.sessions_daily is not affected. The account
is the numeric property id. Where they are on: the only dimension set is
[date] on the property’s own calendar; total_users counts distinct users per day and is
never summed across days (a request without date is 400 invalid_query); event_count and
key_events are sums; purchase_revenue is in the property’s currency, which the result
states in provenance.accounts[0].currency, never converted, and is 503 query_unavailable
when the pinned days name none or two. A window GA4 marked as thresholded publishes no new day:
a day no run has published makes the query 409 data_incomplete (or data_not_ready when no
day of the window is published) with the missing dates, and a day an earlier run published keeps
that earlier value. provenance.flags carries the profiles’ limitations:
bounded_to_date, provider_may_revise_recent_data, withheld_when_thresholded and
not_independently_reconciled.
Several accounts in one query (sources, GA4 and Search Console profiles only): name 2
to 25 distinct { connectionId, account } pairs instead of connectionId and accounts.
Every pair must be an active account of this workspace, or the whole request is
404 connection_unavailable; one account named under two connections is
400 invalid_query (detail invalid_sources), as are sources on another profile and a
list beside connectionId or accounts. Each pair is pinned as it would be alone, all or
nothing: a day one pair has not published makes the request 409, naming that date once.
Without the account dimension the accounts are summed (a ratio is recomputed from the
summed parts); a distinct count such as total_users is then 400 non_additive_metric,
accounts in two time zones are 409 timezone_conflict and money of two currencies is
409 currency_conflict, all before any analytics read. With account in dimensions,
each row is one account’s, in its own time zone and currency, and provenance.flags
carries account_local_dates when the zones differ. The same account dimension groups a
one-account request too. The 4 KiB body cap bounds how many long site URLs fit.
asOf and currency are not accepted in this version.
object
The dataset to read. Search Console profiles are accepted, but they have no ClickHouse view
yet, so a Search Console query cannot be answered today: a workspace with no Search Console
connection gets connection_unavailable. youtube.channel_daily is switched off on this
route in production and is answered 403 serving_disabled there (on in staging only); its account is the channel id
(UC and 22 characters). klaviyo.campaign_daily and klaviyo.flow_daily are
switched off on this route (KLAVIYO_SERVING) and are answered 403 serving_disabled; their
account is the Klaviyo account id. They are also profiles of the one MCP tool query_metrics, which lists them only while the Klaviyo MCP switch is on.
google-ads.campaign_daily is served (and is a profile of the MCP tool query_metrics): its account is the Google Ads customer id (ten digits), its money is in
the account’s currency (currency_code is a dimension) and its windows are at most 93 days.
hubspot.pipeline_snapshot_daily and salesforce.pipeline_snapshot_daily are switched off on this route
(CRM_SERVING) and are answered 403 serving_disabled; their account is the CRM account id (the HubSpot
portal id, the Salesforce organization id). They are also profiles of the one MCP tool query_metrics, which lists them only
while the CRM MCP switch is on.
shopify.sales_daily and shopify.product_sales_daily are switched off on this route
(SHOPIFY_COMMERCE_SERVING) and are answered 403 serving_disabled; their account is the
shop GID. Their MCP tool is query_commerce_orders, listed only while the Shopify MCP switch is on;
query_metrics never serves them.
ga4.users_daily and ga4.events_daily are switched off on this route in production
(GA4_COVERAGE_SERVING and the deployment’s rollout row) and are answered 403 serving_disabled
there; the staging deployment serves them. Their account is the numeric property id. The MCP tool
query_metrics lists them only while the deployment’s GA4 coverage MCP switch is on.
The ten organic-social profiles (<platform>.account_daily and <platform>.post_snapshot for facebook-pages, instagram,
linkedin-pages, x and google-business-profile) are switched off on this route for every platform
(SOCIAL_SERVING) and are answered 403 serving_disabled; the switch is read per platform, and their account is the
platform’s own account id. They are the profiles of the MCP tool query_social_performance, which is listed only while
some platform’s MCP switch is on, and whose profile enum (like explain_metric’s) lists only the profiles of the platforms
whose MCP switch is on.
stripe.balance_transactions_daily, stripe.refunds_daily, stripe.payouts_daily and stripe.invoices_daily are
switched off on this route (STRIPE_QUERY_SERVING) and are answered 403 serving_disabled; no MCP tool lists them and
GET /v1/connectors/stripe/schema carries no query catalogue for them. Their definitions follow a draft that is not signed
and nothing in them is reconciled with Stripe.
Exactly one account (for GA4 the numeric property id; for Search Console the site). Several accounts are sources.
Several accounts of the profile’s connector, instead of connectionId and accounts
(GA4 and Search Console profiles only). Each pair names a connection and one account
of it; an account appears once, whatever the connection.
object
Metric ids of the profile, each once. Result columns follow this order, after the dimensions.
The dimensions to group by; exactly one of the profile’s dimension sets, in any order.
On a GA4 or Search Console profile each set may also take account (one row group per
account), within the three dimensions.
The closed window, in the account’s reporting calendar. At most the profile’s longest window (GA4 31 days, Search Console 28).
object
At most five, each on a different filterable dimension, at most 100 values in all.
object
One value for eq, one to 100 for in.
Only requested columns. The default is the requested dimensions, ascending.
object
The page size, 1 to 10,000 (default 1,000). It is a bound, not a window onto a larger
result: if the full result has more rows than limit, the answer is
413 result_too_large, not the first limit rows.
Reserved. Cursors are not issued yet, so every cursor is refused with
400 cursor_invalid; omit it.
Accepted only when it equals the profile’s own reporting timezone; refused otherwise.
Examples
Query IR body
{ "profile": "ga4.sessions_daily", "connectionId": "your_connection", "accounts": [ "123456789" ], "metrics": [ "sessions" ], "dimensions": [ "date" ], "dateRange": { "start": "2026-08-31", "end": "2026-09-04" }}Two GA4 properties in one query, one row group per property
{ "profile": "ga4.sessions_daily", "sources": [ { "connectionId": "your_connection", "account": "123456789" }, { "connectionId": "your_other_connection", "account": "987654321" } ], "metrics": [ "sessions" ], "dimensions": [ "date", "account" ], "dateRange": { "start": "2026-08-31", "end": "2026-09-04" }}Query IR body for Shopify daily sales (switched off today, answered 403 serving_disabled)
{ "profile": "shopify.sales_daily", "connectionId": "your_connection", "accounts": [ "gid://shopify/Shop/your_shop_id" ], "metrics": [ "net_sales", "orders", "aov" ], "dimensions": [ "shop_date", "currency" ], "dateRange": { "start": "2026-09-01", "end": "2026-09-30" }}Responses
Section titled “ Responses ”Every requested day has a complete published snapshot, and the page is whole
(page.truncated is always false).
The result envelope v1 of the query IR. Every nested object is closed in this version, and
a consumer must ignore a field it does not know (totalRows, totals and nextCursor may
be added without a version change). There are no totals and no row count: the page is the
whole answer, or the answer is 413 result_too_large.
object
The gateway-generated id of this request, the same value as the X-Request-Id response header.
The profile id the request named.
The columns of every row, in order, the requested dimensions then the requested metrics.
object
The dimension or metric id; the key of each row’s value.
The column’s name in the stored result. Not meaningful to a caller.
At most 10,000 rows, in the requested order. A key is a column id. A ratio or weighted
average over a zero denominator is null, never 0. A date is YYYY-MM-DD; an integer
is a JSON number within the safe range. A row of a <platform>.post_snapshot profile also has
windowComplete (below), which is never a column id.
object
Present on the rows of the organic-social <platform>.post_snapshot profiles only. false when
a post the row covers is older than the platform’s metric window, so its counters are not whole
(the view’s window_complete is 0). Such a row is returned and flagged, never dropped; provenance.flags
then carries post_window_incomplete. Do not read an incomplete row’s counters as whole.
object
Always false in a 200. A cut page is 413 result_too_large.
zero when there are rows and every metric is 0 or empty, no_reported_data when there
are no rows, observed otherwise. Never how missing data is represented (409) or a
refused read (4xx, 5xx).
Where the values of a YouTube result come from. Present on every 200 result of a YouTube profile
(youtube.channel_daily, always one channel; YouTube is never read over several sources) and absent from every other result and from every error. Show label with the values wherever
they are shown, and link a YouTube logo, if one is shown, to channelUrl or analyticsUrl. It is a
statement of source only: SignalBraid is not affiliated with YouTube. Not the same field as a Klaviyo
account’s attribution, which is a conversion-attribution fingerprint.
object
The channel the values were read from (the request’s account).
The channel’s public YouTube page.
The channel’s analytics page in YouTube Studio.
The source mode: the identity of the data path that served the result,
read from the query profile. Present only on POST /v1/query/search-console, where it
is always present, and on the MCP tool query_metrics for one Search Console site;
the IR route of POST /v1/query and a multi-source result never carry it.
Present only on POST /v1/query/search-console, where it is always present; the IR route
of POST /v1/query never carries it. The footer for finalized daily data.
object
When the latest completed check of this site and profile ended.
The newest date with a published
invalid_json — the body is absent, not valid JSON, or not valid UTF-8.
invalid_query — the body is not a supported query (unknown field, malformed
date, a window outside the profile’s bounds, a metric, dimension or filter the
profile does not offer, a limit outside 1–10,000, a workspaceId, a body with no
profile, which the removed legacy GA4 body is), or the URL carried a query
delimiter, including a bare ?.
non_additive_metric — the metric cannot be combined with the requested
dimensions or window without summing what must not be summed.
window_too_large — the window needs more published snapshots than one query
can pin; narrow it.
cursor_invalid — a cursor was sent. No cursor is issued yet.
A refusal the query validator raised (invalid_query, non_additive_metric,
window_too_large, cursor_invalid) also carries detail: one member of a closed
vocabulary that says which rule refused the request, such as unknown_metric,
unknown_dimension_set, distinct_dimension_set, snapshot_over_time or
mixed_attribution (a ratio or weighted average whose parts the profile attributes
under different rules). A distinct_dimension_set refusal also carries
suggestedDimensionSets: the dimension sets the metric is readable at, as lists of
the profile’s dimension ids. Both are fixed vocabulary from the profile and never
repeat the request; invalid_json and a refusal of another layer carry neither.
object
object
Which rule refused the request. Closed vocabulary; one member.
Only with detail: distinct_dimension_set: the dimension sets the refused metric
is readable at, each a list of the profile’s dimension ids. Never empty.
object
unauthorized — missing, unknown, expired or revoked key.
object
object
object
Headers
Section titled “Headers ”forbidden — the key lacks query:read.
serving_disabled — the profile’s connector is not served on this output: a
YouTube profile where its REST switch is off (production), or a Klaviyo or Shopify
commerce profile while its switch is off. Nothing was read. It is
not forbidden (the key’s scope), not connection_unavailable and not
invalid_query.
history_not_entitled — dateRange.start is before the first day of the oldest
month the workspace’s plan includes. Nothing was read, and the check comes before
the connection is looked up. earliestDate is that first day (YYYY-MM-01); it
is absent for a custom allowance, which is set per workspace. Narrow the window to
start on or after it, or change plan.
object
object
object
The 403 for a window that starts before the workspace plan’s history. A separate closed object because
composing Error with allOf would reject earliestDate under Error.properties.error.additionalProperties.
object
object
The first day of the oldest month the plan includes. Absent when the allowance is custom and set per workspace.
connection_unavailable — no active connection matches this workspace,
connection and account, or it was disconnected mid-read.
object
object
object
method_not_allowed — Allow names the method this route accepts.
object
object
object
Headers
Section titled “Headers ”data_not_ready when nothing in the window is published, data_incomplete when
some days are; both name the missing dates, in ascending order, so a caller can
narrow the window or wait. At most 31 dates are listed: if more are missing, the
list is the earliest 31 and missingDatesTruncated is true. A list the gateway
cannot vouch for is never released without its dates: the answer is a 503 with
code query_unavailable instead. timezone_conflict means published dates use
different property timezones: re-sync every requested date using the property’s
current timezone. Over several sources summed by date (no account dimension),
it means the accounts are in different time zones, where a date is not the same
day in both: group by account, where each row’s date is its account’s own. Its
message then says so (“The summed accounts publish in different time zones. Group by
account.”). No analytics read occurs for that conflict, and it does not
include missingDates. currency_conflict (query IR only) means a money metric
spans more than one currency: group by the currency dimension. Over several
sources summed, a money metric in each account’s own currency over accounts of
two currencies is refused the same way, before any analytics read: group by
account, and the message says that instead (“The requested money metric spans
accounts in more than one currency. Group by account.”). Otherwise it is raised by
the read itself, and carries no missingDates either. attribution_conflict (query
IR only) means the published data of the window was attributed under more than one
provider setting (the pinned report heads carry two attribution fingerprints), so one
figure would follow two rules: narrow the window to dates published under one
setting. It is raised before any analytics read, names no setting, and carries no
missingDates.
The two missing-publication 409 forms; timezone_conflict, currency_conflict and attribution_conflict have no missingDates. This is a separate closed object because composing Error with allOf would reject missingDates under Error.properties.error.additionalProperties.
object
object
The dates with no published snapshot, in ascending order, so a truncated list is the earliest 31. Never empty: a list the gateway cannot vouch for is a 503.
Present, and true, only when more than 31 dates are missing and missingDates lists the earliest 31.
object
object
object
object
The window’s pinned report heads carry two attribution fingerprints. One figure under two provider settings is refused whole; the message is fixed and names no setting, and there are no missingDates.
object
object
Examples
{ "error": { "code": "data_incomplete", "message": "Complete data is not available for every requested day.", "missingDates": [ "2026-09-03", "2026-09-04" ] }}{ "error": { "code": "timezone_conflict", "message": "Published data uses different property timezones. Re-sync every requested date using the property's current timezone." }}{ "error": { "code": "timezone_conflict", "message": "The summed accounts publish in different time zones. Group by account." }}{ "error": { "code": "currency_conflict", "message": "The requested money metric spans accounts in more than one currency. Group by account." }}request_too_large — REST bodies are capped at 4 KiB.
result_too_large — the result does not fit one response: it has more than 10,000
rows, or the limit is smaller than the full result, or it is over 5 MB. The page
is never cut and returned. The message says which when the service can tell (a
refusal it cannot attribute gets the rows text): for rows it says “The result has
more rows than the limit allows or one response can carry (at most 10,000)”, and to
narrow the window or the filters or raise the limit; for size it says “The result
is too large for one response (about 5 MB)”, and to narrow the window or the
filters or ask for fewer metrics or dimensions. Where the deployment serves the export
routes, both end by pointing to POST /v1/query/export for a result this large as a CSV
file, for a request with up to 10 sources too (an export has its own size limits);
elsewhere, and for a request with more than 10 sources, which an export does not
take, both end by pointing to scheduled exports (today, a Google Sheets
destination, with its own row limits) as the way to receive data regularly in bulk.
Neither is a promise to deliver the refused result. The text is fixed and never
echoes the request.
unsupported_media_type unless the body is application/json, or
unsupported_encoding for any Content-Encoding other than identity.
object
object
object
rate_limited — the key’s or its workspace’s per-plan request allowance for this route’s class is used up.
It is answered after authentication, on every API-key operation in this document and on MCP, and never on /health. A download link is
limited the same way, after its lookup, by the key that issued it and the export’s workspace.
Retry-After is the window in seconds and RateLimit-Limit is the limit of the bucket that refused. No remaining
count is returned. The limits themselves are not published here.
object
object
object
Headers
Section titled “Headers ”query_unavailable — a backend is unreachable or timed out, or a stored row
failed an integrity check. The boundary fails closed rather than returning a
result it cannot vouch for, and never passes a database or provider message
through.
auth_unavailable — the authorization store could not be reached. Pilot
operations report this condition as automation_unavailable.