---
title: "Generate authentication magic link"
method: POST
path: "/api/v1/connected_accounts/magic_link"
tags: ["Connected Accounts"]
---

# Generate authentication magic link

`POST /api/v1/connected_accounts/magic_link`

Creates a time-limited magic link for connecting or re-authorizing a third-party account. The link directs users to the OAuth authorization flow for the specified connector. Returns the generated link URL and expiration timestamp. Links typically expire after a short duration for security.

## Request body

- ConnectedAccountsGetMagicLinkForConnectedAccountRequest
  - `connector` string — Connector identifier (e.g., 'notion', 'slack', 'google'). Alphanumeric characters, spaces, hyphens, underscores, and colons are allowed.
  - `id` string — Unique identifier for the connected account
  - `identifier` string — The unique identifier for the connected account within the third-party service (e.g., email address, user ID, workspace identifier).
  - `organization_id` string — Organization ID for the connector
  - `state` string — Optional opaque state value. State added to the user verify redirect URL query params to validate the user verification
  - `user_id` string — User ID for the connector
  - `user_verify_url` string — B2B app's user verify redirect URL

## Response `200`

Magic link generated successfully with authorization URL and expiry time

- ConnectedAccountsGetMagicLinkForConnectedAccountResponse
  - `expiry` string, date-time — Expiry timestamp for the authentication link
  - `link` string — Authentication link for the connector

## Other responses

- `400` — Invalid request - missing required parameters or invalid connector
- `401` — Authentication required - missing or invalid access token

---

[API](https://skmtc.net/scalekit/apis/scalekit-api-reference.md) · [All operations](https://skmtc.net/scalekit/apis/scalekit-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scalekit/scalekit-api-reference/versions/a40d5d4650e5/schema)
