curl --request POST \
--url https://external.nectarclimate.com/v2.2/company \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": false,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"users": [
"jsmith@example.com"
]
}
'import requests
url = "https://external.nectarclimate.com/v2.2/company"
payload = {
"name": "<string>",
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": False,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": True,
"isBasicIdentifierMappingEnabled": True,
"isLowAccuracyModeEnabled": True,
"users": ["jsmith@example.com"]
}
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>',
dataCollectionStartDate: '2023-12-25',
isImpliedMeteringEnabled: false,
impliedMeteringFraction: '<string>',
isDemandEnabled: true,
isBasicIdentifierMappingEnabled: true,
isLowAccuracyModeEnabled: true,
users: ['jsmith@example.com']
})
};
fetch('https://external.nectarclimate.com/v2.2/company', 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/company",
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>',
'dataCollectionStartDate' => '2023-12-25',
'isImpliedMeteringEnabled' => false,
'impliedMeteringFraction' => '<string>',
'isDemandEnabled' => true,
'isBasicIdentifierMappingEnabled' => true,
'isLowAccuracyModeEnabled' => true,
'users' => [
'jsmith@example.com'
]
]),
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/company"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": false,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\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/company")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": false,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/company")
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 \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": false,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isImpliedMeteringEnabled": true,
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"sites": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"dataCollectionStopDate": "2023-12-25",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"occupancyApplicationMode": "DISABLED",
"dummySiteReason": "<string>"
}
],
"users": [
"<string>"
],
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"impliedMeteringFraction": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}Create Company
Create a new company in the system. The authenticated user will be set as the admin for the newly created company. Additional users can be added during creation via the users field, or added later via the patch request.
Note: Users invited through the API must already have a Nectar account. If you provide email addresses of users who don’t exist in the system, the request will fail with a 400 error.
Team Members: All members of your team will automatically be added to the new company as admins.
curl --request POST \
--url https://external.nectarclimate.com/v2.2/company \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": false,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"users": [
"jsmith@example.com"
]
}
'import requests
url = "https://external.nectarclimate.com/v2.2/company"
payload = {
"name": "<string>",
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": False,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": True,
"isBasicIdentifierMappingEnabled": True,
"isLowAccuracyModeEnabled": True,
"users": ["jsmith@example.com"]
}
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>',
dataCollectionStartDate: '2023-12-25',
isImpliedMeteringEnabled: false,
impliedMeteringFraction: '<string>',
isDemandEnabled: true,
isBasicIdentifierMappingEnabled: true,
isLowAccuracyModeEnabled: true,
users: ['jsmith@example.com']
})
};
fetch('https://external.nectarclimate.com/v2.2/company', 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/company",
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>',
'dataCollectionStartDate' => '2023-12-25',
'isImpliedMeteringEnabled' => false,
'impliedMeteringFraction' => '<string>',
'isDemandEnabled' => true,
'isBasicIdentifierMappingEnabled' => true,
'isLowAccuracyModeEnabled' => true,
'users' => [
'jsmith@example.com'
]
]),
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/company"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": false,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\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/company")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": false,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/company")
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 \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": false,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isImpliedMeteringEnabled": true,
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"sites": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"dataCollectionStopDate": "2023-12-25",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"occupancyApplicationMode": "DISABLED",
"dummySiteReason": "<string>"
}
],
"users": [
"<string>"
],
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"impliedMeteringFraction": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}Body
Serializer for creating a new Company object.
Fraction used to estimate sewer usage from water usage for implied metering. If a sewage charge is found in the data without water usage, this fraction is used to estimate the waste water usage that corresponds to the sewage charge. Defaults to 1.0.
^-?\d{0,1}(?:\.\d{0,2})?$Response
Serializer for externally available fields of a Company object including related sites.
Fraction used to estimate sewer usage from water usage for implied metering. If a sewage charge is found in the data without water usage, this fraction is used to estimate the waste water usage that corresponds to the sewage charge. Defaults to 1.0.
^-?\d{0,1}(?:\.\d{0,2})?$