Get User Context
curl --request GET \
--url https://api.xenia.team/api/v1/mgt/user-context \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://api.xenia.team/api/v1/mgt/user-context"
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/user-context', 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/user-context",
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/user-context"
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/user-context")
.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/user-context")
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": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"firstName": "Jane",
"lastName": "Doe",
"fullName": "Jane Doe",
"initials": "JD",
"emailId": "jane.doe@example.com",
"phoneNo": "+15555550123",
"photo": "@@#0AD3FF",
"timezone": "Asia/Karachi",
"isVerified": true,
"isAdmin": true,
"Role": {
"id": "b1f0e150-26ee-40f5-bbdd-a47232fef68a",
"title": "Owner",
"isActive": true,
"homepage": {
"mobile": "DEFAULT",
"web": "DEFAULT"
}
},
"Workspace": {
"id": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Acme Facilities",
"status": "Active",
"timezone": "Asia/Karachi",
"currency": "USD",
"avatar": {
"color": "#C7ADFE",
"photo": null
},
"orgSize": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"ChecklistCategoryIds": [],
"onboardingCompleted": true,
"Shift": null,
"Industry": null,
"Subscription": {
"id": "5d0b7c1e-2f3a-4b5c-8d9e-0a1b2c3d4e5f",
"ProductId": "67dceba7-d2af-4345-981c-9b40b1647552",
"PaywallId": null,
"status": "Active",
"startDate": "2024-02-01T10:00:00.000Z",
"endDate": null,
"cancelAtPeriodEnd": false
},
"subscriptionPlan": "Unlimited"
},
"WorkspaceId": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"UserWorkspace": {
"title": "Facilities Manager",
"defaultLocationId": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"homepage": null,
"status": "Active",
"isAdmin": true,
"isOwner": true,
"Workspace": {
"id": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Acme Facilities",
"status": "Active",
"timezone": "Asia/Karachi",
"currency": "USD",
"avatar": {
"color": "#C7ADFE",
"photo": null
},
"orgSize": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"ChecklistCategoryIds": [],
"onboardingCompleted": true,
"Shift": null,
"Industry": null,
"Subscription": {
"id": "5d0b7c1e-2f3a-4b5c-8d9e-0a1b2c3d4e5f",
"ProductId": "67dceba7-d2af-4345-981c-9b40b1647552",
"PaywallId": null,
"status": "Active",
"startDate": "2024-02-01T10:00:00.000Z",
"endDate": null,
"cancelAtPeriodEnd": false
},
"subscriptionPlan": "Unlimited"
},
"Role": {
"id": "b1f0e150-26ee-40f5-bbdd-a47232fef68a",
"title": "Owner",
"isActive": true,
"homepage": {
"mobile": "DEFAULT",
"web": "DEFAULT"
}
},
"RoleIdByLocationId": {}
},
"UserWorkspaces": [
{
"title": "Facilities Manager",
"defaultLocationId": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"homepage": null,
"status": "Active",
"isAdmin": true,
"isOwner": true,
"Workspace": {
"id": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Acme Facilities",
"status": "Active",
"timezone": "Asia/Karachi",
"currency": "USD",
"avatar": {
"color": "#C7ADFE",
"photo": null
},
"orgSize": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"ChecklistCategoryIds": [],
"onboardingCompleted": true,
"Shift": null,
"Industry": null,
"Subscription": {
"id": "5d0b7c1e-2f3a-4b5c-8d9e-0a1b2c3d4e5f",
"ProductId": "67dceba7-d2af-4345-981c-9b40b1647552",
"PaywallId": null,
"status": "Active",
"startDate": "2024-02-01T10:00:00.000Z",
"endDate": null,
"cancelAtPeriodEnd": false
},
"subscriptionPlan": "Unlimited"
},
"Role": {
"id": "b1f0e150-26ee-40f5-bbdd-a47232fef68a",
"title": "Owner",
"isActive": true,
"homepage": {
"mobile": "DEFAULT",
"web": "DEFAULT"
}
},
"RoleIdByLocationId": {}
}
],
"Permissions": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {
"CAN_MANAGE_USERS": true,
"CAN_VIEW_TASKS": true
}
},
"Features": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": [
"Sub-locations",
"Custom Roles"
]
},
"FeaturesHash": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {
"Sub-locations": true,
"Custom Roles": true
}
},
"UsagePaywalls": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {}
},
"teams": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {
"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f": {
"id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"name": "Housekeeping",
"WorkspaceId": "cb363f7e-c52a-4478-911d-f6a6f791090e"
}
}
},
"pendingDeletion": null
},
"message": "Login Successfully",
"extra_meta": {}
}Users
Get User Context
Fetches the context of the acting user (the API key’s default user, or the x-client-user override, which must be an Active member of the key’s workspace). Workspace is derived from the key. Pass ?refreshCache=true to bypass the cached context.
GET
/
api
/
v1
/
mgt
/
user-context
Get User Context
curl --request GET \
--url https://api.xenia.team/api/v1/mgt/user-context \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://api.xenia.team/api/v1/mgt/user-context"
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/user-context', 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/user-context",
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/user-context"
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/user-context")
.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/user-context")
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": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"firstName": "Jane",
"lastName": "Doe",
"fullName": "Jane Doe",
"initials": "JD",
"emailId": "jane.doe@example.com",
"phoneNo": "+15555550123",
"photo": "@@#0AD3FF",
"timezone": "Asia/Karachi",
"isVerified": true,
"isAdmin": true,
"Role": {
"id": "b1f0e150-26ee-40f5-bbdd-a47232fef68a",
"title": "Owner",
"isActive": true,
"homepage": {
"mobile": "DEFAULT",
"web": "DEFAULT"
}
},
"Workspace": {
"id": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Acme Facilities",
"status": "Active",
"timezone": "Asia/Karachi",
"currency": "USD",
"avatar": {
"color": "#C7ADFE",
"photo": null
},
"orgSize": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"ChecklistCategoryIds": [],
"onboardingCompleted": true,
"Shift": null,
"Industry": null,
"Subscription": {
"id": "5d0b7c1e-2f3a-4b5c-8d9e-0a1b2c3d4e5f",
"ProductId": "67dceba7-d2af-4345-981c-9b40b1647552",
"PaywallId": null,
"status": "Active",
"startDate": "2024-02-01T10:00:00.000Z",
"endDate": null,
"cancelAtPeriodEnd": false
},
"subscriptionPlan": "Unlimited"
},
"WorkspaceId": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"UserWorkspace": {
"title": "Facilities Manager",
"defaultLocationId": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"homepage": null,
"status": "Active",
"isAdmin": true,
"isOwner": true,
"Workspace": {
"id": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Acme Facilities",
"status": "Active",
"timezone": "Asia/Karachi",
"currency": "USD",
"avatar": {
"color": "#C7ADFE",
"photo": null
},
"orgSize": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"ChecklistCategoryIds": [],
"onboardingCompleted": true,
"Shift": null,
"Industry": null,
"Subscription": {
"id": "5d0b7c1e-2f3a-4b5c-8d9e-0a1b2c3d4e5f",
"ProductId": "67dceba7-d2af-4345-981c-9b40b1647552",
"PaywallId": null,
"status": "Active",
"startDate": "2024-02-01T10:00:00.000Z",
"endDate": null,
"cancelAtPeriodEnd": false
},
"subscriptionPlan": "Unlimited"
},
"Role": {
"id": "b1f0e150-26ee-40f5-bbdd-a47232fef68a",
"title": "Owner",
"isActive": true,
"homepage": {
"mobile": "DEFAULT",
"web": "DEFAULT"
}
},
"RoleIdByLocationId": {}
},
"UserWorkspaces": [
{
"title": "Facilities Manager",
"defaultLocationId": "46715d09-1628-4b1a-a12d-f9e0bbcdbc3c",
"homepage": null,
"status": "Active",
"isAdmin": true,
"isOwner": true,
"Workspace": {
"id": "cb363f7e-c52a-4478-911d-f6a6f791090e",
"name": "Acme Facilities",
"status": "Active",
"timezone": "Asia/Karachi",
"currency": "USD",
"avatar": {
"color": "#C7ADFE",
"photo": null
},
"orgSize": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"ChecklistCategoryIds": [],
"onboardingCompleted": true,
"Shift": null,
"Industry": null,
"Subscription": {
"id": "5d0b7c1e-2f3a-4b5c-8d9e-0a1b2c3d4e5f",
"ProductId": "67dceba7-d2af-4345-981c-9b40b1647552",
"PaywallId": null,
"status": "Active",
"startDate": "2024-02-01T10:00:00.000Z",
"endDate": null,
"cancelAtPeriodEnd": false
},
"subscriptionPlan": "Unlimited"
},
"Role": {
"id": "b1f0e150-26ee-40f5-bbdd-a47232fef68a",
"title": "Owner",
"isActive": true,
"homepage": {
"mobile": "DEFAULT",
"web": "DEFAULT"
}
},
"RoleIdByLocationId": {}
}
],
"Permissions": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {
"CAN_MANAGE_USERS": true,
"CAN_VIEW_TASKS": true
}
},
"Features": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": [
"Sub-locations",
"Custom Roles"
]
},
"FeaturesHash": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {
"Sub-locations": true,
"Custom Roles": true
}
},
"UsagePaywalls": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {}
},
"teams": {
"cb363f7e-c52a-4478-911d-f6a6f791090e": {
"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f": {
"id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"name": "Housekeeping",
"WorkspaceId": "cb363f7e-c52a-4478-911d-f6a6f791090e"
}
}
},
"pendingDeletion": null
},
"message": "Login Successfully",
"extra_meta": {}
}