Service - Create Or Update Device

Create or update the identity of a device in the identity registry of an IoT hub.
Create or update the identity of a device in the identity registry of an IoT hub. An ETag must not be specified for the create operation. An ETag must be specified for the update operation. Note that generationId and deviceId cannot be updated by the user.

PUT https://fully-qualified-iothubname.azure-devices.net/devices/{id}?api-version=2018-06-30

URI Parameters

Name In Required Type Description
id
path True
  • string

Device ID.

api-version
query True
  • string

Version of the Api.

Request Header

Name Required Type Description
If-Match
  • string

Request Body

Name Type Description
authentication
capabilities

Status of Capabilities enabled on the device

cloudToDeviceMessageCount
  • integer
connectionState enum:
  • Disconnected
  • Connected
connectionStateUpdatedTime
  • string
deviceId
  • string
etag
  • string
generationId
  • string
lastActivityTime
  • string
status enum:
  • enabled
  • disabled
statusReason
  • string
statusUpdatedTime
  • string

Responses

Name Type Description
200 OK

Returns the Device object

Definitions

AuthenticationMechanism
Device
DeviceCapabilities

Status of Capabilities enabled on the device

SymmetricKey
X509Thumbprint

AuthenticationMechanism

Name Type Description
symmetricKey
type enum:
  • certificateAuthority
  • none
  • sas
  • selfSigned
x509Thumbprint

Device

Name Type Description
authentication
capabilities

Status of Capabilities enabled on the device

cloudToDeviceMessageCount
  • integer
connectionState enum:
  • Connected
  • Disconnected
connectionStateUpdatedTime
  • string
deviceId
  • string
etag
  • string
generationId
  • string
lastActivityTime
  • string
status enum:
  • disabled
  • enabled
statusReason
  • string
statusUpdatedTime
  • string

DeviceCapabilities

Status of Capabilities enabled on the device

Name Type Description
iotEdge
  • boolean

SymmetricKey

Name Type Description
primaryKey
  • string
secondaryKey
  • string

X509Thumbprint

Name Type Description
primaryThumbprint
  • string
secondaryThumbprint
  • string