Update Office
Updates an existing office under the caller’s team. Caller must have permission to manage team organization.
curl --request POST \
--url https://api.lofty.com/v1.0/org/office \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"id": 563172647619608,
"parentId": 563172647619608,
"name": "Downtown Branch",
"phone": "4155551234",
"phoneCode": "1",
"phoneCountry": "US",
"email": "downtown@lofty.com",
"city": "San Francisco",
"state": "CA",
"zipcode": "94103",
"streetAddress": "456 Mission St",
"allowManageSub": true
}
'import requests
url = "https://api.lofty.com/v1.0/org/office"
payload = {
"id": 563172647619608,
"parentId": 563172647619608,
"name": "Downtown Branch",
"phone": "4155551234",
"phoneCode": "1",
"phoneCountry": "US",
"email": "downtown@lofty.com",
"city": "San Francisco",
"state": "CA",
"zipcode": "94103",
"streetAddress": "456 Mission St",
"allowManageSub": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
id: 563172647619608,
parentId: 563172647619608,
name: 'Downtown Branch',
phone: '4155551234',
phoneCode: '1',
phoneCountry: 'US',
email: 'downtown@lofty.com',
city: 'San Francisco',
state: 'CA',
zipcode: '94103',
streetAddress: '456 Mission St',
allowManageSub: true
})
};
fetch('https://api.lofty.com/v1.0/org/office', 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.lofty.com/v1.0/org/office",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 563172647619608,
'parentId' => 563172647619608,
'name' => 'Downtown Branch',
'phone' => '4155551234',
'phoneCode' => '1',
'phoneCountry' => 'US',
'email' => 'downtown@lofty.com',
'city' => 'San Francisco',
'state' => 'CA',
'zipcode' => '94103',
'streetAddress' => '456 Mission St',
'allowManageSub' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v1.0/org/office"
payload := strings.NewReader("{\n \"id\": 563172647619608,\n \"parentId\": 563172647619608,\n \"name\": \"Downtown Branch\",\n \"phone\": \"4155551234\",\n \"phoneCode\": \"1\",\n \"phoneCountry\": \"US\",\n \"email\": \"downtown@lofty.com\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipcode\": \"94103\",\n \"streetAddress\": \"456 Mission St\",\n \"allowManageSub\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lofty.com/v1.0/org/office")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"id\": 563172647619608,\n \"parentId\": 563172647619608,\n \"name\": \"Downtown Branch\",\n \"phone\": \"4155551234\",\n \"phoneCode\": \"1\",\n \"phoneCountry\": \"US\",\n \"email\": \"downtown@lofty.com\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipcode\": \"94103\",\n \"streetAddress\": \"456 Mission St\",\n \"allowManageSub\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/org/office")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"id\": 563172647619608,\n \"parentId\": 563172647619608,\n \"name\": \"Downtown Branch\",\n \"phone\": \"4155551234\",\n \"phoneCode\": \"1\",\n \"phoneCountry\": \"US\",\n \"email\": \"downtown@lofty.com\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipcode\": \"94103\",\n \"streetAddress\": \"456 Mission St\",\n \"allowManageSub\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {}
}"<string>""<string>""<string>""<string>"Body
Office payload. id is required to identify the office to update.
Office ID. Required on update (POST /v1.0/org/office); ignored on create.
563172647619608
Parent office ID. Use 0 or null when creating a top-level office under the team.
563172647619608
Office name.
"Downtown Branch"
Office phone number, digits only.
"4155551234"
Phone country calling code without the leading +.
"1"
ISO 3166-1 alpha-2 country code for the phone.
"US"
Office contact email.
"downtown@lofty.com"
City.
"San Francisco"
State or province.
"CA"
Postal / ZIP code.
"94103"
Street address line.
"456 Mission St"
Whether members of this office can manage its sub-offices.
true
Response
Envelope with business code and message.
Response envelope for POST /v1.0/org/company, PUT /v1.0/org/office and POST /v1.0/org/office. Carries a business code and message; data may be absent on pure acknowledgement responses.
curl --request POST \
--url https://api.lofty.com/v1.0/org/office \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"id": 563172647619608,
"parentId": 563172647619608,
"name": "Downtown Branch",
"phone": "4155551234",
"phoneCode": "1",
"phoneCountry": "US",
"email": "downtown@lofty.com",
"city": "San Francisco",
"state": "CA",
"zipcode": "94103",
"streetAddress": "456 Mission St",
"allowManageSub": true
}
'import requests
url = "https://api.lofty.com/v1.0/org/office"
payload = {
"id": 563172647619608,
"parentId": 563172647619608,
"name": "Downtown Branch",
"phone": "4155551234",
"phoneCode": "1",
"phoneCountry": "US",
"email": "downtown@lofty.com",
"city": "San Francisco",
"state": "CA",
"zipcode": "94103",
"streetAddress": "456 Mission St",
"allowManageSub": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
id: 563172647619608,
parentId: 563172647619608,
name: 'Downtown Branch',
phone: '4155551234',
phoneCode: '1',
phoneCountry: 'US',
email: 'downtown@lofty.com',
city: 'San Francisco',
state: 'CA',
zipcode: '94103',
streetAddress: '456 Mission St',
allowManageSub: true
})
};
fetch('https://api.lofty.com/v1.0/org/office', 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.lofty.com/v1.0/org/office",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 563172647619608,
'parentId' => 563172647619608,
'name' => 'Downtown Branch',
'phone' => '4155551234',
'phoneCode' => '1',
'phoneCountry' => 'US',
'email' => 'downtown@lofty.com',
'city' => 'San Francisco',
'state' => 'CA',
'zipcode' => '94103',
'streetAddress' => '456 Mission St',
'allowManageSub' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v1.0/org/office"
payload := strings.NewReader("{\n \"id\": 563172647619608,\n \"parentId\": 563172647619608,\n \"name\": \"Downtown Branch\",\n \"phone\": \"4155551234\",\n \"phoneCode\": \"1\",\n \"phoneCountry\": \"US\",\n \"email\": \"downtown@lofty.com\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipcode\": \"94103\",\n \"streetAddress\": \"456 Mission St\",\n \"allowManageSub\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lofty.com/v1.0/org/office")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"id\": 563172647619608,\n \"parentId\": 563172647619608,\n \"name\": \"Downtown Branch\",\n \"phone\": \"4155551234\",\n \"phoneCode\": \"1\",\n \"phoneCountry\": \"US\",\n \"email\": \"downtown@lofty.com\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipcode\": \"94103\",\n \"streetAddress\": \"456 Mission St\",\n \"allowManageSub\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/org/office")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"id\": 563172647619608,\n \"parentId\": 563172647619608,\n \"name\": \"Downtown Branch\",\n \"phone\": \"4155551234\",\n \"phoneCode\": \"1\",\n \"phoneCountry\": \"US\",\n \"email\": \"downtown@lofty.com\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipcode\": \"94103\",\n \"streetAddress\": \"456 Mission St\",\n \"allowManageSub\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {}
}"<string>""<string>""<string>""<string>"