Aerovy Platform logo

Create a metric definition

POSThttps://spectra.api.aerovy.com/v2/definitions/metrics

Creates a new metric definition. Requires an API key with the write action.

Loading code example
Loading code example

Authorizations

apiKeystringheaderrequired

API key passed in the header.

Body

The metric to create.

namestringrequired

Programmatic name of the metric (unique within the org).

Length: >= 1, <= 100
dataTypestringrequired

The metric's data type (see GET /v2/definitions/metrics/schema for valid values).

defaultAggregationstringrequired

Default aggregation; must be valid for the chosen data type (see /schema).

displayNamestring

Human-readable name for the metric.

Length: >= 0, <= 200
descriptionstring

Description of what the metric measures.

Length: >= 0, <= 500
unitLabelstring

Unit label for the metric's values.

Length: >= 0, <= 50
tagsarray<string>

Free-form tags for the metric.

enumValuesnull | array

Optional enum value set. Only valid when `DataType == "Int"`; when provided, the aggregation must be First/Last/Count.

Response

application/json

Created; the Location header points to the new metric.

metricIdstring

Stable identifier for the metric.

namestring

Programmatic name of the metric.

displayNamestring

Human-readable name of the metric.

descriptionstring

Description of what the metric measures.

unitLabelstring

Unit label for the metric's values.

dataTypestring

The metric's data type.

defaultAggregationstring

Default aggregation used when binning this metric.

tagsarray<string>

Free-form tags applied to the metric.

enumValuesnull | array

Allowed enumerated values, when the metric is enum-typed.

isDeletedboolean

Whether 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.

createdBystring

Identifier of the actor that created the metric.

updatedBynull | string

Identifier of the actor that last updated the metric.