Skip to content

IoT Platform API

Manage IoT devices, fleet operations, alarm rules, telemetry, and notifications.

Authentication: X-API-Key header with iot service permission.

Quick Start:

bash
# Register a device
curl -X POST https://api.wayscloud.services/v1/iot/devices \
  -H "X-API-Key: wayscloud_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "Sensor A", "device_type": "ESP32"}'

# List alarms
curl https://api.wayscloud.services/v1/iot/alarms?status=active \
  -H "X-API-Key: wayscloud_xxx"

# Create webhook notification channel
curl -X POST https://api.wayscloud.services/v1/iot/notifications/channels \
  -H "X-API-Key: wayscloud_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "Ops Webhook", "channel_type": "webhook", "config": {"url": "https://example.com/hook"}}'

Resources: Devices, Groups, Profiles, Rules, Alarms, Telemetry, Notifications

Endpoints

MethodPathDescription
GET/v1/iot/devicesList devices
POST/v1/iot/devicesRegister device
GET/v1/iot/devices/{device_id}Get device
PATCH/v1/iot/devices/{device_id}Update device
DELETE/v1/iot/devices/{device_id}Delete device
GET/v1/iot/devices/{device_id}/healthGet device health
GET/v1/iot/devices/{device_id}/tagsList device tags
POST/v1/iot/devices/{device_id}/tagsAdd tags to device
DELETE/v1/iot/devices/{device_id}/tags/{tag}Remove tag from device
GET/v1/iot/groupsList device groups
POST/v1/iot/groupsCreate device group
GET/v1/iot/groups/{group_id}Get device group
PUT/v1/iot/groups/{group_id}Update device group
DELETE/v1/iot/groups/{group_id}Delete device group
POST/v1/iot/groups/{group_id}/devicesAdd devices to group
DELETE/v1/iot/groups/{group_id}/devices/{device_id}Remove device from group
GET/v1/iot/profilesList device profiles
POST/v1/iot/profilesCreate device profile
GET/v1/iot/profiles/{profile_id}Get device profile
PUT/v1/iot/profiles/{profile_id}Update device profile
DELETE/v1/iot/profiles/{profile_id}Delete device profile
POST/v1/iot/profiles/{profile_id}/apply/{device_id}Apply profile to device
GET/v1/iot/rulesList alarm rules
POST/v1/iot/rulesCreate alarm rule
GET/v1/iot/rules/{rule_id}Get alarm rule
PUT/v1/iot/rules/{rule_id}Update alarm rule
DELETE/v1/iot/rules/{rule_id}Delete alarm rule
POST/v1/iot/rules/{rule_id}/enableEnable alarm rule
POST/v1/iot/rules/{rule_id}/disableDisable alarm rule
GET/v1/iot/alarmsList alarms
GET/v1/iot/alarms/summaryGet alarm summary
GET/v1/iot/alarms/{alarm_id}Get alarm details
GET/v1/iot/alarms/{alarm_id}/timelineGet alarm event timeline
POST/v1/iot/alarms/{alarm_id}/acknowledgeAcknowledge alarm
POST/v1/iot/alarms/{alarm_id}/resolveResolve alarm
POST/v1/iot/alarms/{alarm_id}/reopenReopen a resolved alarm
GET/v1/iot/datapointsList datapoint definitions
POST/v1/iot/datapointsCreate datapoint definition
GET/v1/iot/datapoints/{datapoint_id}Get datapoint definition
PUT/v1/iot/datapoints/{datapoint_id}Update datapoint definition
DELETE/v1/iot/datapoints/{datapoint_id}Delete datapoint definition
GET/v1/iot/devices/{device_id}/telemetryGet device telemetry
GET/v1/iot/devices/{device_id}/telemetry/latestGet latest telemetry values
GET/v1/iot/notifications/channelsList notification channels
POST/v1/iot/notifications/channelsCreate notification channel
GET/v1/iot/notifications/channels/{channel_id}Get notification channel
PUT/v1/iot/notifications/channels/{channel_id}Update notification channel
DELETE/v1/iot/notifications/channels/{channel_id}Delete notification channel
POST/v1/iot/notifications/channels/{channel_id}/testSend test notification
GET/v1/iot/notifications/policiesList notification policies
POST/v1/iot/notifications/policiesCreate notification policy
GET/v1/iot/notifications/policies/{policy_id}Get notification policy
PUT/v1/iot/notifications/policies/{policy_id}Update notification policy
DELETE/v1/iot/notifications/policies/{policy_id}Delete notification policy
GET/v1/iot/notifications/deliveriesList notification deliveries
GET/v1/iot/credentialsGet MQTT connection info
GET/v1/iot/subscriptionGet IoT subscription
GET/v1/iot/usageGet usage statistics
GET/v1/iot/statsGet platform statistics

