Create a metric definition
Creates a new metric definition. Requires an API key with the write action.
Authorizations
API key passed in the header.
Body
The metric to create.
namestringrequiredProgrammatic name of the metric (unique within the org).
>= 1, <= 100dataTypestringrequiredThe metric's data type (see GET /v2/definitions/metrics/schema for valid values).
defaultAggregationstringrequiredDefault aggregation; must be valid for the chosen data type (see /schema).
displayNamestringHuman-readable name for the metric.
>= 0, <= 200descriptionstringDescription of what the metric measures.
>= 0, <= 500unitLabelstringUnit label for the metric's values.
>= 0, <= 50tagsarray<string>Free-form tags for the metric.
enumValuesnull | arrayOptional enum value set. Only valid when `DataType == "Int"`; when provided, the aggregation must be First/Last/Count.
Response
Created; the Location header points to the new metric.
metricIdstringStable identifier for the metric.
namestringProgrammatic name of the metric.
displayNamestringHuman-readable name of the metric.
descriptionstringDescription of what the metric measures.
unitLabelstringUnit label for the metric's values.
dataTypestringThe metric's data type.
defaultAggregationstringDefault aggregation used when binning this metric.
tagsarray<string>Free-form tags applied to the metric.
enumValuesnull | arrayAllowed enumerated values, when the metric is enum-typed.
isDeletedbooleanWhether the metric has been soft-deleted.
createdAtstring<date-time>Timestamp (UTC) when the metric was created.
updatedAtnull | string<date-time>Timestamp (UTC) when the metric was last updated.
createdBystringIdentifier of the actor that created the metric.
updatedBynull | stringIdentifier of the actor that last updated the metric.