Appearance
Device Attributes Module
Overview
Swagger-driven developer documentation for device attribute endpoints and contracts.
Key APIs
| Method | Path | Summary |
|---|---|---|
| GET | /api/attributes/keys | Get all tenant attribute keys |
| GET | /api/devices/{deviceId}/attributes | Get device attributes |
| POST | /api/devices/{deviceId}/attributes | Save device attributes |
| DELETE | /api/devices/{deviceId}/attributes/{scope}/{key} | Delete one device attribute |
| GET | /api/devices/{deviceId}/attributes/keys | Get attribute keys for one device |
| GET | /api/v1/{deviceToken}/attributes | Device token API: get shared attributes |
| POST | /api/v1/{deviceToken}/attributes | Device token API: post client attributes |
| GET | /api/v1/{deviceToken}/attributes/flat | Device token API: get attributes (flat array) |
Frontend Usage Flow
- Frontend list pages call collection
GETendpoints to load tables or summary views. - Detail pages call parameterized
GETendpoints to load a single resource before rendering tabs, forms, or detail sections. - Create forms submit payloads to
POSTendpoints and then refresh the list or navigate to the created resource. - Delete actions call
DELETEendpoints and then refresh collection state.
GET /api/attributes/keys
Summary: Get all tenant attribute keys
Operation ID: DeviceAttributesController_getAttributeKeys
Tags: Device Attributes
Security:
bearer
Responses
200
Attribute keys returned successfully
Content-Type: application/json
Schema:
json
{
"type": "array",
"items": {
"$ref": "#/components/schemas/DeviceAttributeKeyDto"
}
}Example:
json
[
{
"key": "threshold"
}
]401
Unauthorized
No response body.
Notes / Constraints
- Swagger declares security requirements for this operation.
GET /api/devices/{deviceId}/attributes
Summary: Get device attributes
Operation ID: DeviceAttributesController_getAttributes
Tags: Device Attributes
Security:
bearer
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceId | path | yes | string | Device identifier |
| scope | query | no | string | - |
Responses
200
Device attributes returned successfully
Content-Type: application/json
Schema:
json
{
"type": "array",
"items": {
"$ref": "#/components/schemas/DeviceAttributeEntryDto"
}
}Example:
json
[
{
"key": "threshold",
"value": 75,
"scope": "SERVER",
"updatedAt": "2026-04-07T12:00:00.000Z"
}
]400
Invalid scope. Use SERVER, SHARED or CLIENT
No response body.
401
Unauthorized
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- This endpoint accepts query parameters that can affect filtering, pagination, or lookup behavior.
- Swagger declares security requirements for this operation.
POST /api/devices/{deviceId}/attributes
Summary: Save device attributes
Operation ID: DeviceAttributesController_saveAttributes
Tags: Device Attributes
Security:
bearer
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceId | path | yes | string | Device identifier |
Request
Content-Type: application/json
Schema:
json
{
"type": "object",
"required": [
"scope",
"attributes"
],
"properties": {
"scope": {
"type": "string",
"enum": [
"SERVER",
"SHARED",
"CLIENT"
]
},
"attributes": {
"type": "object",
"description": "Key-value attribute object"
}
}
}Example:
json
{
"scope": "SERVER",
"attributes": {
"threshold": 75,
"firmwareVersion": "1.0.3"
}
}Responses
200
Attributes saved successfully
Content-Type: application/json
Schema:
json
{
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
}
}
}Example:
json
{
"success": true
}400
Payload must include scope and attributes, attributes must be object, or invalid scope
No response body.
401
Unauthorized
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- Supported request content types:
application/json. - Swagger declares security requirements for this operation.
DELETE /api/devices/{deviceId}/attributes/{scope}/{key}
Summary: Delete one device attribute
Operation ID: DeviceAttributesController_deleteAttribute
Tags: Device Attributes
Security:
bearer
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceId | path | yes | string | Device identifier |
| scope | path | yes | string | Attribute scope |
| key | path | yes | string | Attribute key |
Responses
200
Attribute deleted successfully
Content-Type: application/json
Schema:
json
{
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
}
}
}Example:
json
{
"success": true
}400
Invalid scope. Use SERVER, SHARED or CLIENT
No response body.
401
Unauthorized
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- Swagger declares security requirements for this operation.
GET /api/devices/{deviceId}/attributes/keys
Summary: Get attribute keys for one device
Operation ID: DeviceAttributesController_getDeviceAttributeKeys
Tags: Device Attributes
Security:
bearer
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceId | path | yes | string | Device identifier |
Responses
200
Attribute keys returned successfully
Content-Type: application/json
Schema:
json
{
"type": "array",
"items": {
"$ref": "#/components/schemas/DeviceAttributeKeyDto"
}
}Example:
json
[
{
"key": "threshold"
}
]401
Unauthorized
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- Swagger declares security requirements for this operation.
GET /api/v1/{deviceToken}/attributes
Summary: Device token API: get shared attributes
Operation ID: DeviceAttributesController_deviceGetSharedAttributes
Tags: Device Attributes
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceToken | path | yes | string | Device access token |
| scope | query | no | string | - |
Responses
200
Shared attributes returned successfully
Content-Type: application/json
Schema:
json
{
"type": "array",
"items": {
"$ref": "#/components/schemas/DeviceAttributeEntryDto"
}
}Example:
json
[
{
"key": "threshold",
"value": 75,
"scope": "SERVER",
"updatedAt": "2026-04-07T12:00:00.000Z"
}
]400
Invalid device token or device can only read SHARED scope
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- This endpoint accepts query parameters that can affect filtering, pagination, or lookup behavior.
POST /api/v1/{deviceToken}/attributes
Summary: Device token API: post client attributes
Operation ID: DeviceAttributesController_devicePostAttributes
Tags: Device Attributes
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceToken | path | yes | string | Device access token |
Request
Content-Type: application/json
Schema:
json
{
"type": "object",
"properties": {
"temperature": {
"type": "object"
},
"humidity": {
"type": "object"
},
"firmwareVersion": {
"type": "object"
}
}
}Example:
json
{
"temperature": 25.5,
"humidity": 62,
"firmwareVersion": "1.0.3"
}Responses
200
Device attributes saved successfully
Content-Type: application/json
Schema:
json
{
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
}
}
}Example:
json
{
"success": true
}400
Invalid device token or invalid attribute payload
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- Supported request content types:
application/json.
GET /api/v1/{deviceToken}/attributes/flat
Summary: Device token API: get attributes (flat array)
Operation ID: DeviceAttributesController_deviceGetAttributesFlat
Tags: Device Attributes
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| deviceToken | path | yes | string | - |
| scope | query | yes | string | - |
| keys | query | yes | string | - |
Responses
200
No response body.
Notes / Constraints
- This endpoint depends on one or more path parameters.
- This endpoint accepts query parameters that can affect filtering, pagination, or lookup behavior.
Module Notes / Constraints
- Generated from OpenAPI version metadata:
1.0. - 5 operation(s) in this module declare explicit Swagger security requirements.
- HTTP methods present in this module: GET, POST, DELETE.
- This file is generated from Swagger/OpenAPI and should be regenerated when controller, DTO, or Swagger decorator changes affect the spec.
