---
title: "Patch a given relationship given the relationship ID and a given device ID."
method: PATCH
path: "/devices/{deviceId}/relationships/{relationshipId}"
---

# Patch a given relationship given the relationship ID and a given device ID.

`PATCH /devices/{deviceId}/relationships/{relationshipId}`

Update device relationship

## Path parameters

- `deviceId` string, required
- `relationshipId` string, required

## Query parameters

- `api-version` string, required

## Request body

- object

## Response `200`

Success

- DeviceRelationship — An object representing the relationship between an upstream and a downstream device.
  - `id` string — The unique identifier of this relationship.
  - `source` string — The device ID of the source (parent) device.
  - `target` string — The device ID of the target (child) device.

## Other responses

- `default` — An error response received from the IoT Central Service.

---

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