Skip to main content
POST
Run a scoped analytics query

Authorizations

x-api-key
string
header
required

A server-side Bily API key created under Settings > MCP > Access key fallback. Select the intended store before creating it.

Headers

x-bily-organization-id
string

An organization ID returned by GET /context or GET /organizations. Required for GET /stores and optional for store-scoped paths.

Example:

"org_01J8W7T9G3E6ZQ4M2K5N8P1R0S"

Path Parameters

storeUrl
string
required

The exact store URL returned by GET /context or GET /stores.

Example:

"store.example.com"

Body

application/json
dataset
enum<string>
required
Available options:
ad_metrics,
product_metrics,
country_metrics,
device_metrics,
dimensions,
customer_ltv,
cohorts,
platform_assets,
data_quality,
datasources_report,
touchpoints
sql
string
required

Read-only SQL that starts with SELECT or WITH and reads from the scoped _ alias.

Maximum string length: 5000
Example:

"SELECT channel, sum(spend) AS spend FROM _ GROUP BY channel ORDER BY spend DESC"

maxRows
integer
default:250
Required range: 1 <= x <= 2000
inputLimit
integer
default:1000
Required range: 1 <= x <= 5000
page
integer
default:1
Required range: 1 <= x <= 10000
startDate
string<date>
endDate
string<date>
channel
string
adId
string
productId
country
deviceType
os
browser
dimensionSource
enum<string>
Available options:
conversion,
first_touch
granularity
enum<string>
Available options:
day,
hour
includeOS
boolean
includeBrowser
boolean
bilyId
string

Response

Request completed successfully.

dataset
enum<string>
required
Available options:
ad_metrics,
product_metrics,
country_metrics,
device_metrics,
dimensions,
customer_ltv,
cohorts,
platform_assets,
data_quality,
datasources_report,
touchpoints
storeUrl
string
required
maxRows
integer
required
inputLimit
integer
required
page
integer
required
adAccountScope
integer
required
Required range: x >= 0
meta
object[]
required
data
object[]
required
rows
integer
required
statistics
object | null
required