Locations
Physical site records — office/region metadata used for department assignment, asset tracking, and ITSM record scoping.
Overview
A Location record represents a physical site (e.g. an office, data center, or branch). It is a flat record — the current model does not nest locations into a building/floor/room hierarchy; each location carries its own country, region, timezone, and address. Locations are referenced from ITSM records via locationId (see the organisational references on the data model page) and from assets/CMDB for physical placement.
Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| tenantId | string | required | — | Tenant ID. Auto-set, indexed. |
| name | string | required | — | Location display name. |
| code | string | optional | null | Short machine-friendly location code. Sparse-indexed. |
| country | string | optional | null | Country name or code. |
| region | string | optional | null | Region / state / province. |
| timezone | string | optional | null | IANA timezone identifier for the site (e.g. "America/New_York"). |
| address | string | optional | null | Free-text street address. |
| isActive | boolean | optional | true | Soft-delete flag. DELETE sets this to false rather than removing the record. |
| createdAt | date | optional | — | Auto-set. |
| updatedAt | date | optional | — | Auto-set. |
Indexed on { tenantId, name } and sparsely on { tenantId, code }.
Endpoints
All routes are mounted at /api/locations and require authentication plus a resolved tenant/workspace context.
/api/locationsList locations, sorted by name. Excludes inactive locations unless ?includeInactive=true is passed. Supports dynamic field filtering via query params.
/api/locationsCreate a location. Requires name.
/api/locations/:idGet a single location by ID.
/api/locations/:idUpdate location fields.
/api/locations/:idSoft-delete — sets isActive to false. The record is not removed from the database.
Create example
POST /api/locations
{
"name": "Bengaluru HQ",
"code": "BLR-01",
"country": "India",
"region": "Karnataka",
"timezone": "Asia/Kolkata",
"address": "12th Main, Indiranagar, Bengaluru"
}locationId field on the Location model itself linking it back to a department. The relationship runs the other way: ITSM and asset records carry both a departmentId and alocationId side by side.