Spatial API
The Spatial API models where screens are: a tree of locations (venue, building, floor, space), the endpoints (screen mounts) inside spaces, the TVs in stock, and target groups that collect endpoints for campaigns, feeds and live control. The Catalogue API refers to spaces and target groups by the IDs from this API.
Resources¶
| Resource | What it is |
|---|---|
| Location | A node in the hierarchy: venue (a site), building, floor or space. |
| Endpoint | A mount in a space where a device (a screen) is seated. Vacant or Occupied. |
| Hardware asset | A TV in stock: stockroom, spare, installed or retired. |
| Zone | A logical group of spaces on a floor. |
| Establishment | A tenant or operator inside a venue. |
| Venue type | A shared category such as Mall or Hospital. |
| Tag | A label attached to locations. |
| Target group | A named set of endpoints. custom groups you edit; space groups follow the location tree. |
Authentication and permissions¶
All routes need a bearer token. See Authentication. There are two route sets for locations and endpoints.
Workspace-scoped routes (/api/v1/venues/{ws}/…) check a permission in the workspace in the path and show only the locations that workspace owns and everything below them.
| Action | Permission |
|---|---|
| List locations, trees, spaces, devices, endpoints, tags, venue types | workspace:devices:view |
| Create a location, endpoint or establishment | workspace:devices:create |
| Update or rename a location, replace tags, update an endpoint, assign a device | workspace:devices:edit |
| Delete a location or endpoint | workspace:devices:delete |
| Create a top-level venue, set up or change the first site, link a location to another workspace, list a location's workspaces | Organization owner or admin role |
Flat routes (/api/v1/locations, /endpoints, /zones, /hardware-assets, /establishments, /venues, /venue-types, /display-network/target-groups) read the organization from X-Organization-ID and optionally the workspace from X-Workspace-ID. Prefer the workspace-scoped routes where one exists.
Base path¶
https://<API_HOST>/api/v1/venues/{ws}/…
https://<API_HOST>/api/v1/locations/…
https://<API_HOST>/api/v1/display-network/target-groups/…
This is CoreAPI. {ws} is a workspace ID.
Capabilities¶
- Location hierarchy with placement rules, trees and device counts
- Endpoints and seating a device
- Hardware stock, installation planning and per-endpoint history
- Establishments, venue types, zones and tags
- Target groups, custom and derived
- First-site set-up for a new organization
- Linking spaces to zones (planned)
Object model¶
Location¶
| Field | Type | Meaning |
|---|---|---|
id |
UUID, read-only | Location ID. |
name |
string | Display name. Required. |
locationType |
venue, building, floor or space |
Level. Required. |
parentId |
UUID or null | Parent. Omit for a top-level venue. |
code, shortName |
string | Identifiers. |
status |
string | Default Active. |
timezone |
string | IANA time zone. |
venueRole |
property or establishment |
Venue only. An establishment venue needs parentVenueId. |
spaceType, maxCapacity, mountType |
string, integer | Space only. |
Placement rules: a venue is top level; a building goes under a venue; a floor under a building; a space under a venue, building, floor or another space. Everything must sit under a venue, otherwise the call answers 400.
{ "name": "Lobby", "locationType": "space", "parentId": "0a9c4e7f-3d2b-4a18-8f6e-5b1c9d2e7a40", "spaceType": "lobby", "maxCapacity": 500 }
Endpoint¶
| Field | Type | Meaning |
|---|---|---|
id |
UUID, read-only | Endpoint ID. |
spaceId |
UUID, read-only | The space; endpoints can only be created in spaces. |
name, code |
string | Name and code. |
deviceId |
UUID or null | Seated device. |
status |
Vacant or Occupied, read-only |
Occupied while a device is seated. |
isMonetized |
boolean | Sells advertising. |
orientation |
landscape or portrait |
Screen orientation. |
Seating a device in one endpoint takes it out of its previous endpoint, which becomes Vacant.
Target group¶
| Field | Type | Meaning |
|---|---|---|
id |
string | Group ID. Derived groups use space-…, all-screens and screen-<endpointId>. |
origin |
custom or space |
space groups are read only. |
endpointIds |
string array | Members. |
spaceCount, landscapeCount, portraitCount |
integer | Counts. |
Lists¶
No Spatial list is paginated: there is no page or limit, and a list returns every item as a bare JSON array ([] when empty), with no success or meta wrapper.
| List | Order |
|---|---|
| Locations, trees, spaces | sortOrder, then name. Filter locations with parent_id and location_type. |
| Devices and endpoints of a location, zones, tags, venue types, establishments | name |
| Hardware assets | Manufacturer, model, then serial number. Filter with status (available, stockroom, spare, installed or retired). |
| Target groups | Custom groups newest first, then the derived groups |
Endpoint search (q) |
name, at most 20 results |
| Endpoint history | Newest first, at most 100 events |
The flat GET /api/v1/locations leaves out locations that have no latitude and longitude. The workspace-scoped list returns them, so prefer it.
curl "https://<API_HOST>/api/v1/venues/<WORKSPACE_ID>/locations?location_type=space" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
[
{
"id": "5d1e8b3a-7c42-4f09-a6d1-9e3b2c7f0a58",
"organizationId": "4f0c2a9e-1b7d-4e55-9a3c-2d8e6f1a7b90",
"parentId": "0a9c4e7f-3d2b-4a18-8f6e-5b1c9d2e7a40",
"name": "Lobby",
"locationType": "space",
"code": "LOBBY",
"shortName": "Lobby",
"city": "Bangkok",
"country": "TH",
"latitude": 13.7563,
"longitude": 100.5018,
"status": "Active",
"timezone": "Asia/Bangkok",
"sortOrder": 0
}
]
Empty text fields are left out of each object.
Lifecycle and states¶
A TV moves through hardware states:
| State | Meaning | Next |
|---|---|---|
stockroom, spare |
In stock, available | installed via assign-hardware |
installed |
Seated in an endpoint | stockroom or retired via remove-hardware |
retired |
Out of service | None |
A room whose TV is removed waits for a new one: it appears in GET /endpoints/awaiting, where you can set an install team and date.
Errors¶
Spatial routes return { "error": "<reason>" }. Permission failures on workspace-scoped routes return { "message": "<reason>" }.
| Status | Example | When it happens and what to do |
|---|---|---|
| 400 | Cannot create building under space, Endpoints can only be created in spaces |
The request breaks a placement rule. |
| 401 | Unauthorized - No token provided |
Send a valid token. |
| 403 | Forbidden - Insufficient permissions, Forbidden - Organization admin only |
Your role lacks the permission. |
| 404 | Location not found in this workspace |
The ID doesn't exist in the workspace (or organization). |
| 409 | the serial number does not match this hardware, This site has been changed since set-up |
The state doesn't allow the action: check the serial, TV state or room. |
| 500 | Failed to … |
Retry later. |
Bodies as returned:
400.
401 on a workspace-scoped route. The flat routes answer a missing session with { "success": false, "error": "Unauthorized - sign in required" }.
403. The flat routes use { "success": false, "error": "Forbidden - the organization or workspace is not yours" }.
404. Other messages: Location not found in this workspace, Room or hardware not found.
409. Others: the serial number does not match this hardware, this hardware is not in the stockroom or spare.
500.
Endpoints¶
Related¶
- Catalogue API: feeds and live control use spaces and target groups
- Provisioning API: devices
- Conventions
- Changelog