Aerovy Platform logo

Create a thing-type version

POSThttps://spectra.api.aerovy.com/v2/definitions/thing-types/{thingTypeId}/versions

Creates a new version of an existing thing-type definition. Requires an API key with the write action.

Loading code example
Loading code example

Authorizations

apiKeystringheaderrequired

API key passed in the header.

Path Parameters

thingTypeIdstringrequired

The thing-type index id to add a version to.

Body

The new version's metrics, metadata, and property definitions.

metricIdsarray<string>required

The metric ids that make up the new version.

displayNamenull | string

Optional new display name for the new version.

Length: >= 1, <= 100
descriptionnull | string

Optional new description for the new version.

Length: >= 0, <= 500
tagsnull | array

Optional free-form tags for the new version.

modelMetadataany
propertyDefinitionsnull | array

Property definitions for the new version. Omit (or null) to inherit the latest version's property definitions; provide a list to fully replace them (an empty list starts the new version with no property definitions).

Response

application/json

Created; the Location header points to the versions collection.

thingTypeDefIdstring

Identifier of this definition version.

thingTypeIdstring

Identifier of the owning thing type (index id).

versioninteger | string<int32>

The version number of this definition.

Pattern: ^-?(?:0|[1-9]\d*)$
displayNamestring

Human-readable name for the thing type.

descriptionstring

Description of this definition version.

tagsarray<string>

Free-form tags applied to this definition.

metricIdsarray<string>

The metric ids included in this definition version.

deletedMetricIdsarray<string>

Metric ids that were present in earlier versions but removed in this one.

allowedSubDefinitionsarray<string>

Sub-definition ids allowed under this thing type, if any.

propertyDefinitionsarray<object>

The property schema (typed, predefined keys) for devices of this type.

propertyDefinitions.namestringrequired
propertyDefinitions.descriptionstring
propertyDefinitions.unitstring
propertyDefinitions.valueTypestringrequired
propertyDefinitions.constraintsarray<object>
modelMetadataany
metricDefinitionsnull | array

The resolved metric definitions for this version. Populated only when the request asks for them (e.g. `?includeMetricDefinitions=true`); otherwise omitted.

createdAtstring<date-time>

Timestamp (UTC) when this version was created.

updatedAtnull | string<date-time>

Timestamp (UTC) when this version was last updated.

createdBystring

Identifier of the actor that created this version.

updatedBynull | string

Identifier of the actor that last updated this version.