Get an authorization link
Creates a one-time authorization link that takes the user to the app's consent screen, or to a form for their API key, for one connection. If the user has no connected account for the connection yet, the call creates it first. When the user finishes, the account becomes ACTIVE. With user verification on, it becomes PENDING_VERIFICATION instead, and stays that way until you call Verify the user. The link expires 5 minutes after you create it, so create a new one each time you send it. The endpoint path and the connected_account.magic_link_generated event call it a magic link.
Authorization
Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.
Body
connectorstringidstringidentifierstringorganization_idstringidentifier, such as a Scalekit organization ID. Ignored when identifier is set.statestringuser_verify_url, so your app can check that the request is the one it started.user_idstringorganization_id, keys the account to one user in that organization. Ignored when identifier is set.user_verify_urlstringscalekit_client.actions.get_authorization_link
Creates the link a user opens to connect their account.
scalekit_client.actions.get_authorization_link( identifier: Optional[str] = None, connection_name: Optional[str] = None, connected_account_id: Optional[str] = None, state: Optional[str] = None, user_verify_url: Optional[str] = None,) -> MagicLinkResponseParameters
identifierOptional[str]connection_nameOptional[str]connected_account_idOptional[str]stateOptional[str]user_verify_url, so your app can check that the request is the one it started.user_verify_urlOptional[str]Returns MagicLinkResponse: The authorization link and its expiry.
From scalekit-sdk-python 2.19.1.
scalekit.actions.getAuthorizationLink
Creates the link a user opens to connect their account.
scalekit.actions.getAuthorizationLink( params: { connectionName?: string; identifier?: string; connectedAccountId?: string; organizationId?: string; userId?: string; state?: string; userVerifyUrl?: string; },): Promise<GetMagicLinkForConnectedAccountResponse>Parameters
connectionNamestringidentifierstringconnectedAccountIdstringorganizationIdstringidentifier, such as a Scalekit organization ID. Ignored when identifier is set.userIdstringorganization_id, keys the account to one user in that organization. Ignored when identifier is set.statestringuser_verify_url, so your app can check that the request is the one it started.userVerifyUrlstringReturns Promise<GetMagicLinkForConnectedAccountResponse>.
From @scalekit-sdk/node 2.18.0.
Response 200
expirystringlinkstringErrors
Every error has the same body: code, message and details. See Errors and rate limits.
400Invalid request - missing required parameters, or a malformed connected account ID401Authentication required - missing or invalid access token404Not found - no connection with this name exists in the environment. Error code RESOURCE_NOT_FOUND.Used in
- Apify Actor with per-user OAuth via Scalekit
- Authorize a user
- Build a daily briefing agent with Vercel AI SDK and Scalekit AgentKit
- Build a Mastra agent with Scalekit AgentKit tools
- Build a multi-agent email triage crew with CrewAI
- Build a multi-user GitHub PR summarizer agent
- Build an agent that books meetings and drafts emails
- Claude Managed Agents
- FastRouter + Scalekit tool calling
- Manage connected accounts
- Migrate from Composio to Scalekit
- Quickstart
- Trace AgentKit tool calls in LangSmith
- Troubleshoot connection and OAuth errors
- Verify users