Skip to navigation

Query Semantic Model

Beta
Execute a metric query against a semantic model. Specify measures, optional dimensions, filters, and time dimensions. Returns structured data rows.

Authentication

X-API-KEYstring
API Key authentication via header

Path parameters

asset_idstringRequired

Headers

X-Athena-Session-CredentialstringOptional

Request

This endpoint expects an object.
measureslist of stringsRequired

List of measure identifiers, e.g. [“orders.total_revenue”]

dimensionslist of strings or nullOptional
Optional dimension identifiers for grouping
filterslist of maps from strings to any or nullOptional
Optional filters
limitintegerOptional1-5000Defaults to 100

Maximum rows to return (default 100). When the result was cut at this limit the response sets “truncated”: true.

orderlist of lists of strings or objects or nullOptional

Optional ordering as [member, direction] pairs applied before “limit”, e.g. [[“orders.count”, “desc”]] for a server-side top-N. Direction must be “asc” or “desc”. Entries may also be given as {“member”: “orders.count”, “direction”: “desc”} objects.

time_dimensionslist of maps from strings to any or nullOptional

Optional Cube time dimension configs, e.g. [{“dimension”: “orders.created_at”, “granularity”: “month”, “dateRange”: [“2026-01-01”, “2026-06-30”]}]. The camelCase spelling “timeDimensions” (Cube’s own, and the one the rest of Athena uses) is accepted as well.

Response

Successful Response
datalist of maps from strings to any
Query result rows
row_countinteger
Number of rows returned
as_of_kindstring or nullOptional

‘snapshot’ when ‘data_as_of’ comes from the source tables’ Iceberg snapshots (lakehouse-backed models); ‘query_time’ when the data is as current as the moment the warehouse answered (‘queried_at’).

data_as_ofstring or nullOptional

ISO-8601 UTC time the data is current as of. For a lakehouse-backed model: the oldest last-commit time across the model’s source tables. Null for models over other engines (Snowflake, Databricks, BigQuery, Postgres), which expose no snapshot, and for rows the engine served from a cache computed before a source table’s latest commit — use ‘queried_at’ instead.

elapsed_msintegerOptionalDefaults to 0

Server-side execution time in milliseconds (semantic layer + engine, excluding network) — surface it to show how fast the engine answered

queried_atstring or nullOptional

ISO-8601 UTC time the engine computed the result (an earlier time when it was served from the engine’s cache).

schema_hashstring or nullOptional

Hash of the deployed semantic model definition that computed the rows (the same value the model’s citations record); null for a model that was never deployed.

schema_versioninteger or nullOptional

Deployment number of the semantic model definition that computed the rows; null for a model that was never deployed.

source_snapshotslist of objects or nullOptional

For a lakehouse-backed model, the Iceberg snapshot of each source table the returned rows reflect; empty for models over other engines and when the rows were computed before a source table’s latest commit.

truncatedbooleanOptionalDefaults to false

True when the query produced more rows than ‘limit’ and the result was cut; raise ‘limit’ or add filters to see the rest

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
502
Bad Gateway Error