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

# Magic link integration (deprecated)

> Magic-link endpoints are deprecated. Use Connection invitations instead.

<Warning>
  **Deprecated.** The magic-link endpoints (`POST /connection/company/{company_id}/link` and `POST /connection/{connection_id}`) are marked `deprecated` in the OpenAPI spec. Use [Connection invitations](/developer-guide/connection-invitations) for all new integrations. Invitations are database-backed, revocable, auditable, and support scoped email access.
</Warning>

<Tip>
  **For platform users:** see the [Invitations](/platform/data-input/invitations) page to understand the end-user experience.
</Tip>

## Migration at a glance

| Legacy magic-link endpoint                     | Invitation replacement                        |
| ---------------------------------------------- | --------------------------------------------- |
| `POST /connection/company/{company_id}/link`   | `POST /invitation/company/{company_id}`       |
| `POST /connection/{connection_id}` (edit link) | `POST /invitation/connection/{connection_id}` |
| *(revocation not supported)*                   | `POST /invitation/{invitation_id}/revoke`     |
| *(list not supported)*                         | `GET /invitation/company/{company_id}`        |
| *(detail + events not supported)*              | `GET /invitation/{invitation_id}`             |

The embed pattern is unchanged — you still display a URL in an iframe or share it directly. Only the endpoint you call on the server side is different, and the new URL format uses `https://dash.nectarclimate.com/p/i/{token}` instead of the legacy `p/connect/...` path.

## Do I need to migrate existing magic links?

No. Outstanding magic-link URLs continue to work. You only need to update the endpoint your server calls when **creating** new links.

## Legacy request and response reference

The legacy endpoints remain available for backward compatibility; the examples below are preserved for reference only.

<Accordion title="Create a company magic link (legacy)">
  ```bash theme={null}
  curl -X POST 'https://external.nectarclimate.com/v2.2/connection/company/{companyId}/link' \
    -H 'X-API-Key: YOUR_SECRET_KEY' \
    -H 'Content-Type: application/json' \
    -d '{ "initialSites": ["{siteId}"] }'
  ```

  Response includes `publicCompanyId`, `companyMagicLinkSecret`, and `magicLinkUrl` (shape:
  `https://dash.nectarclimate.com/p/connect/{publicCompanyId}/{companyMagicLinkSecret}`).
</Accordion>

<Accordion title="Create an edit magic link for an existing connection (legacy)">
  ```bash theme={null}
  curl -X POST 'https://external.nectarclimate.com/v2.2/connection/{connectionId}' \
    -H 'X-API-Key: YOUR_SECRET_KEY'
  ```

  Response includes `publicCompanyId` and `connectionMagicLinkSecret` (shape:
  `https://dash.nectarclimate.com/p/connect/{publicCompanyId}/workflow/{connectionMagicLinkSecret}`).
</Accordion>

## Next steps

<CardGroup cols={3}>
  <Card title="Connection invitations" icon="paper-plane" href="/developer-guide/connection-invitations">
    The recommended replacement for all magic-link use cases.
  </Card>

  <Card title="Sandbox testing" icon="flask" href="/developer-guide/sandbox-testing">
    Test invitation flows with mock data.
  </Card>

  <Card title="Webhooks" icon="bell" href="/developer-guide/webhooks">
    Listen for `connection.created.v2` and `connection.updated.v2` events.
  </Card>
</CardGroup>
