Connected Accounts

Get an authorization link

Changed on

Creates a one-time authorization link for connecting or re-authorizing a user's account on one connection, creating the connected account first if it doesn't exist. The link takes the user to the app's consent screen, or to a form for their credentials. Returns the link and when it expires, 5 minutes after you create it.

post/api/v1/connected_accounts/magic_link

Request

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

An organization ID to key the account by instead of identifier, such as a Scalekit organization ID. Ignored when identifier is set.

statestring

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

user_idstring

A user ID that, with organization_id, keys the account to one user in that organization. Ignored when identifier is set.

user_verify_urlstring

Your app's URL that Scalekit sends the user to after they approve access, to confirm they are the user your app meant. Required when the environment verifies users with a custom verifier.

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

Authorization link created, with its expiry time

expirystring date-time

Expiry timestamp for the authentication link

linkstring

The one-time link to send the user to. It opens the app's consent screen, or a form for their credentials.

Example response

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

Changes