Get Hierarchical Locations
curl --request GET \
--url https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations"
headers = {
"x-client-key": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-key': '<api-key>', 'x-client-secret': '<api-key>'}
};
fetch('https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-client-key: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-key", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations")
.header("x-client-key", "<api-key>")
.header("x-client-secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-client-key"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"HotelId": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "long title to display in dropdown for testing",
"description": null,
"avatar": {
"color": "#F8BBD0"
},
"ParentId": null,
"LevelId": null,
"slugCode": "long-title-to-display-in-dropdown-for-testing",
"isQREnable": false,
"locationNumber": 211,
"attachments": [],
"deletedTimestamp": "0",
"CreatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"UpdatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"DeletedBy": null,
"timezone": "America/Chicago",
"coordinates": {
"type": "Point",
"coordinates": [
-87.6297982,
41.8781136
]
},
"address": "Chicago, IL",
"createdAt": "2025-04-23T13:15:53.544Z",
"updatedAt": "2025-06-13T19:21:20.489Z",
"deletedAt": null,
"Members": [
{
"photo": "@@#7C77B9",
"fullName": "invited user 3",
"id": "183f639a-8358-485f-9abe-221d0efcbe8e",
"firstName": "invited",
"lastName": "user 3",
"emailId": "invite3@yopmail.com",
"phoneNo": null,
"deletedAt": null,
"timezone": "Asia/Karachi",
"RoleId": "4ccf0b65-fb99-40da-92d6-3f98730df8b2",
"defaultLocationId": null,
"type": "user"
}
],
"Level": null,
"assetCount": 0,
"Sublocations": [
{
"id": "df9469b4-311b-4d61-9db9-b81e10f7eca3",
"HotelId": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Sub location",
"description": "",
"avatar": {
"color": "#B3E5FC"
},
"ParentId": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"LevelId": null,
"slugCode": "sub-location",
"isQREnable": false,
"locationNumber": 212,
"attachments": [],
"deletedTimestamp": "0",
"CreatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"UpdatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"DeletedBy": null,
"timezone": "Asia/Karachi",
"coordinates": {
"type": "Point",
"coordinates": [
null,
null
]
},
"address": null,
"createdAt": "2025-05-05T12:55:48.186Z",
"updatedAt": "2025-05-05T12:56:29.512Z",
"deletedAt": null,
"Members": [],
"Level": null,
"assetCount": 0
}
]
}
],
"extra_meta": {
"message": ""
}
}Locations
Get Locations - Sub Locations Hierarchy
Fetches all locations for a given workspace in a nested tree structure. Only users with proper permissions can access this data.
GET
/
api
/
v1
/
mgt
/
workspaces
/
{workspaceId}
/
locations
Get Hierarchical Locations
curl --request GET \
--url https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations"
headers = {
"x-client-key": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-key': '<api-key>', 'x-client-secret': '<api-key>'}
};
fetch('https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-client-key: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-key", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations")
.header("x-client-key", "<api-key>")
.header("x-client-secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-client-key"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"HotelId": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "long title to display in dropdown for testing",
"description": null,
"avatar": {
"color": "#F8BBD0"
},
"ParentId": null,
"LevelId": null,
"slugCode": "long-title-to-display-in-dropdown-for-testing",
"isQREnable": false,
"locationNumber": 211,
"attachments": [],
"deletedTimestamp": "0",
"CreatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"UpdatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"DeletedBy": null,
"timezone": "America/Chicago",
"coordinates": {
"type": "Point",
"coordinates": [
-87.6297982,
41.8781136
]
},
"address": "Chicago, IL",
"createdAt": "2025-04-23T13:15:53.544Z",
"updatedAt": "2025-06-13T19:21:20.489Z",
"deletedAt": null,
"Members": [
{
"photo": "@@#7C77B9",
"fullName": "invited user 3",
"id": "183f639a-8358-485f-9abe-221d0efcbe8e",
"firstName": "invited",
"lastName": "user 3",
"emailId": "invite3@yopmail.com",
"phoneNo": null,
"deletedAt": null,
"timezone": "Asia/Karachi",
"RoleId": "4ccf0b65-fb99-40da-92d6-3f98730df8b2",
"defaultLocationId": null,
"type": "user"
}
],
"Level": null,
"assetCount": 0,
"Sublocations": [
{
"id": "df9469b4-311b-4d61-9db9-b81e10f7eca3",
"HotelId": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Sub location",
"description": "",
"avatar": {
"color": "#B3E5FC"
},
"ParentId": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"LevelId": null,
"slugCode": "sub-location",
"isQREnable": false,
"locationNumber": 212,
"attachments": [],
"deletedTimestamp": "0",
"CreatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"UpdatedBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"DeletedBy": null,
"timezone": "Asia/Karachi",
"coordinates": {
"type": "Point",
"coordinates": [
null,
null
]
},
"address": null,
"createdAt": "2025-05-05T12:55:48.186Z",
"updatedAt": "2025-05-05T12:56:29.512Z",
"deletedAt": null,
"Members": [],
"Level": null,
"assetCount": 0
}
]
}
],
"extra_meta": {
"message": ""
}
}⌘I