Update a location
curl --request PATCH \
--url https://api.plane.com/v1/locations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"address": {
"address.line1": "<string>",
"address.line2": "<string>",
"address.city": "<string>",
"address.state": "<string>",
"address.postal_code": "<string>",
"address.country": "<string>"
}
}
'import requests
url = "https://api.plane.com/v1/locations/{id}"
payload = {
"name": "<string>",
"address": {
"address.line1": "<string>",
"address.line2": "<string>",
"address.city": "<string>",
"address.state": "<string>",
"address.postal_code": "<string>",
"address.country": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
address: {
'address.line1': '<string>',
'address.line2': '<string>',
'address.city': '<string>',
'address.state': '<string>',
'address.postal_code': '<string>',
'address.country': '<string>'
}
})
};
fetch('https://api.plane.com/v1/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.plane.com/v1/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([
'name' => '<string>',
'address' => [
'address.line1' => '<string>',
'address.line2' => '<string>',
'address.city' => '<string>',
'address.state' => '<string>',
'address.postal_code' => '<string>',
'address.country' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.plane.com/v1/locations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"address\": {\n \"address.line1\": \"<string>\",\n \"address.line2\": \"<string>\",\n \"address.city\": \"<string>\",\n \"address.state\": \"<string>\",\n \"address.postal_code\": \"<string>\",\n \"address.country\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.plane.com/v1/locations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"address\": {\n \"address.line1\": \"<string>\",\n \"address.line2\": \"<string>\",\n \"address.city\": \"<string>\",\n \"address.state\": \"<string>\",\n \"address.postal_code\": \"<string>\",\n \"address.country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plane.com/v1/locations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"address\": {\n \"address.line1\": \"<string>\",\n \"address.line2\": \"<string>\",\n \"address.city\": \"<string>\",\n \"address.state\": \"<string>\",\n \"address.postal_code\": \"<string>\",\n \"address.country\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "loc_cNqYX2J3s9bI2Aa",
"name": "SF Headquarters",
"address": {
"line1": "123 Main Street",
"line2": null,
"city": "Oakland",
"state": "CA",
"postal_code": "94612",
"country": "US"
},
"created": "2024-01-15T00:00:00Z",
"updated": "2024-02-10T00:00:00Z"
}
Locations
Update a location
Update the name and/or address of an existing work location.
PATCH
/
v1
/
locations
/
{id}
Update a location
curl --request PATCH \
--url https://api.plane.com/v1/locations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"address": {
"address.line1": "<string>",
"address.line2": "<string>",
"address.city": "<string>",
"address.state": "<string>",
"address.postal_code": "<string>",
"address.country": "<string>"
}
}
'import requests
url = "https://api.plane.com/v1/locations/{id}"
payload = {
"name": "<string>",
"address": {
"address.line1": "<string>",
"address.line2": "<string>",
"address.city": "<string>",
"address.state": "<string>",
"address.postal_code": "<string>",
"address.country": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
address: {
'address.line1': '<string>',
'address.line2': '<string>',
'address.city': '<string>',
'address.state': '<string>',
'address.postal_code': '<string>',
'address.country': '<string>'
}
})
};
fetch('https://api.plane.com/v1/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.plane.com/v1/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([
'name' => '<string>',
'address' => [
'address.line1' => '<string>',
'address.line2' => '<string>',
'address.city' => '<string>',
'address.state' => '<string>',
'address.postal_code' => '<string>',
'address.country' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.plane.com/v1/locations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"address\": {\n \"address.line1\": \"<string>\",\n \"address.line2\": \"<string>\",\n \"address.city\": \"<string>\",\n \"address.state\": \"<string>\",\n \"address.postal_code\": \"<string>\",\n \"address.country\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.plane.com/v1/locations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"address\": {\n \"address.line1\": \"<string>\",\n \"address.line2\": \"<string>\",\n \"address.city\": \"<string>\",\n \"address.state\": \"<string>\",\n \"address.postal_code\": \"<string>\",\n \"address.country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plane.com/v1/locations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"address\": {\n \"address.line1\": \"<string>\",\n \"address.line2\": \"<string>\",\n \"address.city\": \"<string>\",\n \"address.state\": \"<string>\",\n \"address.postal_code\": \"<string>\",\n \"address.country\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "loc_cNqYX2J3s9bI2Aa",
"name": "SF Headquarters",
"address": {
"line1": "123 Main Street",
"line2": null,
"city": "Oakland",
"state": "CA",
"postal_code": "94612",
"country": "US"
},
"created": "2024-01-15T00:00:00Z",
"updated": "2024-02-10T00:00:00Z"
}
Use this endpoint when a work location has been renamed or its address details
have changed.
Parameters
The ID of the location to update.
New display name for the location.
Address fields to update. Plane merges the provided fields onto the existing
address.
Show child attributes
Show child attributes
Address line1 (e.g. street, PO Box, or company name).
Address line2 (e.g. apartment, suite, unit or building). Pass
null to clear it.City, district, suburb, town, or village.
State, county, province, or region.
ZIP or postal code.
Two-letter country code (ISO 3166-1 alpha-2).
Returns
Returns the updated Location object.{
"id": "loc_cNqYX2J3s9bI2Aa",
"name": "SF Headquarters",
"address": {
"line1": "123 Main Street",
"line2": null,
"city": "Oakland",
"state": "CA",
"postal_code": "94612",
"country": "US"
},
"created": "2024-01-15T00:00:00Z",
"updated": "2024-02-10T00:00:00Z"
}
Was this page helpful?
⌘I