Skip to content

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.

SignalBraid-Client
string
<= 64 characters /^looker-studio/(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(; sample)?$/

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.

One of:
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"
}
}

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
requestId
required

The gateway-generated id of this request, the same value as the X-Request-Id response header.

string
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
profile
required

The profile id the request named.

string
columns
required

The columns of every row, in order, the requested dimensions then the requested metrics.

Array<object>
>= 1 items
object
id
required

The dimension or metric id; the key of each row’s value.

string
role
required
string
Allowed values: dimension metric
alias
required

The column’s name in the stored result. Not meaningful to a caller.

string
type
required
string
Allowed values: date string integer decimal
rows
required

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.

Array<object>
<= 10000 items
object
windowComplete

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.

boolean
key
additional properties
string | number | null
page
required
object
limit
required
integer
>= 1 <= 10000
truncated
required

Always false in a 200. A cut page is 413 result_too_large.

boolean
provenance
required
One of:
dataState
required

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).

string
Allowed values: observed zero no_reported_data
sourceAttribution

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
source
required
string
Allowed value: youtube
label
required
string
Allowed value: YouTube
notice
required
string
Allowed value: Data from YouTube. Values exactly as the YouTube Analytics API returned them.
channelId
required

The channel the values were read from (the request’s account).

string
/^UC[A-Za-z0-9_-]{22}$/
channelUrl
required

The channel’s public YouTube page.

string format: uri
/^https://www\.youtube\.com/channel/UC[A-Za-z0-9_-]{22}$/
analyticsUrl
required

The channel’s analytics page in YouTube Studio.

string format: uri
/^https://studio\.youtube\.com/channel/UC[A-Za-z0-9_-]{22}/analytics$/
sourceMode

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.

string
Allowed values: search_analytics_api
freshness

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
label
required
string
Allowed value: Finalized daily data; checked daily
lastCheckedAt
required

When the latest completed check of this site and profile ended.

string format: date-time
newestDate
required

The newest date with a published

string format: date

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
error
required
object
code
required
string
message
required
string
detail

Which rule refused the request. Closed vocabulary; one member.

string
Allowed values: body_not_object unknown_field profile_mismatch invalid_connection_id invalid_accounts invalid_sources invalid_metrics too_many_metrics unknown_metric duplicate_metric invalid_dimensions too_many_dimensions unknown_dimension duplicate_dimension unknown_dimension_set invalid_filters too_many_filters too_many_filter_values unknown_filter_dimension filter_not_allowed duplicate_filter_dimension bad_filter_op invalid_filter_value invalid_order_by unknown_order_field duplicate_order_field invalid_limit invalid_cursor as_of_not_supported unsupported_currency unsupported_timezone date_range_required invalid_date_range invalid_date window_out_of_range distinct_dimension_set snapshot_over_time mixed_attribution cross_source_non_additive identity_join_refused head_ranges_exceeded
suggestedDimensionSets

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.

Array<Array<string>>
>= 1 items <= 8 items unique items
error
object
code
Allowed values: invalid_json invalid_query non_additive_metric window_too_large cursor_invalid

unauthorized — missing, unknown, expired or revoked key.

object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed value: unauthorized
WWW-Authenticate
required
string
Allowed value: Bearer

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.

One of:
object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed values: forbidden serving_disabled

connection_unavailable — no active connection matches this workspace, connection and account, or it was disconnected mid-read.

object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed value: connection_unavailable

method_not_allowed — Allow names the method this route accepts.

object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed value: method_not_allowed
Allow
required
string
Allowed value: POST

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.

One of:

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
error
required
object
code
required
string
Allowed values: data_not_ready data_incomplete
message
required
string
missingDates
required

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.

Array<string>
>= 1 items <= 31 items unique items
missingDatesTruncated

Present, and true, only when more than 31 dates are missing and missingDates lists the earliest 31.

boolean
Examples
{
"error": {
"code": "data_incomplete",
"message": "Complete data is not available for every requested day.",
"missingDates": [
"2026-09-03",
"2026-09-04"
]
}
}

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.

One of:
object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed value: request_too_large

unsupported_media_type unless the body is application/json, or unsupported_encoding for any Content-Encoding other than identity.

object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed values: unsupported_media_type unsupported_encoding

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
error
required
object
code
required
string
message
required
string
error
object
code
Allowed value: rate_limited
Retry-After
required
string
/^[1-9][0-9]*$/
RateLimit-Limit
required
string
/^[1-9][0-9]*$/

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.

object
error
required
object
code
required
string
message
required
string
error
object
code
Allowed values: query_unavailable auth_unavailable