---
title: "Given the ID for an upstream device, will return the upstream and the downstream relationships associated with that gateway. These downstream relationships are only those associated with the direct downstream level (they don’t work recursively)."
method: GET
path: "/devices/{deviceId}/relationships"
---

# Given the ID for an upstream device, will return the upstream and the downstream relationships associated with that gateway. These downstream relationships are only those associated with the direct downstream level (they don’t work recursively).

`GET /devices/{deviceId}/relationships`

List all relationships based on device ID

## Path parameters

- `deviceId` string, required

## Query parameters

- `api-version` string, required
- `maxpagesize` integer

## Response `200`

Success

- DeviceRelationshipCollection — The paged results of device relationships.
  - `value` DeviceRelationship[], required — The collection of device relationships.
    - `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.
  - `nextLink` string — URL to get the next page of device relationships.

## 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)
