curl --request POST \
--url https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"url": "<string>",
"initialSites": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"utilityTypes": [],
"connectionOwnerEmail": "jsmith@example.com",
"dataCollectionStartDate": "2023-12-25",
"expiresInSeconds": 2
}
'import requests
url = "https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link"
payload = {
"url": "<string>",
"initialSites": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"utilityTypes": [],
"connectionOwnerEmail": "jsmith@example.com",
"dataCollectionStartDate": "2023-12-25",
"expiresInSeconds": 2
}
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({
url: '<string>',
initialSites: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
utilityTypes: [],
connectionOwnerEmail: 'jsmith@example.com',
dataCollectionStartDate: '2023-12-25',
expiresInSeconds: 2
})
};
fetch('https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link', 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/connection/company/{company_id}/link",
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([
'url' => '<string>',
'initialSites' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'utilityTypes' => [
],
'connectionOwnerEmail' => 'jsmith@example.com',
'dataCollectionStartDate' => '2023-12-25',
'expiresInSeconds' => 2
]),
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/connection/company/{company_id}/link"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"initialSites\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"utilityTypes\": [],\n \"connectionOwnerEmail\": \"jsmith@example.com\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"expiresInSeconds\": 2\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/connection/company/{company_id}/link")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"initialSites\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"utilityTypes\": [],\n \"connectionOwnerEmail\": \"jsmith@example.com\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"expiresInSeconds\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link")
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 \"url\": \"<string>\",\n \"initialSites\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"utilityTypes\": [],\n \"connectionOwnerEmail\": \"jsmith@example.com\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"expiresInSeconds\": 2\n}"
response = http.request(request)
puts response.read_body{
"companyMagicLinkSecret": "<string>",
"publicCompanyId": "<string>",
"magicLinkUrl": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}Create Magic Link with Prefilled Data for Creating a Utility Account Connection
Deprecated: Use POST /invitation/company/{company_id} with the prefill field instead. This endpoint will be removed in a future API version.
Generates a Nectar signed secret for a specific company with optional prefilled data. This endpoint allows you to optionally pre-populate fields in the connection form. Also allows you to optionally set an expiration time for the magic link.
curl --request POST \
--url https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"url": "<string>",
"initialSites": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"utilityTypes": [],
"connectionOwnerEmail": "jsmith@example.com",
"dataCollectionStartDate": "2023-12-25",
"expiresInSeconds": 2
}
'import requests
url = "https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link"
payload = {
"url": "<string>",
"initialSites": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"utilityTypes": [],
"connectionOwnerEmail": "jsmith@example.com",
"dataCollectionStartDate": "2023-12-25",
"expiresInSeconds": 2
}
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({
url: '<string>',
initialSites: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
utilityTypes: [],
connectionOwnerEmail: 'jsmith@example.com',
dataCollectionStartDate: '2023-12-25',
expiresInSeconds: 2
})
};
fetch('https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link', 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/connection/company/{company_id}/link",
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([
'url' => '<string>',
'initialSites' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'utilityTypes' => [
],
'connectionOwnerEmail' => 'jsmith@example.com',
'dataCollectionStartDate' => '2023-12-25',
'expiresInSeconds' => 2
]),
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/connection/company/{company_id}/link"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"initialSites\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"utilityTypes\": [],\n \"connectionOwnerEmail\": \"jsmith@example.com\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"expiresInSeconds\": 2\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/connection/company/{company_id}/link")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"initialSites\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"utilityTypes\": [],\n \"connectionOwnerEmail\": \"jsmith@example.com\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"expiresInSeconds\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/connection/company/{company_id}/link")
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 \"url\": \"<string>\",\n \"initialSites\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"utilityTypes\": [],\n \"connectionOwnerEmail\": \"jsmith@example.com\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"expiresInSeconds\": 2\n}"
response = http.request(request)
puts response.read_body{
"companyMagicLinkSecret": "<string>",
"publicCompanyId": "<string>",
"magicLinkUrl": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}Authorizations
Path Parameters
Private ID of the company for which to generate the magic link.
Body
Serializer for creating a company-level magic link with optional prefill data and expiration.
Web address of the utility company's website to pre-populate in the connection form.
5000List of site UUIDs to pre-populate in the connection form.
List of utility types to pre-populate in the connection form (e.g., ELECTRICITY, GAS, WATER).
ELECTRICITY- ElectricityGAS- GasWATER- WaterSEWER- SewerDISTRICT- DistrictWASTE- WasteFUEL- FuelMISC- MiscREFRIGERANT- RefrigerantSOLAR- SolarTELECOM- Telecom
ELECTRICITY, GAS, WATER, SEWER, DISTRICT, WASTE, FUEL, MISC, REFRIGERANT, SOLAR, TELECOM Country of the utility company to pre-populate in the connection form.
AF- AfAL- AlDZ- DzAS- AsAD- AdAO- AoAI- AiAQ- AqAG- AgAR- ArAM- AmAW- AwAU- AuAT- AtAZ- AzBS- BsBH- BhBD- BdBB- BbBY- ByBE- BeBZ- BzBJ- BjBM- BmBT- BtBO- BoBQ- BqBA- BaBW- BwBV- BvBR- BrIO- IoBN- BnBG- BgBF- BfBI- BiKH- KhCM- CmCA- CaCV- CvKY- KyCF- CfTD- TdCL- ClCN- CnCX- CxCC- CcCO- CoKM- KmCG- CgCD- CdCK- CkCR- CrHR- HrCU- CuCW- CwCY- CyCZ- CzCI- CiDK- DkDJ- DjDM- DmDO- DoEC- EcEG- EgSV- SvGQ- GqER- ErEE- EeET- EtFK- FkFO- FoFJ- FjFI- FiFR- FrGF- GfPF- PfTF- TfGA- GaGM- GmGE- GeDE- DeGH- GhGI- GiGR- GrGL- GlGD- GdGP- GpGU- GuGT- GtGG- GgGN- GnGW- GwGY- GyHT- HtHM- HmVA- VaHN- HnHK- HkHU- HuIS- IsIN- InID- IdIR- IrIQ- IqIE- IeIM- ImIL- IlIT- ItJM- JmJP- JpJE- JeJO- JoKZ- KzKE- KeKI- KiKP- KpKR- KrKW- KwKG- KgLA- LaLV- LvLB- LbLS- LsLR- LrLY- LyLI- LiLT- LtLU- LuMO- MoMK- MkMG- MgMW- MwMY- MyMV- MvML- MlMT- MtMH- MhMQ- MqMR- MrMU- MuYT- YtMX- MxFM- FmMD- MdMC- McMN- MnME- MeMS- MsMA- MaMZ- MzMM- MmNA- NaNR- NrNP- NpNL- NlNC- NcNZ- NzNI- NiNE- NeNG- NgNU- NuNF- NfMP- MpNO- NoOM- OmPK- PkPW- PwPS- PsPA- PaPG- PgPY- PyPE- PePH- PhPN- PnPL- PlPT- PtPR- PrQA- QaRO- RoRU- RuRW- RwRE- ReBL- BlSH- ShKN- KnLC- LcMF- MfPM- PmVC- VcWS- WsSM- SmST- StSA- SaSN- SnRS- RsSC- ScSL- SlSG- SgSX- SxSK- SkSI- SiSB- SbSO- SoZA- ZaGS- GsSS- SsES- EsLK- LkSD- SdSR- SrSJ- SjSZ- SzSE- SeCH- ChSY- SyTW- TwTJ- TjTZ- TzTH- ThTL- TlTG- TgTK- TkTO- ToTT- TtTN- TnTR- TrTM- TmTC- TcTV- TvUG- UgUA- UaAE- AeGB- GbUS- UsUM- UmUY- UyUZ- UzVU- VuVE- VeVN- VnVG- VgVI- ViWF- WfEH- EhYE- YeZM- ZmZW- ZwAX- Ax
AF, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, HR, CU, CW, CY, CZ, CI, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RO, RU, RW, RE, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, AX Email address of the connection owner to pre-populate in the connection form.
1Start date for data collection to pre-populate in the connection form.
Number of seconds until the magic link expires. If not provided, the link will not expire.
x >= 1Response
Deprecated — use the invitation endpoints instead. Response body for company magic link creation.
Deprecated — use the invitation system instead. Secret key used for magic link validation for company-level magic links.
Deprecated — use the invitation system instead. Public ID of the company used in magic link URLs.
Deprecated — use invitationUrl from the invitation endpoints instead. URL to magic link for creating the connection.