Nexa API · v1

Developers

Reference

Rooms

Rooms and zones — where an asset actually is.

A room is the finest location in the hierarchy and the one an asset is attached to. In a plant it is usually a line or a zone rather than a walled room; in an office building it is a room.

The room object

iduuid
Opaque.
objectstring
Always "room".
floor_iduuid
The floor.
namestring
Display name.
created_attimestamp
ISO 8601, UTC.
updated_attimestamp
ISO 8601, UTC.
{
  "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"
}

Endpoints

List a floor's rooms

GET/floors/{floorId}/rooms
Scope rooms:readPaginated

Path parameters

floorIduuidrequired
The floor.

Accepts limit and cursor. See Pagination.

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

Response

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

Retrieve a room

GET/rooms/{roomId}
Scope rooms:read

Path parameters

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

Response

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

Create a room

POST/floors/{floorId}/rooms
Scope rooms:write

Path parameters

floorIduuidrequired
The floor.

Body

namestringrequired
Display name.
curl -X POST https://nexa.com.tn/api/v1/floors/b7d41f0a-6e52-4a19-8c33-90ab12cd34ef/rooms \
  -H "Authorization: Bearer $NEXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "Line 3"
     }'

Response

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

Update a room

PATCH/rooms/{roomId}
Scope rooms:write

Path parameters

roomIduuidrequired
The room.

Body

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

Response

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

Delete a room

DELETE/rooms/{roomId}
Scope rooms:delete

Assets in it are detached, not deleted.

Path parameters

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

Returns 204 No Content with an empty body.

On this page