curl --request POST \
--url https://external.nectarclimate.com/v2.2/site/company/{company_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"dummySiteReason": "<string>"
}
'import requests
url = "https://external.nectarclimate.com/v2.2/site/company/{company_id}"
payload = {
"name": "<string>",
"externalId": "<string>",
"address": "<string>",
"path": ["<string>"],
"occupancyPercent": "<string>",
"dummySiteReason": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
externalId: '<string>',
address: '<string>',
path: ['<string>'],
occupancyPercent: '<string>',
dummySiteReason: '<string>'
})
};
fetch('https://external.nectarclimate.com/v2.2/site/company/{company_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://external.nectarclimate.com/v2.2/site/company/{company_id}",
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([
'name' => '<string>',
'externalId' => '<string>',
'address' => '<string>',
'path' => [
'<string>'
],
'occupancyPercent' => '<string>',
'dummySiteReason' => '<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://external.nectarclimate.com/v2.2/site/company/{company_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"path\": [\n \"<string>\"\n ],\n \"occupancyPercent\": \"<string>\",\n \"dummySiteReason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://external.nectarclimate.com/v2.2/site/company/{company_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"path\": [\n \"<string>\"\n ],\n \"occupancyPercent\": \"<string>\",\n \"dummySiteReason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/site/company/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"path\": [\n \"<string>\"\n ],\n \"occupancyPercent\": \"<string>\",\n \"dummySiteReason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"dataCollectionStopDate": "2023-12-25",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"occupancyApplicationMode": "DISABLED",
"dummySiteReason": "<string>"
}{
"detail": "<string>"
}Create Site
Create a new site for a specified company. Regular sites require a street address. To create a placeholder without an address, set dummySiteReason to a non-empty string describing why (for example API testing or a catch-all).
curl --request POST \
--url https://external.nectarclimate.com/v2.2/site/company/{company_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"dummySiteReason": "<string>"
}
'import requests
url = "https://external.nectarclimate.com/v2.2/site/company/{company_id}"
payload = {
"name": "<string>",
"externalId": "<string>",
"address": "<string>",
"path": ["<string>"],
"occupancyPercent": "<string>",
"dummySiteReason": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
externalId: '<string>',
address: '<string>',
path: ['<string>'],
occupancyPercent: '<string>',
dummySiteReason: '<string>'
})
};
fetch('https://external.nectarclimate.com/v2.2/site/company/{company_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://external.nectarclimate.com/v2.2/site/company/{company_id}",
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([
'name' => '<string>',
'externalId' => '<string>',
'address' => '<string>',
'path' => [
'<string>'
],
'occupancyPercent' => '<string>',
'dummySiteReason' => '<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://external.nectarclimate.com/v2.2/site/company/{company_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"path\": [\n \"<string>\"\n ],\n \"occupancyPercent\": \"<string>\",\n \"dummySiteReason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://external.nectarclimate.com/v2.2/site/company/{company_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"path\": [\n \"<string>\"\n ],\n \"occupancyPercent\": \"<string>\",\n \"dummySiteReason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/site/company/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"address\": \"<string>\",\n \"path\": [\n \"<string>\"\n ],\n \"occupancyPercent\": \"<string>\",\n \"dummySiteReason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"dataCollectionStopDate": "2023-12-25",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"occupancyApplicationMode": "DISABLED",
"dummySiteReason": "<string>"
}{
"detail": "<string>"
}Authorizations
Path Parameters
ID of the company to create a site for.
Body
Fields for creating a site.
Regular sites require a street address; set dummySiteReason to create a placeholder without one.
Name of the site.
1 - 255ID of the site on external platforms used during exports. Used to associate site in Nectar with site within your database.
Address of the site.
255List of location tags in increasing specificity used to filter sites. Filters must be entered from more general to more specific. E.g. ['US', 'CA', 'ON']
101 - 100Occupancy percent, must be a number from 0 to 100. Usage for the site will be multiplied by this value for specified accounts.
^-?\d{0,3}(?:\.\d{0,4})?$Controls how occupancy percent is applied to usage data. ALL applies to all data on this site regardless of account settings. PER_ACCOUNT applies only to accounts with the occupancy override enabled. DISABLED means occupancy is never applied regardless of account settings. PER_CONNECTION is a deprecated alias for PER_ACCOUNT; reads still return it and writes still accept it.
DISABLED- DisabledALL- AllPER_ACCOUNT- Per AccountPER_CONNECTION- Per Connection (deprecated alias for Per Account)
DISABLED, ALL, PER_ACCOUNT, PER_CONNECTION If set, this site is a placeholder and a street address is not required. The value describes why (for example API testing, a catch-all, or a multi-address bundle). Omit or null for a regular site. Clearing it on update requires a confirmed street address.
Response
A site: a physical location, or a placeholder when dummySiteReason is set.
Unique identifier for the site.
Name of the site.
255Date when data collection for this site was stopped. A non-null value indicates the site has been soft-deleted/archived.
ID of the site on external platforms used during exports. Used to associate site in Nectar with site within your database.
Address of the site.
255List of location tags in increasing specificity used to filter sites. Filters must be entered from more general to more specific. E.g. ['US', 'CA', 'ON']
10100Occupancy percent, must be a number from 0 to 100. Usage for the site will be multiplied by this value for specified accounts.
^-?\d{0,3}(?:\.\d{0,4})?$Controls how occupancy percent is applied to usage data. ALL applies to all data on this site regardless of account settings. PER_ACCOUNT applies only to accounts with the occupancy override enabled. DISABLED means occupancy is never applied regardless of account settings. PER_CONNECTION is a deprecated alias for PER_ACCOUNT; reads still return it and writes still accept it.
DISABLED- DisabledALL- AllPER_ACCOUNT- Per AccountPER_CONNECTION- Per Connection (deprecated alias for Per Account)
DISABLED, ALL, PER_ACCOUNT, PER_CONNECTION If set, this site is a placeholder and a street address is not required. The value describes why (for example API testing, a catch-all, or a multi-address bundle). Omit or null for a regular site. Clearing it on update requires a confirmed street address.