Nexa API · v1

Developers

Reference

Floors

Levels within a building.

A floor belongs to a building and holds rooms. A single-storey plant still has one — usually called something like “Production hall” with level 0 — because rooms have to hang off something.

The floor object

iduuid
Opaque.
objectstring
Always "floor".
building_iduuid
The building.
namestring
Display name.
levelinteger
Storey number. 0 is ground; basements are negative.
created_attimestamp
ISO 8601, UTC.
updated_attimestamp
ISO 8601, UTC.
{
  "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"
}

Endpoints

List a building's floors

GET/buildings/{buildingId}/floors
Scope floors:readPaginated

Path parameters

buildingIduuidrequired
The building.

Accepts limit and cursor. See Pagination.

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

Response

GET /v1/buildings/{buildingId}/floors
{
  "data": [
    {
      "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"
    }
  ],
  "pagination": {
    "limit": 50,
    "has_more": true,
    "next_cursor": "eyJvIjo1MH0"
  }
}

Retrieve a floor

GET/floors/{floorId}
Scope floors:read

Path parameters

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

Response

GET /v1/floors/{floorId}
{
  "data": {
    "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"
  }
}

Create a floor

POST/buildings/{buildingId}/floors
Scope floors:write

Path parameters

buildingIduuidrequired
The building.

Body

namestringrequired
Display name.
levelintegerrequired
Storey number.
curl -X POST https://nexa.com.tn/api/v1/buildings/b7d41f0a-6e52-4a19-8c33-90ab12cd34ef/floors \
  -H "Authorization: Bearer $NEXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "Mezzanine",
       "level": 1
     }'

Response

POST /v1/buildings/{buildingId}/floors
{
  "data": {
    "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"
  }
}

Update a floor

PATCH/floors/{floorId}
Scope floors:write

Path parameters

floorIduuidrequired
The floor.

Body

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

Response

PATCH /v1/floors/{floorId}
{
  "data": {
    "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"
  }
}

Delete a floor

DELETE/floors/{floorId}
Scope floors:delete

Path parameters

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

Returns 204 No Content with an empty body.

On this page