Skip to main content

Devices API

These endpoints cover the full device lifecycle, from initial registration through credential rotation and revocation.

Base URL: https://api.hestialabs.in/v1

Endpoints​

MethodPathSummary
GET/devicesList Devices
GET/devices/{id}Get Device
POST/device/{id}/revokeRevoke Device
POST/device/{id}/rotate-secretRotate Device Secret
POST/device/registerRegister Device

List Devices​

GET /devices

List all devices for the tenant

Authentication: Bearer JWT required

Parameters​

None.

Responses​

StatusDescription
200Device list

Example 200 response​

{
"devices": [
{}
],
"count": 0
}

Get Device​

GET /devices/{id}

Get device details by ID

Authentication: Bearer JWT required

Parameters​

NameInTypeRequiredDescription
idpathstringYes—

Responses​

StatusDescription
200Device info
404Device not found

Example 200 response​

{
"device": {}
}

Revoke Device​

POST /device/{id}/revoke

Revoke a device and add to blacklist

Authentication: Bearer JWT required

Parameters​

NameInTypeRequiredDescription
idpathstringYes—

Responses​

StatusDescription
200Device revoked

Example 200 response​

{
"device_id": "string",
"status": "revoked"
}

Rotate Device Secret​

POST /device/{id}/rotate-secret

Rotate device key and get new secret (24h dual-key grace window)

Authentication: Bearer JWT required

Parameters​

NameInTypeRequiredDescription
idpathstringYes—

Responses​

StatusDescription
200Secret rotated

Example 200 response​

{
"device_id": "string",
"new_secret": "string",
"key_version": 0
}

Register Device​

POST /device/register

Register a new device and get its secret

Authentication: Bearer JWT required

Parameters​

None.

Request body​

FieldTypeRequiredDescription
device_typestringYesDevice type (e.g., smart-sensor, smart-switch)
home_idstringYesHome UUID to assign device to
room_idstringNoOptional room UUID

Example request​

{
"device_type": "string",
"home_id": "string",
"room_id": "string"
}

Responses​

StatusDescription
201Device registered
403Forbidden
503Beta limit reached

Example 201 response​

{
"status": "string",
"device_id": "string",
"tenant_id": "string",
"device_secret": "string",
"initial_sequence": 0,
"api_base_url": "string"
}