GET /v1/iot/devices

List devices

Retrieve a paginated list of registered IoT devices.

Response:

FieldTypeDescription
devicesarrayRequired. List of device objects
totalintegerRequired. Total number of devices matching filter
pageintegerRequired. Current page number
page_sizeintegerRequired. Items per page

Example:

bash
curl https://api.wayscloud.services/v1/iot/devices \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/devices

Register device

Register a new IoT device and generate MQTT credentials. Subject to plan device limits.

Request Body:

FieldTypeDescription
device_idobjectUnique device identifier. Auto-generated UUID if omitted.
namestringRequired. Human-readable device name
descriptionobjectDevice description
device_typeobjectDevice type or model
metadataobjectCustom key-value metadata

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/devices \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/devices/

Get device

Retrieve detailed information about a specific device.

Example:

bash
curl https://api.wayscloud.services/v1/iot/devices/{device_id} \
  -H "X-API-Key: YOUR_API_KEY"

PATCH /v1/iot/devices/

Update device

Update device name, description, type, metadata, or active status.

Request Body:

FieldTypeDescription
nameobjectNew device name
descriptionobjectNew description
device_typeobjectNew device type
metadataobjectReplace custom metadata
is_activeobjectActivate or deactivate device

Example:

bash
curl -X PATCH https://api.wayscloud.services/v1/iot/devices/{device_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/devices/

Delete device

Delete device and revoke MQTT credentials. Cannot be undone.

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/devices/{device_id} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/devices/{device_id}/health

Get device health

Health score (0-100) with component breakdown: uptime, alarms, stability, freshness.

Example:

bash
curl https://api.wayscloud.services/v1/iot/devices/{device_id}/health \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/devices/{device_id}/tags

List device tags

Example:

bash
curl https://api.wayscloud.services/v1/iot/devices/{device_id}/tags \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/devices/{device_id}/tags

Add tags to device

Request Body:

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/devices/{device_id}/tags \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/devices/{device_id}/tags/

Remove tag from device

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/devices/{device_id}/tags/{tag} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/groups

List device groups

Example:

bash
curl https://api.wayscloud.services/v1/iot/groups \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/groups

Create device group

Request Body:

FieldTypeDescription
namestringRequired. Group name
descriptionobjectGroup description

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/groups \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/groups/

Get device group

Example:

bash
curl https://api.wayscloud.services/v1/iot/groups/{group_id} \
  -H "X-API-Key: YOUR_API_KEY"

PUT /v1/iot/groups/

Update device group

Request Body:

