Skip to content

Run a catalog metric

POST
/v1/workspaces/{workspaceId}/catalog/metrics/{metricId}/query
curl --request POST \
--url https://shareout.site/v1/workspaces/example/catalog/metrics/example/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "grain": "day", "by": [ "example" ], "from": "2026-04-15", "to": "2026-04-15", "where": { "additionalProperty": [ "example" ] } }'

Compiles the metric spec to one read-only SELECT for its source (BigQuery, Snowflake, Postgres family, or a workspace shared table) and runs it: at most 1,000 rows, 30 seconds, counted against the workspace data-query limit. Internal members run certified metrics; drafts run for owners/admins and the author, or for anyone when the data is already open to members. Every answer carries status, certified_by, certified_at, spec_hash, source, freshness and computed_at; owners and admins also get the compiled sql.

workspaceId
required
string

Workspace ID or slug.

metricId
required
string
Media typeapplication/json
object
grain
string
Allowed values: day week month quarter year
by
Array<string>
from
string format: date
to
string format: date
where
object
key
additional properties
Array

Rows with provenance

The query names something the spec does not

METRIC_NOT_CERTIFIED or SCOPE_REQUIRED

METRIC_UNAVAILABLE or METRIC_INVALID (see problem)

RATE_LIMITED

METRIC_QUERY_FAILED

METRIC_TIMEOUT