HTTPS provision device (iotmer-auth-code)
POST/provision/device
Register a device or rotate MQTT credentials. Send the workspace provision API key in iotmer-auth-code (raw string; do not use Authorization on this route). Returns MQTT credentials and a one-time device_http_token for factory/device-side setup. Typical factory flow: GET /provision/device-templates?workspace_id=... (same header) → user picks a row → POST /provision/device with that row's id as template_id.
Request
Responses
- 200
- 201
- 400
- 401
- 403
- 500
- 503
Rotated credentials for the given device_id (new mqtt_password and device_http_token).
New device row; includes MQTT material, device_http_token, optional firmware fields.
Validation error
Missing or invalid iotmer-auth-code header
workspace_id does not match the key, or key is not a provision key
Server error (e.g. could not complete device or token persistence)
Auth DB not configured when MQTT connectivity is required