Update Comp Set
curl --request PATCH \
--url https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "{account_id}"
}
'import requests
url = "https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}"
payload = { "account_id": "{account_id}" }
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({account_id: '{account_id}'})
};
fetch('https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_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://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_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([
'account_id' => '{account_id}'
]),
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://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}"
payload := strings.NewReader("{\n \"account_id\": \"{account_id}\"\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://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{account_id}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_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 \"account_id\": \"{account_id}\"\n}"
response = http.request(request)
puts response.read_body{
"id": 52310,
"name": "Marina Landing - Q4",
"category": "market_survey",
"account_id": 1042,
"active": true,
"min_floorplan": 0,
"max_floorplan": 2,
"target_comp_count": 12,
"subject_property": {
"id": 781245,
"custom": false,
"property_name": "Marina Landing",
"address": "401 Riverfront Dr, Austin, TX 78701"
},
"comps": [
{
"property_id": 781266,
"property_name": "Marina Heights",
"score": 0.82
},
{
"property_id": 781301,
"property_name": "Riverside Commons",
"score": 0.74
}
],
"app_url": "https://app.apartmentiq.io/accounts/1042/market-surveys/52310"
}Market Surveys
Update Comp Set
Update a comp set’s name, floorplan range, or target comp count. Send only the fields you want to change.
target_comp_countincludes the subject property. Changing it does not add or remove comps right away, but later automatic top-ups, such as reactivating a market survey, fill to it.- The change is recorded in the comp set’s history under the API token’s user.
PATCH
/
comp_sets
/
{comp_set_id}
Update Comp Set
curl --request PATCH \
--url https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "{account_id}"
}
'import requests
url = "https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}"
payload = { "account_id": "{account_id}" }
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({account_id: '{account_id}'})
};
fetch('https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_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://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_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([
'account_id' => '{account_id}'
]),
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://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}"
payload := strings.NewReader("{\n \"account_id\": \"{account_id}\"\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://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{account_id}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_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 \"account_id\": \"{account_id}\"\n}"
response = http.request(request)
puts response.read_body{
"id": 52310,
"name": "Marina Landing - Q4",
"category": "market_survey",
"account_id": 1042,
"active": true,
"min_floorplan": 0,
"max_floorplan": 2,
"target_comp_count": 12,
"subject_property": {
"id": 781245,
"custom": false,
"property_name": "Marina Landing",
"address": "401 Riverfront Dr, Austin, TX 78701"
},
"comps": [
{
"property_id": 781266,
"property_name": "Marina Heights",
"score": 0.82
},
{
"property_id": 781301,
"property_name": "Riverside Commons",
"score": 0.74
}
],
"app_url": "https://app.apartmentiq.io/accounts/1042/market-surveys/52310"
}Authorizations
Body
application/json
Request contract for updating comp set settings. Send at least one field besides account_id. Integer fields also accept integer strings.
Response
The comp set was updated.
A market survey or research report.