> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nectarclimate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /api-reference/openapi-v2-2.json post /connection/company/{company_id}/link
openapi: 3.1.0
info:
  title: Nectar API Documentation
  version: 1.0.0 (v1)
  description: >-
    Complete API documentation for v2.2 endpoints to managing companies, sites,
    data, and documents
servers:
  - url: https://external.nectarclimate.com/v2.2
    description: Nectar API Server
security: []
paths:
  /connection/company/{company_id}/link:
    post:
      tags:
        - Connections
      summary: >-
        Create Magic Link with Prefilled Data for Creating a Utility Account
        Connection
      description: >-
        **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.
      operationId: connection_company_link_create
      parameters:
        - in: path
          name: company_id
          schema:
            type: string
            format: uuid
          description: Private ID of the company for which to generate the magic link.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyMagicLinkCreateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CompanyMagicLinkCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CompanyMagicLinkCreateRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMagicLink'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '403':
          description: 'Forbidden: Access to the company is denied.'
      deprecated: true
      security:
        - ExternalAuthentication: []
components:
  schemas:
    CompanyMagicLinkCreateRequest:
      type: object
      description: >-
        Serializer for creating a company-level magic link with optional prefill
        data and expiration.
      properties:
        url:
          type: string
          format: uri
          description: >-
            Web address of the utility company's website to pre-populate in the
            connection form.
          maxLength: 5000
        initialSites:
          type: array
          items:
            type: string
            format: uuid
          description: List of site UUIDs to pre-populate in the connection form.
        utilityTypes:
          type: array
          items:
            $ref: '#/components/schemas/DataSourceTypeEnum'
          description: >-
            List of utility types to pre-populate in the connection form (e.g.,
            ELECTRICITY, GAS, WATER).
        country:
          allOf:
            - $ref: '#/components/schemas/CountryEnum'
          description: >-
            Country of the utility company to pre-populate in the connection
            form.


            * `AF` - Af

            * `AL` - Al

            * `DZ` - Dz

            * `AS` - As

            * `AD` - Ad

            * `AO` - Ao

            * `AI` - Ai

            * `AQ` - Aq

            * `AG` - Ag

            * `AR` - Ar

            * `AM` - Am

            * `AW` - Aw

            * `AU` - Au

            * `AT` - At

            * `AZ` - Az

            * `BS` - Bs

            * `BH` - Bh

            * `BD` - Bd

            * `BB` - Bb

            * `BY` - By

            * `BE` - Be

            * `BZ` - Bz

            * `BJ` - Bj

            * `BM` - Bm

            * `BT` - Bt

            * `BO` - Bo

            * `BQ` - Bq

            * `BA` - Ba

            * `BW` - Bw

            * `BV` - Bv

            * `BR` - Br

            * `IO` - Io

            * `BN` - Bn

            * `BG` - Bg

            * `BF` - Bf

            * `BI` - Bi

            * `KH` - Kh

            * `CM` - Cm

            * `CA` - Ca

            * `CV` - Cv

            * `KY` - Ky

            * `CF` - Cf

            * `TD` - Td

            * `CL` - Cl

            * `CN` - Cn

            * `CX` - Cx

            * `CC` - Cc

            * `CO` - Co

            * `KM` - Km

            * `CG` - Cg

            * `CD` - Cd

            * `CK` - Ck

            * `CR` - Cr

            * `HR` - Hr

            * `CU` - Cu

            * `CW` - Cw

            * `CY` - Cy

            * `CZ` - Cz

            * `CI` - Ci

            * `DK` - Dk

            * `DJ` - Dj

            * `DM` - Dm

            * `DO` - Do

            * `EC` - Ec

            * `EG` - Eg

            * `SV` - Sv

            * `GQ` - Gq

            * `ER` - Er

            * `EE` - Ee

            * `ET` - Et

            * `FK` - Fk

            * `FO` - Fo

            * `FJ` - Fj

            * `FI` - Fi

            * `FR` - Fr

            * `GF` - Gf

            * `PF` - Pf

            * `TF` - Tf

            * `GA` - Ga

            * `GM` - Gm

            * `GE` - Ge

            * `DE` - De

            * `GH` - Gh

            * `GI` - Gi

            * `GR` - Gr

            * `GL` - Gl

            * `GD` - Gd

            * `GP` - Gp

            * `GU` - Gu

            * `GT` - Gt

            * `GG` - Gg

            * `GN` - Gn

            * `GW` - Gw

            * `GY` - Gy

            * `HT` - Ht

            * `HM` - Hm

            * `VA` - Va

            * `HN` - Hn

            * `HK` - Hk

            * `HU` - Hu

            * `IS` - Is

            * `IN` - In

            * `ID` - Id

            * `IR` - Ir

            * `IQ` - Iq

            * `IE` - Ie

            * `IM` - Im

            * `IL` - Il

            * `IT` - It

            * `JM` - Jm

            * `JP` - Jp

            * `JE` - Je

            * `JO` - Jo

            * `KZ` - Kz

            * `KE` - Ke

            * `KI` - Ki

            * `KP` - Kp

            * `KR` - Kr

            * `KW` - Kw

            * `KG` - Kg

            * `LA` - La

            * `LV` - Lv

            * `LB` - Lb

            * `LS` - Ls

            * `LR` - Lr

            * `LY` - Ly

            * `LI` - Li

            * `LT` - Lt

            * `LU` - Lu

            * `MO` - Mo

            * `MK` - Mk

            * `MG` - Mg

            * `MW` - Mw

            * `MY` - My

            * `MV` - Mv

            * `ML` - Ml

            * `MT` - Mt

            * `MH` - Mh

            * `MQ` - Mq

            * `MR` - Mr

            * `MU` - Mu

            * `YT` - Yt

            * `MX` - Mx

            * `FM` - Fm

            * `MD` - Md

            * `MC` - Mc

            * `MN` - Mn

            * `ME` - Me

            * `MS` - Ms

            * `MA` - Ma

            * `MZ` - Mz

            * `MM` - Mm

            * `NA` - Na

            * `NR` - Nr

            * `NP` - Np

            * `NL` - Nl

            * `NC` - Nc

            * `NZ` - Nz

            * `NI` - Ni

            * `NE` - Ne

            * `NG` - Ng

            * `NU` - Nu

            * `NF` - Nf

            * `MP` - Mp

            * `NO` - No

            * `OM` - Om

            * `PK` - Pk

            * `PW` - Pw

            * `PS` - Ps

            * `PA` - Pa

            * `PG` - Pg

            * `PY` - Py

            * `PE` - Pe

            * `PH` - Ph

            * `PN` - Pn

            * `PL` - Pl

            * `PT` - Pt

            * `PR` - Pr

            * `QA` - Qa

            * `RO` - Ro

            * `RU` - Ru

            * `RW` - Rw

            * `RE` - Re

            * `BL` - Bl

            * `SH` - Sh

            * `KN` - Kn

            * `LC` - Lc

            * `MF` - Mf

            * `PM` - Pm

            * `VC` - Vc

            * `WS` - Ws

            * `SM` - Sm

            * `ST` - St

            * `SA` - Sa

            * `SN` - Sn

            * `RS` - Rs

            * `SC` - Sc

            * `SL` - Sl

            * `SG` - Sg

            * `SX` - Sx

            * `SK` - Sk

            * `SI` - Si

            * `SB` - Sb

            * `SO` - So

            * `ZA` - Za

            * `GS` - Gs

            * `SS` - Ss

            * `ES` - Es

            * `LK` - Lk

            * `SD` - Sd

            * `SR` - Sr

            * `SJ` - Sj

            * `SZ` - Sz

            * `SE` - Se

            * `CH` - Ch

            * `SY` - Sy

            * `TW` - Tw

            * `TJ` - Tj

            * `TZ` - Tz

            * `TH` - Th

            * `TL` - Tl

            * `TG` - Tg

            * `TK` - Tk

            * `TO` - To

            * `TT` - Tt

            * `TN` - Tn

            * `TR` - Tr

            * `TM` - Tm

            * `TC` - Tc

            * `TV` - Tv

            * `UG` - Ug

            * `UA` - Ua

            * `AE` - Ae

            * `GB` - Gb

            * `US` - Us

            * `UM` - Um

            * `UY` - Uy

            * `UZ` - Uz

            * `VU` - Vu

            * `VE` - Ve

            * `VN` - Vn

            * `VG` - Vg

            * `VI` - Vi

            * `WF` - Wf

            * `EH` - Eh

            * `YE` - Ye

            * `ZM` - Zm

            * `ZW` - Zw

            * `AX` - Ax
        connectionOwnerEmail:
          type: string
          format: email
          minLength: 1
          description: >-
            Email address of the connection owner to pre-populate in the
            connection form.
        dataCollectionStartDate:
          type: string
          format: date
          description: >-
            Start date for data collection to pre-populate in the connection
            form.
        expiresInSeconds:
          type: integer
          minimum: 1
          description: >-
            Number of seconds until the magic link expires. If not provided, the
            link will not expire.
    CompanyMagicLink:
      type: object
      description: >-
        Deprecated — use the invitation endpoints instead. Response body for
        company magic link creation.
      properties:
        companyMagicLinkSecret:
          type: string
          description: >-
            Deprecated — use the invitation system instead. Secret key used for
            magic link validation for company-level magic links.
        publicCompanyId:
          type: string
          description: >-
            Deprecated — use the invitation system instead. Public ID of the
            company used in magic link URLs.
        magicLinkUrl:
          type: string
          description: >-
            Deprecated — use invitationUrl from the invitation endpoints
            instead. URL to magic link for creating the connection.
      required:
        - companyMagicLinkSecret
        - magicLinkUrl
        - publicCompanyId
    ErrorResponse:
      type: object
      description: Serializer for error responses.
      properties:
        detail:
          type: string
        error:
          type: string
    DataSourceTypeEnum:
      enum:
        - ELECTRICITY
        - GAS
        - WATER
        - DISTRICT
        - WASTE
        - FUEL
        - MISC
        - REFRIGERANT
        - SOLAR
        - TELECOM
      type: string
      description: |-
        * `ELECTRICITY` - Electricity
        * `GAS` - Gas
        * `WATER` - Water
        * `DISTRICT` - District
        * `WASTE` - Waste
        * `FUEL` - Fuel
        * `MISC` - Misc
        * `REFRIGERANT` - Refrigerant
        * `SOLAR` - Solar
        * `TELECOM` - Telecom
    CountryEnum:
      enum:
        - 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
      type: string
      description: |-
        * `AF` - Af
        * `AL` - Al
        * `DZ` - Dz
        * `AS` - As
        * `AD` - Ad
        * `AO` - Ao
        * `AI` - Ai
        * `AQ` - Aq
        * `AG` - Ag
        * `AR` - Ar
        * `AM` - Am
        * `AW` - Aw
        * `AU` - Au
        * `AT` - At
        * `AZ` - Az
        * `BS` - Bs
        * `BH` - Bh
        * `BD` - Bd
        * `BB` - Bb
        * `BY` - By
        * `BE` - Be
        * `BZ` - Bz
        * `BJ` - Bj
        * `BM` - Bm
        * `BT` - Bt
        * `BO` - Bo
        * `BQ` - Bq
        * `BA` - Ba
        * `BW` - Bw
        * `BV` - Bv
        * `BR` - Br
        * `IO` - Io
        * `BN` - Bn
        * `BG` - Bg
        * `BF` - Bf
        * `BI` - Bi
        * `KH` - Kh
        * `CM` - Cm
        * `CA` - Ca
        * `CV` - Cv
        * `KY` - Ky
        * `CF` - Cf
        * `TD` - Td
        * `CL` - Cl
        * `CN` - Cn
        * `CX` - Cx
        * `CC` - Cc
        * `CO` - Co
        * `KM` - Km
        * `CG` - Cg
        * `CD` - Cd
        * `CK` - Ck
        * `CR` - Cr
        * `HR` - Hr
        * `CU` - Cu
        * `CW` - Cw
        * `CY` - Cy
        * `CZ` - Cz
        * `CI` - Ci
        * `DK` - Dk
        * `DJ` - Dj
        * `DM` - Dm
        * `DO` - Do
        * `EC` - Ec
        * `EG` - Eg
        * `SV` - Sv
        * `GQ` - Gq
        * `ER` - Er
        * `EE` - Ee
        * `ET` - Et
        * `FK` - Fk
        * `FO` - Fo
        * `FJ` - Fj
        * `FI` - Fi
        * `FR` - Fr
        * `GF` - Gf
        * `PF` - Pf
        * `TF` - Tf
        * `GA` - Ga
        * `GM` - Gm
        * `GE` - Ge
        * `DE` - De
        * `GH` - Gh
        * `GI` - Gi
        * `GR` - Gr
        * `GL` - Gl
        * `GD` - Gd
        * `GP` - Gp
        * `GU` - Gu
        * `GT` - Gt
        * `GG` - Gg
        * `GN` - Gn
        * `GW` - Gw
        * `GY` - Gy
        * `HT` - Ht
        * `HM` - Hm
        * `VA` - Va
        * `HN` - Hn
        * `HK` - Hk
        * `HU` - Hu
        * `IS` - Is
        * `IN` - In
        * `ID` - Id
        * `IR` - Ir
        * `IQ` - Iq
        * `IE` - Ie
        * `IM` - Im
        * `IL` - Il
        * `IT` - It
        * `JM` - Jm
        * `JP` - Jp
        * `JE` - Je
        * `JO` - Jo
        * `KZ` - Kz
        * `KE` - Ke
        * `KI` - Ki
        * `KP` - Kp
        * `KR` - Kr
        * `KW` - Kw
        * `KG` - Kg
        * `LA` - La
        * `LV` - Lv
        * `LB` - Lb
        * `LS` - Ls
        * `LR` - Lr
        * `LY` - Ly
        * `LI` - Li
        * `LT` - Lt
        * `LU` - Lu
        * `MO` - Mo
        * `MK` - Mk
        * `MG` - Mg
        * `MW` - Mw
        * `MY` - My
        * `MV` - Mv
        * `ML` - Ml
        * `MT` - Mt
        * `MH` - Mh
        * `MQ` - Mq
        * `MR` - Mr
        * `MU` - Mu
        * `YT` - Yt
        * `MX` - Mx
        * `FM` - Fm
        * `MD` - Md
        * `MC` - Mc
        * `MN` - Mn
        * `ME` - Me
        * `MS` - Ms
        * `MA` - Ma
        * `MZ` - Mz
        * `MM` - Mm
        * `NA` - Na
        * `NR` - Nr
        * `NP` - Np
        * `NL` - Nl
        * `NC` - Nc
        * `NZ` - Nz
        * `NI` - Ni
        * `NE` - Ne
        * `NG` - Ng
        * `NU` - Nu
        * `NF` - Nf
        * `MP` - Mp
        * `NO` - No
        * `OM` - Om
        * `PK` - Pk
        * `PW` - Pw
        * `PS` - Ps
        * `PA` - Pa
        * `PG` - Pg
        * `PY` - Py
        * `PE` - Pe
        * `PH` - Ph
        * `PN` - Pn
        * `PL` - Pl
        * `PT` - Pt
        * `PR` - Pr
        * `QA` - Qa
        * `RO` - Ro
        * `RU` - Ru
        * `RW` - Rw
        * `RE` - Re
        * `BL` - Bl
        * `SH` - Sh
        * `KN` - Kn
        * `LC` - Lc
        * `MF` - Mf
        * `PM` - Pm
        * `VC` - Vc
        * `WS` - Ws
        * `SM` - Sm
        * `ST` - St
        * `SA` - Sa
        * `SN` - Sn
        * `RS` - Rs
        * `SC` - Sc
        * `SL` - Sl
        * `SG` - Sg
        * `SX` - Sx
        * `SK` - Sk
        * `SI` - Si
        * `SB` - Sb
        * `SO` - So
        * `ZA` - Za
        * `GS` - Gs
        * `SS` - Ss
        * `ES` - Es
        * `LK` - Lk
        * `SD` - Sd
        * `SR` - Sr
        * `SJ` - Sj
        * `SZ` - Sz
        * `SE` - Se
        * `CH` - Ch
        * `SY` - Sy
        * `TW` - Tw
        * `TJ` - Tj
        * `TZ` - Tz
        * `TH` - Th
        * `TL` - Tl
        * `TG` - Tg
        * `TK` - Tk
        * `TO` - To
        * `TT` - Tt
        * `TN` - Tn
        * `TR` - Tr
        * `TM` - Tm
        * `TC` - Tc
        * `TV` - Tv
        * `UG` - Ug
        * `UA` - Ua
        * `AE` - Ae
        * `GB` - Gb
        * `US` - Us
        * `UM` - Um
        * `UY` - Uy
        * `UZ` - Uz
        * `VU` - Vu
        * `VE` - Ve
        * `VN` - Vn
        * `VG` - Vg
        * `VI` - Vi
        * `WF` - Wf
        * `EH` - Eh
        * `YE` - Ye
        * `ZM` - Zm
        * `ZW` - Zw
        * `AX` - Ax
  securitySchemes:
    ExternalAuthentication:
      type: apiKey
      in: header
      name: X-API-KEY

````