Skip to content

Relationships

Typed relationships between port resources.

List relationships

View source specification ↗
GET /relationships

Read-only enumeration of typed relationships between endpoints, routes, groups and group routes. Both vertices must be readable by the caller. Defaults to caller-owned relationships with a bounded page. Provider discovery and group membership operations manage the edges.

Required scope

group:read

Query parameters

ownerstring

Filter the results by the owner of the resource. Defaults to the authenticated caller's resources when omitted. Use '~caller' to make that scope explicit. Another owner can be selected only for resources the caller can read.

groupIdstring

Relationships touching this group or a group route belonging to it.

routeIdstring

Only relationships with this route or group route ID as a vertex

endpointIdstring

Relationships touching this endpoint or a route belonging to it.

vertexIdstring

Relationships touching this exact resource ID.

parentIdstring

Relationships with a route or group-route vertex belonging to this resource ID.

typestring

Only relationships of this type.

Allowed values

  • IS_PART_OF
  • CAN_CONTROL
  • LOCATED_IN
  • MEMBER_OF
nextTokenstring

Opaque token for the next page of results. Pass the continuation token returned by the previous response, unchanged. Omit it to start from the first page.

maxResultsinteger

Maximum number of results to return in one page. Defaults to 100. Values from 1 through 100 are accepted.

minimum: 1

maximum: 100

Default: 100

expandarray<string>

Expansion tokens that request related or computed fields for each result. When omitted, the response contains only the default, shallower set of fields for each result.

Returns

200

Relationships retrieved successfully

Fields
resultsarray<Relationship>Required

A typed relationship between port resources. Provider discovery and group membership operations manage relationships; the REST collection is read-only.

etagstringRequired

Opaque strong version of this graph-owned relationship.

idstringRequired

The Port OS relationship ID.

ownerIdstringRequired

The owner of the relationship.

associatedPluginIdstring

The plugin that reported the relationship.

typestringRequired

Typed relationship between port resources. `IS_PART_OF`: a resource is contained in a parent resource (acyclic). `CAN_CONTROL`: an endpoint or route can act on another resource with the listed interface messages; it never grants authorization. `LOCATED_IN`: an endpoint route is currently observed inside a group route; it is an observation, not membership. `MEMBER_OF`: an endpoint belongs to a group.

Allowed values

  • IS_PART_OF
  • CAN_CONTROL
  • LOCATED_IN
  • MEMBER_OF
sourceRelationshipVertexRequired

A typed resource at one end of a relationship. Route parents are endpoints; group-route parents are groups.

targetRelationshipVertexRequired

A typed resource at one end of a relationship. Route parents are endpoints; group-route parents are groups.

interfacesarray<RelationshipInterface>

Interface applicability, when declared.

Capability-interface applicability of a relationship, for example the robotic-vacuum-cleaner messages a `CAN_CONTROL` edge supports on a room.

namestringRequired

The capability interface namespace.

minLength: 1

versionstringRequired

The capability interface version.

minLength: 1

messagesarray<string>

Message names of the interface the relationship applies to. An explicit empty array applies to no messages. Omission retains every message supported by the source interface.

uniqueItems: true

Itemstring

minLength: 1

paginationContextPaginationContext
errorsarray<Error>

Partial query errors collected while returning available results.

The one Port OS error shape, returned by every REST error response and every MCP tool error. `code` names the specific failure and `family` its broad class; both are closed enums, so clients branch on them and show `message`, which says what failed and what to do next.

familystringRequired

The broad class of an error. The family decides the HTTP status of a REST error, so clients can handle every code of a family alike.

codestringRequired

The specific error, one of a closed set of Port OS codes. Every REST error body, MCP tool error, batch item error and discovery item error uses this enum; each code belongs to an `ErrorFamily` that decides its HTTP status. Provider-specific codes are never codes: they travel in `details.providerCode`. New failure kinds are added here, never as free strings.

messagestringRequired

Plain-language description of the failure and the suggested next action.

detailsErrorDetails

Optional typed context for an error. Fields are additive and only populated when the error can safely expose that context to API clients.

errorsarray<SynchronizationItemError>

Every rejected item when a request that is validated item by item and applied atomically fails, such as a discovery `SynchronizationRequest` whose routes, group routes or relationships are rejected. Omitted for single-item failures.

One rejected discovery item of a `SynchronizationRequest`, keyed by the plugin-owned identity of the rejected item: `pluginRouteId` for a route or group route, or `relationshipExternalId` for a relationship. Exactly one of the two is set. It shares the `code`, `family`, `status` and `message` fields of `BatchItemError`; discovery items are keyed by plugin-owned identity because they carry no `requestId`. A request with any rejected item is rejected as a whole and lists every rejected item.

pluginRouteIdstring

Plugin-owned identifier of the rejected route or group route. Set unless the item is a relationship.

relationshipExternalIdstring

Plugin-owned `externalId` of the rejected relationship. Set only for relationship items.

interfacestring

Canonical capability interface name the failure applies to, when the failure is interface-specific.

versionstring

Declared capability interface version the failure applies to, when the failure is interface-specific.

codestringRequired

The specific error, one of a closed set of Port OS codes. Every REST error body, MCP tool error, batch item error and discovery item error uses this enum; each code belongs to an `ErrorFamily` that decides its HTTP status. Provider-specific codes are never codes: they travel in `details.providerCode`. New failure kinds are added here, never as free strings.

familystringRequired

The broad class of an error. The family decides the HTTP status of a REST error, so clients can handle every code of a family alike.

statusintegerRequired

HTTP-equivalent status code of the item failure.

minimum: 400

maximum: 599

messagestringRequired

Plain-language description of the failure and the suggested fix.

Errors

400 BAD_REQUEST

Bad request - missing or invalid parameters

Check the request fields and any validation details, then correct the payload.

401 UNAUTHORIZED

Unauthorized - invalid or missing authentication token

Obtain a valid access token, then retry.

403 FORBIDDEN

Forbidden - insufficient permissions

Check the linked account and its permissions for the device or resource.

500 INTERNAL

Internal server error

Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.