Skip to content
Hydda One API
Esc
↑↓navigate↵open⌘Jpreview
On this page

Organizations and contexts

How Hydda One divides a property operator into an organization, business contexts and units, and where each one appears in the API.

Every id you meet in the API belongs to one organization. Most also belong to one part of that organization, called an operational context. This page explains both, and spends most of its time on the kind of context you will route by: the business context.

The organization

An organization is one customer of Hydda One: a property operator, with all its properties, staff, customers and settings. Nothing is shared between two organizations.

A token always belongs to exactly one organization. You never send an organization id. Hydda One reads it from the token, and a request can never reach another organization’s data.

Operational contexts

An organization is too large to manage as one piece. A property owner can run a co-working business in one city, rent out apartments in another, and maintain buildings in both. Each has its own staff, its own customers and often its own company.

Hydda One models this as a small tree of operational contexts. An operational context is a named part of the organization that people and integrations are given access to.

Every context has a type. The types fall into four kinds:

Kind type What it is
The organization organization The root. Every organization has exactly one, and its id is the organization’s id.
A business context coworking, residential, facility_management One line of business the organization runs. See below.
A unit office, apartment One space a customer rents. It belongs to the business context that runs it.
A tenant tenant A customer company that manages its own people in Hydda One. It belongs to the business context it is a customer of.

Treat type as an open list. Hydda One can add a type, so do not fail on a value you have not seen.

Business contexts

A business context is one line of business that the organization operates: a co-working space at one address, a portfolio of rental apartments, a facility-management operation. It is the level where the day-to-day work happens.

A business context has its own:

  • Staff. An operator’s people are given roles in a business context, and reach only what belongs to it.
  • Customers and contracts. A customer’s contract is owned by the business context that signed it.
  • Offer. The rooms and resources it sells, with their prices and opening hours.
  • Settings. Its name, brand, currency, time zone and invoicing routine.

For an integration, the most useful way to think of a business context is as one company with its own books. A large property owner often runs each line of business as a separate legal company, with its own ERP account and its own signing account. Hydda One does not require that, but it is the reason the API tells you the business context of each invoice and each contract: it is how you choose the right account in the external system.

Business contexts and buildings

The physical world is modelled separately: real estates, buildings, floors and rooms. A business context does not own a building. It covers the parts of the buildings it operates in.

Two things follow from this:

  • Business contexts can overlap in space. In the picture, the co-working business sells the meeting rooms on floor 3, and the facility-management business handles a broken radiator on the same floor. Both cover it.
  • Business contexts are never nested. One business context does not contain another, even when one covers a whole building and the other a single floor of it. Each sits directly under the organization, as in the first diagram.

What you can rely on

  • A context’s id never changes. Its name can: an administrator can rename it. Store the id.
  • A business context never moves to another organization.
  • An organization can add a business context at any time. Do not hard-code the list. Read it from the API, and decide what your integration does with a business context it has no mapping for.

How access follows the tree

A role is granted at one context. It holds there and in every context that belongs to it.

Role granted at Reaches
The organization Everything: the organization, every business context, and every unit and tenant.
A business context That business context, and the units and tenants that belong to it. No other business context.

This is why some roles are granted at the organization and others at a business context. The role that delivers invoices is granted at the organization, because one invoicing integration serves the whole organization. The role that sends contracts for signature is granted at each business context, because each one can use a different signing account. Roles lists them.

Where contexts appear in the API

You see Where What it means
A list of contexts GET /v1/operational-contexts Every context your token’s roles reach, with id, name and type.
operationalContextId The bookable resource list, and integration configurations The context a request or a record applies to.
businessContextId Billing queue items and signing queue items The business context that owns the contract behind the item. Route by it.
level Integration configurations organization when a configuration applies to the whole organization, business_context when it applies to one business context.

List the contexts your token reaches

GET /v1/operational-contexts is on the identity host. Filter by types to read only the business contexts:

curl "https://idp.hydda.one/v1/operational-contexts?types=coworking&types=residential&types=facility_management" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
{
  "operationalContexts": [
    { "id": "5f0c1c5e-8a0e-4d53-9d2b-6a1f1a2b3c4d", "name": "Coworking Kungsgatan", "type": "coworking" },
    { "id": "9b7a2d10-3c44-4e0a-8f6e-1d2c3b4a5f6e", "name": "Housing North", "type": "residential" },
    { "id": "c2e4a6b8-1d3f-4a5c-9e7b-0f1e2d3c4b5a", "name": "Property services", "type": "facility_management" }
  ]
}

A token whose role is granted at the organization gets every context. A token whose role is granted at one business context gets that business context and what belongs to it. The list is paged: when the answer has a nextCursor, pass it as cursor to read the next page.

Next

Was this page helpful?