How it works
- You call the Nectar API to generate a magic link containing a
publicIdand acompanyMagicLinkSecret. - You construct a URL from those two values and display it to your user — either as a direct link or embedded in an iframe.
- The user connects their utility account through Nectar’s secure interface, which mirrors the utility provider’s login flow.
- Nectar maintains secure access to the session to continuously download historical and new data.
publicId is exposed — meaning the link is safe to display to unauthenticated end users.
Create a new connection magic link
Generate the magic link
Call the create magic link endpoint for the target company. The response contains
publicId and companyMagicLinkSecret.Construct the URL
Build the magic link URL from the response values:
| Parameter | Description |
|---|---|
publicId | Public ID of the company (not the same as the company id field) |
companyMagicLinkSecret | Encrypted string containing company and site information, signed with a 128-bit AES key |
The
/p/ prefix indicates this is a public (unauthenticated) page. Old URLs using /create-datasource/magic-link/ are automatically redirected.Update an existing connection
To let users edit credentials, reauthenticate, or change which sites are associated with an existing connection, generate an edit magic link.Generate the edit magic link
Call the update magic link endpoint for the existing connection. The response contains
publicCompanyId and connectionMagicLinkSecret.Construct the edit URL
The edit URL uses the
/workflow/ path segment and the connection-specific secret:| Parameter | Description |
|---|---|
publicCompanyId | Public ID of the company |
connectionMagicLinkSecret | Encrypted string specific to this connection (different from companyMagicLinkSecret) |
Prefilling data
You can pre-populate information in the magic link form — including the utility provider URL, data collection start date, and sites — by passing additional fields when generating the magic link. This data is encoded in thecompanyMagicLinkSecret, keeping it secure.
See the create magic link endpoint in the API Reference for the full list of prefill parameters.
Customization
Nectar supports white-label branding of the magic link iframe, including custom fonts, colors, and language localization. See the White-label documentation or contact [email protected] for setup details.Security
The magic link secret uses 128-bit AES encryption. Only the company’spublicId is exposed in the URL — no internal IDs, credentials, or sensitive data are transmitted in plaintext. This design allows the magic link to be safely displayed to end users who are not authenticated on your platform.