Connected accounts
Connect accounts, start auth, and execute tools with scalekit.actions
scalekit.actions is the primary AgentKit client for connecting end-user accounts, starting OAuth, and executing tools on their behalf.
Common path: create or look up a connected account → get an authorization link → verify the user after redirect → run tools.
For raw tool schemas, see Tool calling. For exceptions, see Error handling.
get_authorization_link
Section titled “get_authorization_link”#asyncget_authorization_link
Generates a time-limited OAuth magic link to authorize a user’s connection.
User identifier (e.g. email)
Connector slug (e.g. gmail)
Direct connected account ID (ca_…)
Opaque value passed through to the redirect URL
App redirect URL for user verification
The link.
# connection_name + identifier (or connected_account_id)response = scalekit_client.actions.get_authorization_link( connection_name="GMAIL", identifier="user@example.com",)# response.link, response.expiryverify_connected_account_user
Section titled “verify_connected_account_user”#asyncverify_connected_account_user
Verifies the user after OAuth callback.
Token from the redirect URL query params Required.
Current user identifier Required.
Post-verify redirect URL.
response = scalekit_client.actions.verify_connected_account_user( auth_request_id="opaque-auth-request-id", identifier="user@example.com",)get_or_create_connected_account
Section titled “get_or_create_connected_account”#asyncget_or_create_connected_account
Fetches an existing connected account or creates one if none exists.
Connector slug Required.
User\s identifier Required.
OAuth token or static auth details
Organization tenant ID.
Your app user ID.
Connector-specific options (for example scopes or static.
The connected account.id.
# authorization_details is optionalresponse = scalekit_client.actions.get_or_create_connected_account( connection_name="GMAIL", identifier="user@example.com",)# response.connected_account# Alias: scalekit_client.actions.upsert_connected_account(...)get_connected_account
Section titled “get_connected_account”#asyncget_connected_account
Fetches auth details for a connected account.
Connector slug.
End-user or workspace identifier. Use with connection_name.
Connected account ID (ca_…) when resolving by ID instead.
The connected account.id.
# Includes auth credentials (sensitive)response = scalekit_client.actions.get_connected_account( connection_name="GMAIL", identifier="user@example.com",)# response.connected_accountget_connected_account_details
Section titled “get_connected_account_details”#asyncget_connected_account_details
Fetches connected account metadata without auth credentials.
Connector slug.
End-user or workspace identifier. Use with connection_name.
Connected account ID (ca_…) when resolving by ID instead.
The connected account.id.
# Metadata only — no access/refresh tokensdetails = scalekit_client.actions.get_connected_account_details( connection_name="gmail", identifier="user@example.com",)print(details.connected_account.status)list_connected_accounts
Section titled “list_connected_accounts”#asynclist_connected_accounts
Runs list_connected_accounts and returns the result.
Filter by a single connector slug
Filter by user identifier
Filter by provider
Filter to connected accounts belonging to any of these connection names (exact match, max 20 names). Cannot be combined with connection_name.
Paginated connected accounts.
result = scalekit_client.actions.list_connected_accounts( connection_names=["GMAIL", "slack"], identifier="user@example.com",)# result.connected_accounts, result.total_count, result.next_page_tokencreate_connected_account
Section titled “create_connected_account”#asynccreate_connected_account
Creates a connected account with explicit auth details.
Connector slug.
End-user identifier.
Authorization details.
Organization tenant ID.
Your app user ID.
Connector-specific options (for example scopes or static.
CreateConnectedAccountResponse.
response = scalekit_client.actions.create_connected_account( connection_name="GMAIL", identifier="user@example.com", authorization_details={ "oauth_token": { "access_token": "", "refresh_token": "", "scopes": [], } },)# response.connected_accountupdate_connected_account
Section titled “update_connected_account”#asyncupdate_connected_account
Requires connected_account_id or connection_name + identifier.
Connector slug.
End-user or workspace identifier. Use with connection_name.
Connected account ID (ca_…) when updating by ID instead.
Replace or merge stored credentials (OAuth tokens, API.
Organization tenant ID.
Your app user ID.
Connector-specific configuration to persist on the account
UpdateConnectedAccountResponse.
response = scalekit_client.actions.update_connected_account( connection_name="GMAIL", identifier="user@example.com", authorization_details={ "oauth_token": { "access_token": "ya29...", "refresh_token": "...", "scopes": ["email"], } },)# response.connected_accountdelete_connected_account
Section titled “delete_connected_account”#asyncdelete_connected_account
Deletes a connected account and revokes its credentials.
Connector slug.
End-user or workspace identifier. Use with connection_name.
Connected account ID (ca_…) when deleting by ID instead.
DeleteConnectedAccountResponse.
scalekit_client.actions.delete_connected_account( connection_name="GMAIL", identifier="user@example.com",)execute_tool
Section titled “execute_tool”#asyncexecute_tool
Executes a named tool via Scalekit.
Tool name (e.g. gmail_fetch_emails) Required.
Parameters the tool expects Required.
User\s identifier
Direct connected account ID
Tool result and execution ID.
# ActionClient: tool_input first, then tool_nameresult = scalekit_client.actions.execute_tool( tool_input={"max_results": 1}, tool_name="gmail_fetch_mails", identifier="user@example.com",)# result.data, result.execution_idrequest
Section titled “request”#asyncrequest
Makes a REST API call on behalf of a connected account.
Connector slug Required.
User\s identifier Required.
API path (e.g. /gmail/v1/users/me/messages) Required.
HTTP method. Default: GET
URL query parameters appended to path
JSON-serializable body for POST, PUT, PATCH, or similar.
Multipart form fields when the upstream API expects form.
Extra HTTP headers merged with Scalekit-injected auth.
See return type requests.Response.
# Proxied HTTP via {env_url}/proxy{path}response = scalekit_client.actions.request( connection_name="GMAIL", identifier="user@example.com", path="/gmail/v1/users/me/profile", method="GET",)# requests.Response: response.status_code, response.json()