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)?
Asked
Active
Viewed 154 times
1 Answers
1
You can try to use PATCH /api/devices/:id?api-versoin=2022-07-31
with JSON payload:
{
"organizations": ["org-id-to-be-updated"]
}

Roman Marusyk
- 23,328
- 24
- 73
- 116

Johnson Yang
- 26
- 2
-
What do you mean by the "org-id" aspect. Do you mean the organization name or an actual ID? I have tried a couple of things and they throw me 400s. I used the "Org Name" and I also tried the "Parent Org / Child Org Name". – Mike Lenart Sep 07 '22 at 00:04
-
1You can Try GET /api/organizations, find the org id from response payload – Johnson Yang Sep 08 '22 at 06:06