Device Registration State - Get

Gets the device registration state.

GET https://{dpsName}.azure-devices-provisioning.net/registrations/{id}?api-version=2021-10-01

URI Parameters

Name In Required Type Description
dpsName
path True

string

The DPS instance hostname.

id
path True

string

Registration ID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Header

Name Required Type Description
Authorization True

string

Responses

Name Type Description
200 OK

DeviceRegistrationState

The request has succeeded.

Other Status Codes

ProvisioningServiceErrorDetails

An unexpected error response.

Headers

x-ms-error-code: string

Security

Authorization

Type: apiKey
In: header

Examples

DeviceRegistrationState_Get_MaximumSet_Gen
DeviceRegistrationState_Get_MinimumSet_Gen

DeviceRegistrationState_Get_MaximumSet_Gen

Sample request

GET https://{dpsName}.azure-devices-provisioning.net/registrations/diqgptxuffxmnjyxhjakroqn?api-version=2021-10-01

Sample response

{
  "assignedHub": "oasugtinnefgfklhldjhibq",
  "createdDateTimeUtc": "2025-10-01T17:42:04.759Z",
  "deviceId": "ttnhaugyyh",
  "errorCode": 2,
  "errorMessage": "ufqpjjmbiphiynoijjbocvl",
  "etag": "ctquvtjyhnomcmtddscxwjk",
  "lastUpdatedDateTimeUtc": "2025-10-01T17:42:04.759Z",
  "payload": {},
  "registrationId": "czvnrxvbka",
  "status": "unassigned",
  "substatus": "initialAssignment"
}

DeviceRegistrationState_Get_MinimumSet_Gen

Sample request

GET https://{dpsName}.azure-devices-provisioning.net/registrations/iphqjhiqk?api-version=2021-10-01

Sample response

{}

Definitions

Name Description
AssignedDeviceSubstatus

Substatus for 'Assigned' devices. Possible values include - 'initialAssignment': Device has been assigned to an IoT hub for the first time, 'deviceDataMigrated': Device has been assigned to a different IoT hub and its device data was migrated from the previously assigned IoT hub. Device data was removed from the previously assigned IoT hub, 'deviceDataReset': Device has been assigned to a different IoT hub and its device data was populated from the initial state stored in the enrollment. Device data was removed from the previously assigned IoT hub, 'reprovisionedToInitialAssignment': Device has been re-provisioned to a previously assigned IoT hub.

DeviceRegistrationState

Device registration state.

EnrollmentStatus

Enrollment status.

ProvisioningServiceErrorDetails

Contains the properties of an error returned by the Azure IoT Hub Provisioning Service.

AssignedDeviceSubstatus

Substatus for 'Assigned' devices. Possible values include - 'initialAssignment': Device has been assigned to an IoT hub for the first time, 'deviceDataMigrated': Device has been assigned to a different IoT hub and its device data was migrated from the previously assigned IoT hub. Device data was removed from the previously assigned IoT hub, 'deviceDataReset': Device has been assigned to a different IoT hub and its device data was populated from the initial state stored in the enrollment. Device data was removed from the previously assigned IoT hub, 'reprovisionedToInitialAssignment': Device has been re-provisioned to a previously assigned IoT hub.

Value Description
initialAssignment

initialAssignment

deviceDataMigrated

deviceDataMigrated

deviceDataReset

deviceDataReset

reprovisionedToInitialAssignment

reprovisionedToInitialAssignment

DeviceRegistrationState

Device registration state.

Name Type Description
assignedHub

string

Assigned Azure IoT Hub.

createdDateTimeUtc

string (date-time)

Registration create date time (in UTC).

deviceId

string

Device ID.

errorCode

integer (int32)

Error code.

errorMessage

string

Error message.

etag

string

The entity tag associated with the resource.

lastUpdatedDateTimeUtc

string (date-time)

Last updated date time (in UTC).

payload

Custom allocation payload returned from the webhook to the device.

registrationId

string

This id is used to uniquely identify a device registration of an enrollment. A case-insensitive string (up to 128 characters long) of alphanumeric characters plus certain special characters : . _ -. No special characters allowed at start or end.

status

EnrollmentStatus

Enrollment status.

substatus

AssignedDeviceSubstatus

Substatus for 'Assigned' devices. Possible values include - 'initialAssignment': Device has been assigned to an IoT hub for the first time, 'deviceDataMigrated': Device has been assigned to a different IoT hub and its device data was migrated from the previously assigned IoT hub. Device data was removed from the previously assigned IoT hub, 'deviceDataReset': Device has been assigned to a different IoT hub and its device data was populated from the initial state stored in the enrollment. Device data was removed from the previously assigned IoT hub, 'reprovisionedToInitialAssignment': Device has been re-provisioned to a previously assigned IoT hub.

EnrollmentStatus

Enrollment status.

Value Description
unassigned

unassigned

assigning

assigning

assigned

assigned

failed

failed

disabled

disabled

ProvisioningServiceErrorDetails

Contains the properties of an error returned by the Azure IoT Hub Provisioning Service.

Name Type Description
errorCode

integer (int32)

Error code for the operation.

info

object

Dictionary of <string>

message

string

Human-readable error message.

timestampUtc

string (date-time)

UTC timestamp of the error.

trackingId

string

Tracking ID for the error.