Perspectives
Turn a successful query into a reusable, governed data asset.
A perspective turns a successful query into a named, reusable data asset. It stores the query context, exposes the latest result through a human-readable slug, and adds ownership, visibility, allow-listing, and refresh behavior.
Use a perspective for a shared reporting slice or recurring result. Do not use it as a substitute for a governed metric: a metric standardizes a business calculation; a perspective standardizes access to a saved query result.
Create a perspective
First submit a REST, Semantic SQL, Metric, or Source SQL query and wait for statement status SUCCESS. Then save that statement:
curl --request POST "$BASE_URL/perspectives" \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{
"name": "Monthly revenue by store region",
"slug": "monthly-revenue-by-store-region",
"description": "Governed monthly revenue split by store region.",
"statement_id": "stmt_abc123",
"auto_refresh": true,
"is_public": false
}'name and statement_id are required. If slug is omitted, the API derives it from the name. The source statement must exist, be successful, and have a result. A duplicate slug returns 409 with suggested alternatives.
Fetch a result
Supported formats are json, yaml, csv, and parquet. Parquet is the default and returns a 307 redirect to a presigned URL. Text formats support limit, offset, and comma-separated columns.
Understand refresh behavior
With auto_refresh: true, reading a stale perspective triggers a refresh in the background while the API returns the current cached result.
Is-Stale: truemeans the returned result may not contain the latest expected data.X-Refresh-Statement-Ididentifies the background refresh statement.
Force a refresh even when automatic refresh is disabled:
Track the ID from X-Refresh-Statement-Id through the statement endpoints. See Query lifecycle.
Manage perspectives
Check a slug
HEAD /api/v1/perspectives/{slug}
Returns 200 when an accessible perspective exists; otherwise 404.
List accessible
GET /api/v1/perspectives?is_public=true&limit=50&offset=0
Includes public perspectives and private perspectives you own or can access. Maximum page size is 100.
Inspect
GET /api/v1/perspectives/{slug}
Returns metadata, saved query context, access controls, and links.
Update
PUT /api/v1/perspectives/{slug}
Owner only. Partial update; a new statement_id must be successful.
Delete
DELETE /api/v1/perspectives/{slug}
Owner only; returns 204.
The list response stores records in items and paging state in pagination.
Next steps
Follow the Query lifecycle to monitor perspective refresh statements.
Use Metrics when consumers need a standardized KPI rather than a saved query result.
Last updated
Was this helpful?