v4

latestOpenAPI 3.1.1Apache 2.02026-07-31107278570.4 KB
Connected Accounts

Generate authentication 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.

post/api/v1/connected_accounts/magic_link

Request body

connectorstring

Connector identifier (e.g., 'notion', 'slack', 'google'). Alphanumeric characters, spaces, hyphens, underscores, and colons are allowed.

idstring

Unique identifier for the connected account

identifierstring

The unique identifier for the connected account within the third-party service (e.g., email address, user ID, workspace identifier).

organization_idstring

Organization ID for the connector

statestring

Optional opaque state value. State added to the user verify redirect URL query params to validate the user verification

user_idstring

User ID for the connector

user_verify_urlstring

B2B app's user verify redirect URL

Example request

{
  "connector": "notion",
  "id": "ca_123",
  "identifier": "user@example.com",
  "organization_id": "org_121312434123312",
  "state": "QVNDSUFyY2hhYml0dGVyXzE2ODQ5NzIwNzI0NTY=",
  "user_id": "user_121312434123312",
  "user_verify_url": "https://app.yourapp.com/user/verify/callback"
}

Response

Magic link generated successfully with authorization URL and expiry time

expirystring date-time

Expiry timestamp for the authentication link

linkstring

Authentication link for the connector

Example response

{
  "expiry": "2024-03-20T15:04:05Z",
  "link": "https://notion.com/oauth/authorize?client_id=..."
}