Builder APIGuides
Choose a tenant
Let a person who belongs to several Relynk tenants choose one, and pass it on every call.
When a person can read more than one tenant, the app asks them to choose one and names it on every call.
A tenant is one organisation in Relynk, such as a property company.
Request
GET https://ai.relynk.io/builder/v1/me
authorization: Bearer <access token>What you get back
{
"userId": "6f1c…",
"tenants": [
{ "id": "8a1f…", "name": "Example Property AS" },
{ "id": "41b0…", "name": "Another Property AS" }
]
}Use the choice
Show the tenants' names, and add the chosen id as ?tenantId= to every call:
POST https://ai.relynk.io/builder/v1/buildings.list/v1?tenantId=8a1f…
authorization: Bearer <access token>
content-type: application/json
{}- With exactly one tenant,
tenantIdcan be left out. - With several and no
tenantId, calls fail with 400: "The caller belongs to 2 tenants: pass tenantId (GET /me lists them)". - A tenant the person cannot read fails with 403, "No access to tenant …".