Skip to content

Device Attributes Module

Overview

Swagger-driven developer documentation for device attribute endpoints and contracts.

Key APIs

MethodPathSummary
GET/api/attributes/keysGet all tenant attribute keys
GET/api/devices/{deviceId}/attributesGet device attributes
POST/api/devices/{deviceId}/attributesSave device attributes
DELETE/api/devices/{deviceId}/attributes/{scope}/{key}Delete one device attribute
GET/api/devices/{deviceId}/attributes/keysGet attribute keys for one device
GET/api/v1/{deviceToken}/attributesDevice token API: get shared attributes
POST/api/v1/{deviceToken}/attributesDevice token API: post client attributes
GET/api/v1/{deviceToken}/attributes/flatDevice token API: get attributes (flat array)

Frontend Usage Flow

  • Frontend list pages call collection GET endpoints to load tables or summary views.
  • Detail pages call parameterized GET endpoints to load a single resource before rendering tabs, forms, or detail sections.
  • Create forms submit payloads to POST endpoints and then refresh the list or navigate to the created resource.
  • Delete actions call DELETE endpoints 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

NameInRequiredTypeDescription
deviceIdpathyesstringDevice identifier
scopequerynostring-

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

NameInRequiredTypeDescription
deviceIdpathyesstringDevice 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

NameInRequiredTypeDescription
deviceIdpathyesstringDevice identifier
scopepathyesstringAttribute scope
keypathyesstringAttribute 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

NameInRequiredTypeDescription
deviceIdpathyesstringDevice 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

NameInRequiredTypeDescription
deviceTokenpathyesstringDevice access token
scopequerynostring-

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

NameInRequiredTypeDescription
deviceTokenpathyesstringDevice 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

NameInRequiredTypeDescription
deviceTokenpathyesstring-
scopequeryyesstring-
keysqueryyesstring-

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.

support@autoconnecto.in · founder@autoconnecto.in · +91 92121 00555 · app.autoconnecto.in