Run a catalog metric
POST
/v1/workspaces/{workspaceId}/catalog/metrics/{metricId}/query
const url = 'https://shareout.site/v1/workspaces/example/catalog/metrics/example/query';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"grain":"day","by":["example"],"from":"2026-04-15","to":"2026-04-15","where":{"additionalProperty":["example"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
Workspace ID or slug.
metricId
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
grain
string
by
Array<string>
from
string format: date
to
string format: date
where
object
key
additional properties
Array
Responses
Section titled “Responses”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