FieldTypeDescription
nameobjectNew group name
descriptionobjectNew description

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/iot/groups/{group_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/groups/

Delete device group

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/groups/{group_id} \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/groups/{group_id}/devices

Add devices to group

Request Body:

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/groups/{group_id}/devices \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/groups/{group_id}/devices/

Remove device from group

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/groups/{group_id}/devices/{device_id} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/profiles

List device profiles

Example:

bash
curl https://api.wayscloud.services/v1/iot/profiles \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/profiles

Create device profile

Request Body:

FieldTypeDescription
namestringRequired. Profile name
descriptionobjectProfile description
expected_topicsobjectMQTT topics the device should publish to
reporting_interval_secondsobjectExpected reporting interval in seconds
metadataobjectProfile metadata

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/profiles \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/profiles/

Get device profile

Example:

bash
curl https://api.wayscloud.services/v1/iot/profiles/{profile_id} \
  -H "X-API-Key: YOUR_API_KEY"

PUT /v1/iot/profiles/

Update device profile

Request Body:

FieldTypeDescription
nameobject
descriptionobject
expected_topicsobject
reporting_interval_secondsobject
metadataobject

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/iot/profiles/{profile_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/profiles/

Delete device profile

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/profiles/{profile_id} \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/profiles/{profile_id}/apply/

Apply profile to device

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/profiles/{profile_id}/apply/{device_id} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/rules

List alarm rules

Example:

bash
curl https://api.wayscloud.services/v1/iot/rules \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/rules

Create alarm rule

Request Body:

FieldTypeDescription
namestringRequired. Rule name
descriptionobjectRule description
rule_typestringRequired. Rule type: missing_data, offline, threshold, message_rate, reconnect_rate
scope_typestringScope: fleet, group, profile, device
scope_device_idobjectDevice ID when scope_type=device
scope_group_idobjectGroup ID when scope_type=group
scope_profile_idobjectProfile ID when scope_type=profile
configobjectRequired. Rule-type-specific configuration
severitystringAlarm severity: critical, warning, info
actionsarrayActions on trigger: create_alarm, send_webhook, mark_unhealthy
cooldown_secondsintegerMinimum seconds between alarm triggers
is_enabledbooleanWhether rule is active
auto_resolvebooleanAuto-resolve alarm when condition clears

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/rules \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/rules/

Get alarm rule

Example:

bash
curl https://api.wayscloud.services/v1/iot/rules/{rule_id} \
  -H "X-API-Key: YOUR_API_KEY"

PUT /v1/iot/rules/

Update alarm rule

Request Body:

FieldTypeDescription
nameobject
descriptionobject
configobject
severityobject
actionsobject
cooldown_secondsobject
is_enabledobject
auto_resolveobject

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/iot/rules/{rule_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/rules/

Delete alarm rule

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/rules/{rule_id} \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/rules/{rule_id}/enable

Enable alarm rule

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/rules/{rule_id}/enable \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/rules/{rule_id}/disable

Disable alarm rule

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/rules/{rule_id}/disable \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/alarms

List alarms

Retrieve alarms with optional filtering by status, severity, device, or rule.

Example:

bash
curl https://api.wayscloud.services/v1/iot/alarms \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/alarms/summary

Get alarm summary

Alarm counts grouped by status and severity.

Example:

bash
curl https://api.wayscloud.services/v1/iot/alarms/summary \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/alarms/

Get alarm details

Example:

bash
curl https://api.wayscloud.services/v1/iot/alarms/{alarm_id} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/alarms/{alarm_id}/timeline

Get alarm event timeline

Example:

bash
curl https://api.wayscloud.services/v1/iot/alarms/{alarm_id}/timeline \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/alarms/{alarm_id}/acknowledge

Acknowledge alarm

Request Body:

FieldTypeDescription
noteobjectOptional note

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/alarms/{alarm_id}/acknowledge \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

POST /v1/iot/alarms/{alarm_id}/resolve

Resolve alarm

Request Body:

FieldTypeDescription
noteobjectOptional note

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/alarms/{alarm_id}/resolve \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

POST /v1/iot/alarms/{alarm_id}/reopen

Reopen a resolved alarm

Request Body:

FieldTypeDescription
noteobjectOptional note

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/alarms/{alarm_id}/reopen \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/datapoints

List datapoint definitions

Example:

bash
curl https://api.wayscloud.services/v1/iot/datapoints \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/datapoints

Create datapoint definition

Request Body:

FieldTypeDescription
keystringRequired. Datapoint key (unique per customer)
labelobjectHuman-readable label
unitobjectMeasurement unit
data_typestringData type: number, string, boolean

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/datapoints \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/datapoints/

Get datapoint definition

Example:

bash
curl https://api.wayscloud.services/v1/iot/datapoints/{datapoint_id} \
  -H "X-API-Key: YOUR_API_KEY"

PUT /v1/iot/datapoints/

Update datapoint definition

Request Body:

FieldTypeDescription
labelobject
unitobject

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/iot/datapoints/{datapoint_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/datapoints/

Delete datapoint definition

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/datapoints/{datapoint_id} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/devices/{device_id}/telemetry

Get device telemetry

Retrieve telemetry data for a device, optionally filtered by datapoint and time range.

Example:

bash
curl https://api.wayscloud.services/v1/iot/devices/{device_id}/telemetry \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/devices/{device_id}/telemetry/latest

Get latest telemetry values

Example:

bash
curl https://api.wayscloud.services/v1/iot/devices/{device_id}/telemetry/latest \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/notifications/channels

List notification channels

Example:

bash
curl https://api.wayscloud.services/v1/iot/notifications/channels \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/notifications/channels

Create notification channel

Request Body:

FieldTypeDescription
namestringRequired. Channel name
channel_typestringRequired. Channel type: email, webhook, slack, teams, sms
configobjectRequired. Channel-type-specific configuration
is_enabledbooleanWhether channel is active

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/notifications/channels \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/notifications/channels/

Get notification channel

Example:

bash
curl https://api.wayscloud.services/v1/iot/notifications/channels/{channel_id} \
  -H "X-API-Key: YOUR_API_KEY"

PUT /v1/iot/notifications/channels/

Update notification channel

Request Body:

FieldTypeDescription
nameobject
configobject
is_enabledobject

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/iot/notifications/channels/{channel_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/notifications/channels/

Delete notification channel

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/notifications/channels/{channel_id} \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/notifications/channels/{channel_id}/test

Send test notification

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/notifications/channels/{channel_id}/test \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/notifications/policies

List notification policies

Example:

bash
curl https://api.wayscloud.services/v1/iot/notifications/policies \
  -H "X-API-Key: YOUR_API_KEY"

POST /v1/iot/notifications/policies

Create notification policy

Request Body:

FieldTypeDescription
namestringRequired. Policy name
descriptionobject
severity_filterarrayWhich alarm severities to match
rule_idsobjectSpecific rule IDs to match (null = all rules)
scope_typestringScope: fleet, device, group, profile
scope_idsobjectIDs within scope (null for fleet)
event_typesarrayAlarm events: triggered, acknowledged, resolved
channel_idsarrayRequired. Channel IDs to deliver to
cooldown_secondsintegerMinimum seconds between notifications for same alarm
is_enabledbooleanWhether policy is active

Example:

bash
curl -X POST https://api.wayscloud.services/v1/iot/notifications/policies \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

GET /v1/iot/notifications/policies/

Get notification policy

Example:

bash
curl https://api.wayscloud.services/v1/iot/notifications/policies/{policy_id} \
  -H "X-API-Key: YOUR_API_KEY"

PUT /v1/iot/notifications/policies/

Update notification policy

Request Body:

FieldTypeDescription
nameobject
descriptionobject
severity_filterobject
event_typesobject
channel_idsobject
cooldown_secondsobject
is_enabledobject

Example:

bash
curl -X PUT https://api.wayscloud.services/v1/iot/notifications/policies/{policy_id} \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

DELETE /v1/iot/notifications/policies/

Delete notification policy

Example:

bash
curl -X DELETE https://api.wayscloud.services/v1/iot/notifications/policies/{policy_id} \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/notifications/deliveries

List notification deliveries

Delivery history with optional filtering by channel type and status.

Example:

bash
curl https://api.wayscloud.services/v1/iot/notifications/deliveries \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/credentials

Get MQTT connection info

Returns MQTT broker connection details. Per-device credentials are provided at registration.

Example:

bash
curl https://api.wayscloud.services/v1/iot/credentials \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/subscription

Get IoT subscription

Returns current plan, device limit, and usage.

Example:

bash
curl https://api.wayscloud.services/v1/iot/subscription \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/usage

Get usage statistics

Returns message counts, data usage, and device activity for the current billing period.

Example:

bash
curl https://api.wayscloud.services/v1/iot/usage \
  -H "X-API-Key: YOUR_API_KEY"

GET /v1/iot/stats

Get platform statistics

Overview stats: total devices, active, connected, messages, data usage.

Example:

bash
curl https://api.wayscloud.services/v1/iot/stats \
  -H "X-API-Key: YOUR_API_KEY"

WAYSCloud AS