Create a device type with an immutable key.
POST
/v1/tenants/{tenantNumber}/device-types
const url = 'https://api.dev.iot-sens.schlossers.at/v1/tenants/1/device-types';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example","name":"example","metadata":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.dev.iot-sens.schlossers.at/v1/tenants/1/device-types \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example", "name": "example", "metadata": { "additionalProperty": "example" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”tenantNumber
required
integer format: int32
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Device type created.
Media typeapplication/json
object
deviceTypeId
required
string format: uuid
tenantId
required
string format: uuid
key
required
string
name
required
string
status
required
string
activeFlowVersionNumber
required
integer | null
deviceCount
required
Count within the caller’s visible device scope.
integer
activeDeviceCount
required
Active count within the caller’s visible device scope.
integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "status": "active"}Headers
Section titled “Headers”Location
string
Example
/v1/device-types/10000000-0000-4000-8000-000000000001Canonical flat Device-Type URL.
default
Section titled “default”A safe platform error response.
Media typeapplication/json
object
error
required
object
Example
{ "error": { "code": "VALIDATION_FAILED", "category": "validation" }}Headers
Section titled “Headers”Cache-Control
string