Provision device (iotmer-auth-code)
POST/provision/device
Auth: header iotmer-auth-code must contain a provision API key (plain key string, not Bearer).
Do not use Authorization for this route. Body workspace_id (UUID) must equal the key's workspace.
Omit device_id to create a device with MQTT credentials (template_id optional; use template serial_format or set device_key).
With device_id, only MQTT credentials are rotated. Responses are minimal (on-device): flat device_id, device_key, mqtt_*, optional firmware_artifact_id — no full device object or mqtt_credentials wrapper.
Request
Responses
- 200
- 201
- 400
- 401
- 403
Minimal JSON for the device: device_id, device_key, mqtt_host, mqtt_port, mqtt_tls, mqtt_username, mqtt_password.
Minimal JSON for the device: device_id, device_key, mqtt_host, mqtt_port, mqtt_tls, mqtt_username, mqtt_password, optional firmware_artifact_id when the template links firmware.
Validation error
Missing or invalid iotmer-auth-code
workspace_id mismatch or not a provision key