Skip to content

Receive device state report and publish to Kafka for drift detection
Stable

Request

Submits a device state report so Esper can detect blueprint drift.

Accepts a sparse report of device settings that have changed and records it against the device. Esper compares these reports with the device's assigned blueprint to detect drift. Returns 201 on success.

About Device State Reports Blueprint drift happens when a device's actual settings no longer match its assigned blueprint. Device state reports feed that comparison. Drift results are available from the Blueprint Drift endpoints, such as GET /v2/blueprint-drift/{deviceId}/status.

Key Fields / Query Parameters

  • id — UUID of the device (path parameter)
  • device_settings — Object containing only the settings keys that changed (required)
  • event_ts — Time of the change, in milliseconds since the Unix epoch

Common Use Cases

  • Reporting setting changes that feed blueprint drift detection

Best Practices

  • Send only changed keys in device_settings, not the full settings object
  • Include event_ts so reports can be ordered correctly

Workflow

  1. Collect the settings that changed on the device
  2. Call this endpoint with device_settings and event_ts
  3. Check drift results with the Blueprint Drift endpoints
Security
device_apiKey
Path
idstring, (uuid)required

ID of the device

Bodyapplication/jsonrequired
event_tsnumber

Event timestamp in milliseconds since epoch

device_settingsobjectrequired

Partial settings payload containing only changed keys (sparse object)

property name*anyadditional property
cURL
curl -i -X PUT \
  'https://develop-api.esper.io/_mock/openapi/v2/devices/{id}/devicestate' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "event_ts": 0,
    "device_settings": {}
  }'

Responses

Created

Bodyapplication/json
contentobject
Response
{ "content": {} }