RelynkLearn
Builder APIAPI referenceResources

resources.related (version 1)

Resources connected to the given ones by one relationship, following it up to maxDepth steps. One row per (fromId, related resource) at its shortest depth. Common relationships: brick_Has_Part (building → levels → rooms; "in" = Is Part Of), brick_Feeds (air handling unit → terminal units → rooms; "in" = Is Fed By), brick_Has_Sub_Meter, brick_Is_Metered_By, rec_Located_In, relynk_Virtual_Meter_Calculated_From. resourceTypes.relationships shows which ones a building uses. For points use points.list with resourceIds.

POST
/resources.related/v1

Authorization

bearer
headerAuthorizationBearer <JWT>

A signed-in Relynk user's access token: OAuth 2.0 authorization code with PKCE at https://auth.relynk.io/authorize and https://auth.relynk.io/oauth/token, with audience https://ai.relynk.io/builder. The caller sees exactly what that user may see.

Query Parameters

tenantId?string

The tenant to read. May be left out when the caller belongs to exactly one tenant; GET /me lists them.

Formatuuid

Request Body

application/json
  1. body
fromIds*array<>

Resources to start from

Items1 <= items <= 200
relationship*string

Relationship key, e.g. "brick_Has_Part"

Match^[A-Za-z0-9_]+$
direction?string

"out" follows the relationship as named (Has Part); "in" follows its inverse (Is Part Of)

Default"out"
Value in"out""in"
maxDepth?integer

Steps to follow; e.g. 2 for building → levels → rooms via brick_Has_Part

Range1 <= value <= 10
Default1
targetTypeKeys?array<>

Only these types and their subtypes, e.g. ["rec_Room"] (keys from resourceTypes.list)

Items1 <= items <= 100
targetMainTypes?array<>

Only these main types

Items1 <= items
limit?integer
Range1 <= value <= 5000
Default1000

Response Body

The function output

application/json
  1. response
related*array<>
Itemsitems <= 5000
truncated*boolean

True when limit cut the result; narrow the filters or raise limit

Example Request
curl -X POST 'https://ai.relynk.io/builder/v1/resources.related/v1' \  -H 'Content-Type: application/json' \  -d '{  "fromIds": [    "64df67fb-d7ae-48f8-abc3-1fd3db709c57"  ],  "relationship": "string"}'
Example Response
{  "related": [    {      "id": "string",      "name": "string",      "typeKey": "string",      "typeName": "string",      "mainType": "string",      "buildingId": "string",      "fromId": "string",      "depth": 0    }  ],  "truncated": true}