ITSM

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

FieldTypeRequiredDefaultDescription
tenantIdstringrequiredTenant ID. Auto-set, indexed.
namestringrequiredLocation display name.
codestringoptionalnullShort machine-friendly location code. Sparse-indexed.
countrystringoptionalnullCountry name or code.
regionstringoptionalnullRegion / state / province.
timezonestringoptionalnullIANA timezone identifier for the site (e.g. "America/New_York").
addressstringoptionalnullFree-text street address.
isActivebooleanoptionaltrueSoft-delete flag. DELETE sets this to false rather than removing the record.
createdAtdateoptionalAuto-set.
updatedAtdateoptionalAuto-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.

GET
/api/locations

List locations, sorted by name. Excludes inactive locations unless ?includeInactive=true is passed. Supports dynamic field filtering via query params.

POST
/api/locations

Create a location. Requires name.

GET
/api/locations/:id

Get a single location by ID.

PATCH
/api/locations/:id

Update location fields.

DELETE
/api/locations/:id

Soft-delete — sets isActive to false. The record is not removed from the database.

Create example

bash
POST /api/locations
{
  "name": "Bengaluru HQ",
  "code": "BLR-01",
  "country": "India",
  "region": "Karnataka",
  "timezone": "Asia/Kolkata",
  "address": "12th Main, Indiranagar, Bengaluru"
}
Locations are unrelated in schema to Departments — there is no 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.