Tempivo Help
REST API

Buildings

Buildings and spaces

REST API overview

GET
/buildings

Retrieve all buildings in your organization.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token with your API key. Example: Bearer sk_live_xxx

In: header

Response Body

application/json

curl -X GET "https://example.com/buildings"
{
  "recType": "building-collection",
  "items": [
    {
      "id": "bld_xyz",
      "recType": "building",
      "name": "Kirurgavd.",
      "address": "Storgatan 1",
      "country": "SE",
      "type": "healthcare",
      "floors": 3,
      "createdAt": "2024-01-15T08:00:00.000Z"
    }
  ],
  "totalItems": 1
}
GET
/buildings/{buildingId}

Retrieve a single building by ID, including its spaces.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token with your API key. Example: Bearer sk_live_xxx

In: header

Path Parameters

buildingId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/buildings/string"
{
  "id": "string",
  "recType": "building",
  "name": "string",
  "address": "string",
  "country": "string",
  "type": "string",
  "floors": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "spaces": [
    {
      "id": "string",
      "recType": "space",
      "name": "string",
      "floor": 0,
      "buildingId": "string"
    }
  ]
}
{
  "success": false,
  "message": "Invalid or inactive API key"
}
GET
/buildings/{buildingId}/observations

Retrieve observations for all assets in a building. Results are grouped by assetId and sorted by assetId. No cross-asset aggregation is applied.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token with your API key. Example: Bearer sk_live_xxx

In: header

Path Parameters

buildingId*string

Query Parameters

startDate?string

ISO date (YYYY-MM-DD). Default: 30 days ago

endDate?string

ISO date. Default: today

resolution?string

hourly supports max 30 days range

limit?integer

Max number of assets returned

cursor?string

Same as nextCursor from the previous response: raw asset document ID, pass verbatim.

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/buildings/string/observations"
{
  "recType": "building-observation-collection",
  "buildingId": "bld_xyz",
  "resolution": "daily",
  "items": [
    {
      "recType": "observation-collection",
      "assetId": "asset-1AbcDeF2GhiJkL",
      "resolution": "daily",
      "items": [
        {
          "timestamp": "2024-05-20T00:00:00.000Z",
          "waterTempMin": 52.1,
          "waterTempMax": 61.3,
          "waterTempAvg": 56.8,
          "flushCount": 3
        }
      ],
      "totalItems": 1
    }
  ],
  "totalItems": 1,
  "nextCursor": "asset-1AbcDeF2GhiJkL"
}
{
  "success": false,
  "message": "Invalid or inactive API key"
}
{
  "success": false,
  "message": "Invalid or inactive API key"
}

How is this guide?