Update a Location Attribute
curl --request PUT \
--url https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId} \
--header 'Content-Type: application/json' \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"name": "Region",
"description": "Sales region",
"options": [
{
"id": "0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10",
"label": "North",
"color": "#7C5CFC"
},
{
"label": "South",
"color": "#2BB673"
}
]
}
'import requests
url = "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}"
payload = {
"name": "Region",
"description": "Sales region",
"options": [
{
"id": "0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10",
"label": "North",
"color": "#7C5CFC"
},
{
"label": "South",
"color": "#2BB673"
}
]
}
headers = {
"x-client-key": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-client-key': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Region',
description: 'Sales region',
options: [
{id: '0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10', label: 'North', color: '#7C5CFC'},
{label: 'South', color: '#2BB673'}
]
})
};
fetch('https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}', 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}/location-attributes/{attributeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Region',
'description' => 'Sales region',
'options' => [
[
'id' => '0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10',
'label' => 'North',
'color' => '#7C5CFC'
],
[
'label' => 'South',
'color' => '#2BB673'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}"
payload := strings.NewReader("{\n \"name\": \"Region\",\n \"description\": \"Sales region\",\n \"options\": [\n {\n \"id\": \"0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10\",\n \"label\": \"North\",\n \"color\": \"#7C5CFC\"\n },\n {\n \"label\": \"South\",\n \"color\": \"#2BB673\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-client-key", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}")
.header("x-client-key", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Region\",\n \"description\": \"Sales region\",\n \"options\": [\n {\n \"id\": \"0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10\",\n \"label\": \"North\",\n \"color\": \"#7C5CFC\"\n },\n {\n \"label\": \"South\",\n \"color\": \"#2BB673\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-client-key"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Region\",\n \"description\": \"Sales region\",\n \"options\": [\n {\n \"id\": \"0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10\",\n \"label\": \"North\",\n \"color\": \"#7C5CFC\"\n },\n {\n \"label\": \"South\",\n \"color\": \"#2BB673\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "5d1e2f3a-1b2c-4d5e-8f90-a1b2c3d4e5f6",
"name": "Region",
"description": "Sales region",
"body": {
"type": "single_select",
"options": [
{
"id": "0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10",
"label": "North",
"color": "#7C5CFC"
},
{
"id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
"label": "South",
"color": "#2BB673"
}
]
},
"createdBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"createdAt": "2026-11-20T10:00:00.000Z"
},
"extra_meta": {
"message": "Attribute updated"
}
}{
"status": false,
"code": 401,
"error": {
"message": "Invalid client credentials"
}
}{
"error": {
"message": "You don't have permission \"Can manage locations\".",
"meta": {}
}
}{
"error": {
"message": "Location attribute 5d1e2f3a-1b2c-4d5e-8f90-a1b2c3d4e5f6 not found",
"meta": {}
}
}{
"error": {
"message": "Location attributes were modified concurrently; reload and retry.",
"meta": {}
}
}{
"error": {
"error": "ValidationError: \"name\" is required",
"message": "\"name\" is required",
"meta": {}
}
}Location Attributes
Update a Location Attribute
Updates one location attribute by its Xenia id.
Send your x-client-key and x-client-secret headers. To act as another member, add an optional x-client-user header with that user’s id. The request runs as the key’s user (or the x-client-user), so that user’s permissions apply. The user needs the Can manage locations permission.
How fields are applied
nameis required on every call.- Leave
descriptionout to keep it. Send""to clear it. - Leave
optionsout to keep the current options. - Sending
optionsreplaces the whole list. Include theidof every option you want to keep. An option without anidis created as a new option. - An existing option missing from the list is removed. Every location that had it selected loses that value. Sending
[]removes all options and clears the attribute’s values at every location. optionsonly applies tosingle_selectandmulti_selectattributes.- You can’t change an attribute’s type. Sending
typereturns422with"type" is not allowed.
PUT
/
api
/
v1
/
mgt
/
workspaces
/
{workspaceId}
/
location-attributes
/
{attributeId}
Update a Location Attribute
curl --request PUT \
--url https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId} \
--header 'Content-Type: application/json' \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"name": "Region",
"description": "Sales region",
"options": [
{
"id": "0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10",
"label": "North",
"color": "#7C5CFC"
},
{
"label": "South",
"color": "#2BB673"
}
]
}
'import requests
url = "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}"
payload = {
"name": "Region",
"description": "Sales region",
"options": [
{
"id": "0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10",
"label": "North",
"color": "#7C5CFC"
},
{
"label": "South",
"color": "#2BB673"
}
]
}
headers = {
"x-client-key": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-client-key': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Region',
description: 'Sales region',
options: [
{id: '0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10', label: 'North', color: '#7C5CFC'},
{label: 'South', color: '#2BB673'}
]
})
};
fetch('https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}', 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}/location-attributes/{attributeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Region',
'description' => 'Sales region',
'options' => [
[
'id' => '0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10',
'label' => 'North',
'color' => '#7C5CFC'
],
[
'label' => 'South',
'color' => '#2BB673'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}"
payload := strings.NewReader("{\n \"name\": \"Region\",\n \"description\": \"Sales region\",\n \"options\": [\n {\n \"id\": \"0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10\",\n \"label\": \"North\",\n \"color\": \"#7C5CFC\"\n },\n {\n \"label\": \"South\",\n \"color\": \"#2BB673\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-client-key", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}")
.header("x-client-key", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Region\",\n \"description\": \"Sales region\",\n \"options\": [\n {\n \"id\": \"0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10\",\n \"label\": \"North\",\n \"color\": \"#7C5CFC\"\n },\n {\n \"label\": \"South\",\n \"color\": \"#2BB673\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/location-attributes/{attributeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-client-key"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Region\",\n \"description\": \"Sales region\",\n \"options\": [\n {\n \"id\": \"0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10\",\n \"label\": \"North\",\n \"color\": \"#7C5CFC\"\n },\n {\n \"label\": \"South\",\n \"color\": \"#2BB673\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "5d1e2f3a-1b2c-4d5e-8f90-a1b2c3d4e5f6",
"name": "Region",
"description": "Sales region",
"body": {
"type": "single_select",
"options": [
{
"id": "0b6a3c1e-6a4f-4f1e-9a51-2a7d1c3e9f10",
"label": "North",
"color": "#7C5CFC"
},
{
"id": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
"label": "South",
"color": "#2BB673"
}
]
},
"createdBy": "dfea8b8a-5b22-4668-b68d-dc641eb3a101",
"createdAt": "2026-11-20T10:00:00.000Z"
},
"extra_meta": {
"message": "Attribute updated"
}
}{
"status": false,
"code": 401,
"error": {
"message": "Invalid client credentials"
}
}{
"error": {
"message": "You don't have permission \"Can manage locations\".",
"meta": {}
}
}{
"error": {
"message": "Location attribute 5d1e2f3a-1b2c-4d5e-8f90-a1b2c3d4e5f6 not found",
"meta": {}
}
}{
"error": {
"message": "Location attributes were modified concurrently; reload and retry.",
"meta": {}
}
}{
"error": {
"error": "ValidationError: \"name\" is required",
"message": "\"name\" is required",
"meta": {}
}
}Get the
attributeId from List Location Attributes. Use the id, not the externalId.Sending
options replaces the whole list. Any existing option you leave out is removed, and every location that had it selected loses that value. Leave options out to keep the current options.Body
application/json
Response
The updated attribute.