Skip to content
SENS Platform Docs

Create or compatibly update one Device Type data field.

PUT
/v1/device-types/{deviceTypeId}/fields/{key}
curl --request PUT \
--url https://api.dev.iot-sens.schlossers.at/v1/device-types/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fields/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "schemaRef": "sens://schemas/number/v1", "unit": "example", "storageTargets": [ "current" ], "measurementType": "gauge" }'
deviceTypeId
required
string format: uuid
key
required
string
/^[a-z][a-z0-9._-]{0,119}$/
If-Match
string
/^(?:W/)?"[1-9][0-9]*"$/

Numeric ETag required when the field already exists.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 200 characters
description
required
string
<= 500 characters
schemaRef
required
string
Allowed values: sens://schemas/number/v1 sens://schemas/string/v1 sens://schemas/boolean/v1 sens://schemas/json/v1
unit
string | null
>= 1 characters <= 40 characters
storageTargets
required
Array<string>
>= 1 items <= 2 items unique items
Allowed values: current timeseries
measurementType
One of:
string
Allowed values: gauge counter status event

Field stored. The returned numeric ETag is its new lock version.

Media typeapplication/json
object
deviceFieldDefinitionId
required
string format: uuid
tenantId
required
string format: uuid
deviceTypeId
required
string format: uuid
key
required
string
/^[a-z][a-z0-9._-]{0,119}$/
name
required
string
>= 1 characters <= 200 characters
description
required
string
<= 500 characters
schemaRef
required
string
Allowed values: sens://schemas/number/v1 sens://schemas/string/v1 sens://schemas/boolean/v1 sens://schemas/json/v1
unit
required
string | null
>= 1 characters <= 40 characters
storageTargets
required
Array<string>
>= 1 items <= 2 items unique items
Allowed values: current timeseries
measurementType
required
One of:
string
Allowed values: gauge counter status event
status
required
string
Allowed values: active deprecated
lockVersion
required
integer
>= 1
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
deprecatedAt
required
One of:
string format: date-time
Example
{
"schemaRef": "sens://schemas/number/v1",
"storageTargets": [
"current"
],
"measurementType": "gauge",
"status": "active"
}
ETag
string

A safe platform error response.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED AUTHENTICATION_FAILED AUTHORIZATION_FAILED RESOURCE_NOT_FOUND CONFLICT DEPENDENCY_FAILURE FLOW_FAILURE RATE_LIMITED INTERNAL_ERROR
category
required
string
Allowed values: validation authentication authorization not_found conflict dependency_failure flow_failure rate_limit internal
message
required

Safe client-facing diagnostic message.

string
correlationId
required

Correlation ID for operational investigation.

string
>= 1 characters
details

Safe bounded diagnostic details.

object
key
additional properties
One of:
string
Example
{
"error": {
"code": "VALIDATION_FAILED",
"category": "validation"
}
}
Cache-Control
string
Allowed value: no-store

A safe platform error response.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED AUTHENTICATION_FAILED AUTHORIZATION_FAILED RESOURCE_NOT_FOUND CONFLICT DEPENDENCY_FAILURE FLOW_FAILURE RATE_LIMITED INTERNAL_ERROR
category
required
string
Allowed values: validation authentication authorization not_found conflict dependency_failure flow_failure rate_limit internal
message
required

Safe client-facing diagnostic message.

string
correlationId
required

Correlation ID for operational investigation.

string
>= 1 characters
details

Safe bounded diagnostic details.

object
key
additional properties
One of:
string
Example
{
"error": {
"code": "VALIDATION_FAILED",
"category": "validation"
}
}
Cache-Control
string
Allowed value: no-store

A safe platform error response.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED AUTHENTICATION_FAILED AUTHORIZATION_FAILED RESOURCE_NOT_FOUND CONFLICT DEPENDENCY_FAILURE FLOW_FAILURE RATE_LIMITED INTERNAL_ERROR
category
required
string
Allowed values: validation authentication authorization not_found conflict dependency_failure flow_failure rate_limit internal
message
required

Safe client-facing diagnostic message.

string
correlationId
required

Correlation ID for operational investigation.

string
>= 1 characters
details

Safe bounded diagnostic details.

object
key
additional properties
One of:
string
Example
{
"error": {
"code": "VALIDATION_FAILED",
"category": "validation"
}
}
Cache-Control
string
Allowed value: no-store