Search code examples
azure-iot-hubazure-iot-sdkazure-iot-centralazure-iot-hub-device-management

Is there a way either via REST APIs or SDKto change a device’s org in IoT Central?


When I create a device via the IoT Hub SDK it assigns the device to the parent org. Is there a way to change the org programmatically via the SDK or the REST (IoT Central or Hub)?


Solution

  • You can try to use PATCH /api/devices/:id?api-versoin=2022-07-31 with JSON payload:

    {
       "organizations": ["org-id-to-be-updated"]
    }