Entity

Learn about the entity object in the PortierX API and how to interact with it.

Work in progress

We are actively working on our API. The documentation and implementation described here may not yet be fully aligned.

Overview

The entity object represents a real-world entity such as a person, organization, or device. Entities are used to store information about users, devices, and other entities in the PortierX system.

Common Attributes

All endpoints will use plural.

We are not provided a nested route. So instead of having /locations/{:id}/areas for all areas for locationSlug, you can get the value from /areas/?location={:id}. You can even add another filter like /areas/?location={locationSlug}&type=room to get all floors for locationSlug.

For :id in the endpoint, you can use the UUID representative or human readable ID (slug). So both We use slug instead of id for the endpoint. So instead of /locations/1, you will have /locations/office-1.

The entity object has the following common attributes:

AttributeTypeDescription
idUUIDThe unique identifier of the entity.
namestringThe name of the entity.
slugstringA human-readable identifier for the entity.
created_atstringThe timestamp when the entity was created.
created_bystringThe identifier of the user who created the entity.
updated_atstringThe timestamp when the entity was last updated.
updated_bystringThe identifier of the user who last updated the entity.

Entity Definitions

Location Management

GroupEntityDescription
Location ManagementLocationRoot entity for a working area.
AreaSubdivided spaces (buildings, floors, rooms, zones).
EntranceA guarded access point controlling entry to an area.

Locking System Management

GroupEntityDescription
Locking System ManagementLocking SystemA security system that groups multiple locks and policies.
LockA physical or electronic mechanism that secures an entrance.
KeyRepresents a credential (physical key, RFID, PIN, mobile ID, biometric) used to unlock locks.

People Management

GroupEntityDescription
PeoplePersonA physical individual who may hold keys but does not necessarily use the app.
UserA person who also has an app account to manage locks or access logs.
GroupA collection of people categorized by function or location (e.g., "Finance Dept", "Building A Workers").
RoleDefines permission levels within a group (e.g., "Manager" in "Finance Dept", "Technician" in "IT Dept").

Rules & Logs

GroupEntityDescription
RulesAccess RuleDefines who can access what, based on keys and permissions.
LogsAccess HistoryTracks historical access records (who had access to what and when).

Endpoints

MethodEndpointDescriptionFieldsPossible Database Tables
GET/locationsList all locations for the current customerid, name, type, address, status, created_atlocations
POST/locationsCreate a new locationname, type, address, geo_coordinates, statuslocations
GET/locations/{id}Get details of a specific locationid, name, type, address, geo_coordinates, status, areaslocations, areas
PATCH/locations/{id}Update location detailsname, type, address, geo_coordinates, statuslocations
DELETE/locations/{id}Delete a locationidlocations
GET/areasGet all areas in an locationid, name, type, status, lock_idareas
POST/areasCreate an area inside an locationname, type, status, lock_idareas
GET/areas/{id}Get details of a specific areaid, name, parent_id, type, status, children_areasareas
PATCH/areas/{id}Update an areaname, parent_id, type, statusareas
DELETE/areas/{id}Delete an areaidareas
GET/entrancesGet all entrances in an areaid, name, type, status, lock_identrances
POST/entrancesCreate an entrance inside an areaname, type, status, lock_identrances
GET/entrances/{id}Get details of a specific entranceid, name, type, status, lock_id, area_identrances
PATCH/entrances/{id}Update entrance detailsname, type, status, lock_identrances
DELETE/entrances/{id}Delete an entranceidentrances

Information /me /tenant /current /current/summary

Locking Systen /systems /locks /keys /key-profiles

Hold by zitadel /users /auth

Data Model Design

locations Table

ColumnTypeDescription
idUUIDUnique identifier
tenant_idUUIDLinks to the customer
nameVARCHARLocation name
typeENUMoffice, warehouse, factory, building
addressTEXTFull address
geo_coordinatesJSONB{ "lat": x, "long": y }
statusENUMactive, inactive
created_atTIMESTAMPTimestamp

areas Table

ColumnTypeDescription
idUUIDUnique identifier
location_idUUIDLinks to locations.id
parent_idUUID (nullable)Parent area (NULL if top level)
nameVARCHARArea name (e.g., "Level 2", "Main Hall")
typeENUMfloor, room, hall, section
statusENUMactive, inactive
depth_levelINTHierarchy level (e.g., 0 = building, 1 = floor, 2 = room)

entrances Table

ColumnTypeDescription
idUUIDUnique identifier
area_idUUIDLinks to areas.id (defines where entrance exists)
nameVARCHAREntrance name (e.g., "Main Gate", "Backdoor")
typeENUMdoor, gate, turnstile, barrier
statusENUMactive, inactive
lock_idUUID (nullable)If linked to a locking system
created_atTIMESTAMPTimestamp

On this page