Nexa API · v1

Developers

Reference

Buildings

Sites and buildings — the top of the facility hierarchy.

A building is a site: a factory, a warehouse, an office, a hospital wing. Everything physical in Nexa sits inside one, and most reporting is grouped by them.

If you only need to read the structure, use the hierarchy endpoint rather than walking buildings, then floors, then rooms. It returns the whole tree in one call — which is one request against your rate limit instead of one per floor.

The building object

iduuid
Opaque.
objectstring
Always "building".
namestring
Display name.
descriptionstring · nullable
Free text.
building_typestring
One of office, residential, commercial, industrial, mixed_use, educational, healthcare, hospitality, warehouse, production_facility, industrial_process_facility, manufacturing_facility, warehouse_and_offices, other.
physical_addressstring
Street address.
area_sqmstring · nullable
A decimal STRING, not a number.
created_attimestamp
ISO 8601, UTC.
updated_attimestamp
ISO 8601, UTC.
{
  "id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
  "object": "building",
  "name": "Plant 1",
  "description": "Main production site.",
  "building_type": "manufacturing_facility",
  "physical_address": "Zone Industrielle, Ben Arous",
  "area_sqm": "8400.00",
  "created_at": "2023-01-15T08:00:00.000Z",
  "updated_at": "2026-06-02T11:20:00.000Z"
}

Endpoints

List buildings

GET/buildings
Scope buildings:readPaginated

Accepts limit and cursor. See Pagination.

curl https://nexa.com.tn/api/v1/buildings \
  -H "Authorization: Bearer $NEXA_API_KEY"

Response

GET /v1/buildings
{
  "data": [
    {
      "id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
      "object": "building",
      "name": "Plant 1",
      "description": "Main production site.",
      "building_type": "manufacturing_facility",
      "physical_address": "Zone Industrielle, Ben Arous",
      "area_sqm": "8400.00",
      "created_at": "2023-01-15T08:00:00.000Z",
      "updated_at": "2026-06-02T11:20:00.000Z"
    }
  ],
  "pagination": {
    "limit": 50,
    "has_more": true,
    "next_cursor": "eyJvIjo1MH0"
  }
}

Retrieve a building

GET/buildings/{buildingId}
Scope buildings:read

Path parameters

buildingIduuidrequired
The building.
curl https://nexa.com.tn/api/v1/buildings/b7d41f0a-6e52-4a19-8c33-90ab12cd34ef \
  -H "Authorization: Bearer $NEXA_API_KEY"

Response

GET /v1/buildings/{buildingId}
{
  "data": {
    "id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
    "object": "building",
    "name": "Plant 1",
    "description": "Main production site.",
    "building_type": "manufacturing_facility",
    "physical_address": "Zone Industrielle, Ben Arous",
    "area_sqm": "8400.00",
    "created_at": "2023-01-15T08:00:00.000Z",
    "updated_at": "2026-06-02T11:20:00.000Z"
  }
}

Retrieve the full tree under a building

GET/buildings/{buildingId}/hierarchy
Scope buildings:read

Floors, their rooms and the assets in them, in one response. Use this to mirror the structure rather than issuing a request per floor.

Path parameters

buildingIduuidrequired
The building.
curl https://nexa.com.tn/api/v1/buildings/b7d41f0a-6e52-4a19-8c33-90ab12cd34ef/hierarchy \
  -H "Authorization: Bearer $NEXA_API_KEY"

Response

GET /v1/buildings/{buildingId}/hierarchy
{
  "data": {
    "id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
    "object": "building",
    "name": "Plant 1",
    "description": "Main production site.",
    "building_type": "manufacturing_facility",
    "physical_address": "Zone Industrielle, Ben Arous",
    "area_sqm": "8400.00",
    "created_at": "2023-01-15T08:00:00.000Z",
    "updated_at": "2026-06-02T11:20:00.000Z",
    "floors": [
      {
        "id": "0a6e524a-198c-4390-ab12-cd34efb7d41f",
        "object": "floor",
        "building_id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
        "name": "Production hall",
        "level": 0,
        "created_at": "2023-01-15T08:05:00.000Z",
        "updated_at": "2023-01-15T08:05:00.000Z",
        "rooms": [
          {
            "id": "6e524a19-8c33-90ab-12cd-34efb7d41f0a",
            "object": "room",
            "floor_id": "0a6e524a-198c-4390-ab12-cd34efb7d41f",
            "name": "Line 2",
            "created_at": "2023-01-15T08:07:00.000Z",
            "updated_at": "2023-01-15T08:07:00.000Z",
            "assets": []
          }
        ]
      }
    ]
  }
}

Create a building

POST/buildings
Scope buildings:write

Body

namestringrequired
Display name.
physical_addressstringrequired
Street address.
building_typestringrequired
One of office, residential, commercial, industrial, mixed_use, educational, healthcare, hospitality, warehouse, production_facility, industrial_process_facility, manufacturing_facility, warehouse_and_offices, other. Anything else returns 400.
descriptionstring
Free text.
area_sqmnumber
Floor area.
curl -X POST https://nexa.com.tn/api/v1/buildings \
  -H "Authorization: Bearer $NEXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "Plant 2",
       "physical_address": "Zone Industrielle, Ben Arous",
       "building_type": "manufacturing_facility"
     }'

Response

POST /v1/buildings
{
  "data": {
    "id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
    "object": "building",
    "name": "Plant 1",
    "description": "Main production site.",
    "building_type": "manufacturing_facility",
    "physical_address": "Zone Industrielle, Ben Arous",
    "area_sqm": "8400.00",
    "created_at": "2023-01-15T08:00:00.000Z",
    "updated_at": "2026-06-02T11:20:00.000Z"
  }
}

Update a building

PATCH/buildings/{buildingId}
Scope buildings:write

Path parameters

buildingIduuidrequired
The building.

Body

namestring
Display name.
physical_addressstring
Street address.
curl -X PATCH https://nexa.com.tn/api/v1/buildings/b7d41f0a-6e52-4a19-8c33-90ab12cd34ef \
  -H "Authorization: Bearer $NEXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response

PATCH /v1/buildings/{buildingId}
{
  "data": {
    "id": "1f0a6e52-4a19-8c33-90ab-12cd34efb7d4",
    "object": "building",
    "name": "Plant 1",
    "description": "Main production site.",
    "building_type": "manufacturing_facility",
    "physical_address": "Zone Industrielle, Ben Arous",
    "area_sqm": "8400.00",
    "created_at": "2023-01-15T08:00:00.000Z",
    "updated_at": "2026-06-02T11:20:00.000Z"
  }
}

Delete a building

DELETE/buildings/{buildingId}
Scope buildings:delete

Cascades to its floors and rooms. Assets in them are detached, not deleted.

Path parameters

buildingIduuidrequired
The building.
curl -X DELETE https://nexa.com.tn/api/v1/buildings/b7d41f0a-6e52-4a19-8c33-90ab12cd34ef \
  -H "Authorization: Bearer $NEXA_API_KEY"

Returns 204 No Content with an empty body.

On this page