List metric definitions
GET
/v1/metric-alerts/definitions
const url = 'https://shareout.site/v1/metric-alerts/definitions?artifact_id=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://shareout.site/v1/metric-alerts/definitions?artifact_id=example' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ” artifact_id
required
string
Responses
Section titled “ Responses ”Metric definitions
Media type application/json
object
metrics
Array<object>
object
artifact_id
required
string
metric_id
required
Stable key referenced by rules. Letters, digits, _, -.
string
label
required
string
format
Display hint: currency:USD, number, percent.
string
source
required
Where a metric value is read from.
object
type
required
string
key
Json_path: the sdk.json key to read.
string
path
Json_path: e.g. $.revenue, $.totals.mrr.
string
table
string
field
string
fn
string
where
Filter using the same operators as sdk.table().query().
object
Example
{ "metrics": [ { "source": { "type": "json_path", "fn": "sum" } } ]}