---
title: "Create or update the metadata of an IoT hub."
method: PUT
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}"
tags: ["PUT"]
---

# Create or update the metadata of an IoT hub.

`PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}`

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior.

## Path parameters

- `subscriptionId` string, required
- `resourceGroupName` string, required
- `resourceName` string, required

## Query parameters

- `api-version` string, required

## Headers

- `If-Match` string

## Request body

- IotHubDescription — The common properties of an Azure resource.
  - `id` string — The resource identifier.
  - `name` string — The resource name.
  - `type` string — The resource type.
  - `location` string, required — The resource location.
  - `tags` object — The resource tags.

## Response `200`

This is returned as a response to the status polling request for the create or update operation. The body contains the resource representation that indicates a transitional provisioning state.

- IotHubDescription — The common properties of an Azure resource.
  - `id` string — The resource identifier.
  - `name` string — The resource name.
  - `type` string — The resource type.
  - `location` string, required — The resource location.
  - `tags` object — The resource tags.

## Other responses

- `201` — This is a long running operation. The operation returns a 201 if the validation is complete. The response includes an Azure-AsyncOperation header that contains a status URL. Clients are expected to poll the status URL for the status of the operation. If successful, the operation returns HTTP status code of 201 (OK).
- `default` — DefaultErrorResponse

---

[API](https://skmtc.net/azure/apis/iothubclient.md) · [All operations](https://skmtc.net/azure/apis/iothubclient/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/iothubclient/versions/a0bee5faaac7/schema)
