API ReferenceSemanticssemantics
Query a semantic model
POST /api/workspaces/{workspaceId}/semantic-models/{modelName}/query
Endpoint
POST
/api/workspaces/{workspaceId}/semantic-models/{modelName}/queryCalculate measures over dimensions and a date range. Repeating a query can consume warehouse compute. This is a repeatable read. See semantics_get. Required personal key scopes: workspace:view, ontology:query.
Authorization
Bearer token · workspace:view · ontology:query
Parameters
workspaceIdpath · string · required- Workspace UUID returned by list workspaces.
modelNamepath · string · required- Name of the deployed semantic model.
API-Versionheader · string · optional- Optional platform API major version. Omit to use the current default. Allowed values: 1
Request body
application/json schema
{
"type": "object",
"properties": {
"dimensions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Dimension names by which to group query results."
},
"measures": {
"type": "array",
"items": {
"type": "string"
},
"allOf": [
{
"description": "Measure names used in the aggregation."
}
]
},
"dateRange": {
"description": "Date bounds for the query."
},
"granularity": {
"anyOf": [
{
"type": "string",
"enum": [
"day",
"week",
"month"
]
},
{
"type": "null"
}
],
"description": "Time unit for grouping observations into buckets."
},
"filters": {
"anyOf": [
{
"type": "array"
},
{
"type": "null"
}
],
"description": "Predicates that restrict the rows included in the query."
},
"orderBy": {
"anyOf": [
{
"type": "array"
},
{
"type": "null"
}
],
"description": "Fields and directions used to sort result rows."
},
"limit": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Maximum number of entries to return."
}
},
"required": [
"dimensions",
"measures",
"dateRange"
],
"additionalProperties": false
}Full schema and referenced types ↗Example
{
"dimensions": [
"channel"
],
"measures": [
"orders"
],
"dateRange": {
"from": "2026-01-01",
"to": "2026-01-31"
}
}Responses
200 Success
application/json schema
{
"type": "object",
"properties": {
"deploymentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Identifier of the deployment associated with this operation."
},
"definitionDigest": {
"type": "string",
"description": "Digest identifying the deployed definition used for the query."
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"allOf": [
{
"description": "Name identifying this item within its parent resource."
}
]
},
"label": {
"type": "string",
"description": "Human-readable label for this field or item."
},
"type": {
"type": "string",
"description": "Type of the value or resource described here."
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Unit used to interpret the reported quantity."
},
"format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Format used to encode or display the value."
},
"scope": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "Resource or dimension scope in which this field applies."
},
"implicit": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Whether the field was included implicitly in the query."
}
},
"required": [
"name",
"label",
"type"
],
"additionalProperties": false
},
"description": "Fields available in the definition or result."
},
"rows": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
"description": "Result rows for the selected fields and interval."
},
"truncated": {
"type": "boolean",
"description": "Whether the server omitted results because a limit was reached."
},
"execution": {
"type": "object",
"properties": {
"elapsedMs": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": [
"Infinity",
"-Infinity",
"NaN"
]
}
],
"allOf": [
{
"description": "Elapsed query time in milliseconds."
}
]
},
"bytesProcessed": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Number of bytes scanned by the query."
},
"bytesBilled": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Billable bytes for this query, expressed as a decimal string."
}
},
"required": [
"elapsedMs"
],
"additionalProperties": false,
"description": "Execution statistics or activity for this request."
}
},
"required": [
"deploymentId",
"definitionDigest",
"fields",
"rows",
"truncated",
"execution"
],
"additionalProperties": false
}Full schema and referenced types ↗Example
{
"deploymentId": null,
"definitionDigest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"fields": [],
"rows": [],
"truncated": false,
"execution": {
"elapsedMs": 0
}
}Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
- Deprecation
- Present when the operation is deprecated. RFC 9745 date in seconds since the Unix epoch.
- Sunset
- Present when retirement is scheduled. HTTP date of planned removal, per RFC 8594.
400 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
401 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
403 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
404 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
406 Unsupported platform API version
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
409 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
429 Request limit reached
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- Retry-After
- Seconds to wait before retrying the request.
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
503 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).