Locations
Edit Location
Updates an existing location. Only include fields you want to change.
PATCH
/
locations
/
{id}
Edit Location
curl --request PATCH \
--url https://api.roostedhr.com/api/1_12/locations/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"location": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"color": "<string>",
"location_comments": "<string>",
"timezone_id": 123,
"default_clients_id": "<string>",
"default_areas": [
"<string>"
]
}
'import requests
url = "https://api.roostedhr.com/api/1_12/locations/{id}"
payload = {
"location": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"color": "<string>",
"location_comments": "<string>",
"timezone_id": 123,
"default_clients_id": "<string>",
"default_areas": ["<string>"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
location: '<string>',
address: '<string>',
city: '<string>',
zip: '<string>',
color: '<string>',
location_comments: '<string>',
timezone_id: 123,
default_clients_id: '<string>',
default_areas: ['<string>']
})
};
fetch('https://api.roostedhr.com/api/1_12/locations/{id}', 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.roostedhr.com/api/1_12/locations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'location' => '<string>',
'address' => '<string>',
'city' => '<string>',
'zip' => '<string>',
'color' => '<string>',
'location_comments' => '<string>',
'timezone_id' => 123,
'default_clients_id' => '<string>',
'default_areas' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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.roostedhr.com/api/1_12/locations/{id}"
payload := strings.NewReader("{\n \"location\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"color\": \"<string>\",\n \"location_comments\": \"<string>\",\n \"timezone_id\": 123,\n \"default_clients_id\": \"<string>\",\n \"default_areas\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<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.patch("https://api.roostedhr.com/api/1_12/locations/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"location\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"color\": \"<string>\",\n \"location_comments\": \"<string>\",\n \"timezone_id\": 123,\n \"default_clients_id\": \"<string>\",\n \"default_areas\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/locations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"location\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"color\": \"<string>\",\n \"location_comments\": \"<string>\",\n \"timezone_id\": 123,\n \"default_clients_id\": \"<string>\",\n \"default_areas\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"location": "<string>",
"addy_street_number": "<string>",
"addy_city": "<string>",
"addy_zip": "<string>",
"location_comments": "<string>",
"default": 0,
"saved": 0,
"color": "#DC136C",
"timezone": {
"id": 123,
"name": "<string>",
"offset": "<string>"
},
"companies_payroll_rulesets_id": "<string>",
"payroll_rule_display": "<string>",
"latitude": "<string>",
"longitude": "<string>",
"default_clients_id": "<string>",
"default_areas": [
"<string>"
]
}This is a partial update endpoint — only include the fields you want to change. Omitted fields remain unchanged.
Authorizations
Path Parameters
Location ID
Body
application/json
Fields to update
Location name
Maximum string length:
150Street address
Maximum string length:
150City
Maximum string length:
75ZIP/postal code
Maximum string length:
10Hex color code
Maximum string length:
7Additional comments
Maximum string length:
65535Timezone identifier
Required range:
x <= 999Default client hashed ID
Maximum string length:
5Default area IDs
Response
OK
Location identifier
Location name
Street address
City
ZIP/postal code
Additional comments
Whether this is the default location (0 or 1)
Required range:
0 <= x <= 1Whether the location is saved (0 or 1)
Required range:
0 <= x <= 1Hex color code
Example:
"#DC136C"
Location timezone
Show child attributes
Show child attributes
Associated payroll ruleset ID
Payroll rule display name
GPS latitude coordinate
GPS longitude coordinate
Default client hashed ID
Default area IDs
⌘I
Edit Location
curl --request PATCH \
--url https://api.roostedhr.com/api/1_12/locations/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"location": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"color": "<string>",
"location_comments": "<string>",
"timezone_id": 123,
"default_clients_id": "<string>",
"default_areas": [
"<string>"
]
}
'import requests
url = "https://api.roostedhr.com/api/1_12/locations/{id}"
payload = {
"location": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"color": "<string>",
"location_comments": "<string>",
"timezone_id": 123,
"default_clients_id": "<string>",
"default_areas": ["<string>"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
location: '<string>',
address: '<string>',
city: '<string>',
zip: '<string>',
color: '<string>',
location_comments: '<string>',
timezone_id: 123,
default_clients_id: '<string>',
default_areas: ['<string>']
})
};
fetch('https://api.roostedhr.com/api/1_12/locations/{id}', 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.roostedhr.com/api/1_12/locations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'location' => '<string>',
'address' => '<string>',
'city' => '<string>',
'zip' => '<string>',
'color' => '<string>',
'location_comments' => '<string>',
'timezone_id' => 123,
'default_clients_id' => '<string>',
'default_areas' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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.roostedhr.com/api/1_12/locations/{id}"
payload := strings.NewReader("{\n \"location\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"color\": \"<string>\",\n \"location_comments\": \"<string>\",\n \"timezone_id\": 123,\n \"default_clients_id\": \"<string>\",\n \"default_areas\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<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.patch("https://api.roostedhr.com/api/1_12/locations/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"location\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"color\": \"<string>\",\n \"location_comments\": \"<string>\",\n \"timezone_id\": 123,\n \"default_clients_id\": \"<string>\",\n \"default_areas\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/locations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"location\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"color\": \"<string>\",\n \"location_comments\": \"<string>\",\n \"timezone_id\": 123,\n \"default_clients_id\": \"<string>\",\n \"default_areas\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"location": "<string>",
"addy_street_number": "<string>",
"addy_city": "<string>",
"addy_zip": "<string>",
"location_comments": "<string>",
"default": 0,
"saved": 0,
"color": "#DC136C",
"timezone": {
"id": 123,
"name": "<string>",
"offset": "<string>"
},
"companies_payroll_rulesets_id": "<string>",
"payroll_rule_display": "<string>",
"latitude": "<string>",
"longitude": "<string>",
"default_clients_id": "<string>",
"default_areas": [
"<string>"
]
}