Create a connection
Creates a connection for a connector, such as Gmail. The connection's type comes from the connector, and an OAuth connection starts with the connector's endpoints and default scopes. Next, register an OAuth app with the provider using the redirect_uri from the response, then add its client ID, client secret and the scopes you need with Update a connection.
Authorization
Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.
Body
providerstringrequiredGMAIL. To find a connector's identifier, call List connectors and read identifier.auth_modestring (enum)USER (default): each user authorizes their own account. ORG_WIDE: one admin authorizes an account that every user shares. You can't change it after the connection is created.USERORG_WIDEconnection_namestringgmail-work: letters, numbers and hyphens, unique in the environment. Your code passes this name as connection_name when it creates connected accounts and runs tools. Scalekit generates one if you leave it out.provider_configurationsobjectprovider_domain for a connector with regional domains.Show 7 child attributes
googleads_developer_tokenstringmicrosoft_tenant_idstringprovider_domainstringmcp-eu.mixpanel.com for Mixpanel's EU region, for connectors that need one. Set it when you create the connection; it can't be changed later and isn't returned.slack_connection_typestring (enum)BOT to act as your Slack app's bot user, or USER to act as the user who connects.BOTUSERsmart_fhir_audstringaud parameter when users sign in.smart_fhir_domainstringtrello_app_namestringscalekit_client.actions.create_connection
Creates a connection for a connector, such as GMAIL. Then set its credentials and scopes with update_connection.
scalekit_client.actions.create_connection( provider: str, connection_name: Optional[str] = None, auth_mode: Optional[AuthMode] = None, provider_domain: Optional[str] = None,) -> AgentKitConnectionParameters
providerstrrequiredconnection_nameOptional[str]gmail-work: letters, numbers and hyphens, unique in the environment. Your code passes this name when it creates connected accounts and runs tools. Scalekit generates one if you leave it out.auth_modeOptional[AuthMode]AuthMode.USER (default): each user authorizes their own account. AuthMode.ORG_WIDE: one admin authorizes an account that every user shares. Import it with from scalekit.actions.connections import AuthMode. You can't change it later.provider_domainOptional[str]mcp-eu.mixpanel.com for Mixpanel's EU region. You can't change it later.Returns AgentKitConnection: The created connection.
From scalekit-sdk-python 2.22.0.
scalekit.actions.createConnection
Creates a connection for a connector, such as GMAIL. Then set its credentials and scopes with updateConnection.
scalekit.actions.createConnection( params: { provider: string; connectionName?: string; authMode?: AgentKitAuthMode; providerDomain?: string; },): Promise<AgentKitConnection>Parameters
providerstringrequiredconnectionNamestringgmail-work: letters, numbers and hyphens, unique in the environment. Your code passes this name when it creates connected accounts and runs tools. Scalekit generates one if you leave it out.authModeAgentKitAuthMode'USER' (default): each user authorizes their own account. 'ORG_WIDE': one admin authorizes an account that every user shares. You can't change it later.providerDomainstringmcp-eu.mixpanel.com for Mixpanel's EU region. You can't change it later.Returns Promise<AgentKitConnection>: The created connection.
From @scalekit-sdk/node 2.21.0.
Response 200
connectionobjectShow 11 child attributes
auth_modestring (enum)USER: each user authorizes their own account. ORG_WIDE: one admin-authorized account is shared.USERORG_WIDEconnection_mcp_urlstringconnection_namestringgmail-work. Your code passes this name as connection_name when it creates connected accounts and runs tools.create_timestringgoogle_dwd_configobjectGOOGLE_DWD connections.Show 5 child attributes
required_scopesarray of stringscopes that users can't deselect when scope_selection_allowed is true. Each must also be in scopes.scope_selection_allowedbooleantrue to let users choose which of the scopes to grant when they connect.scopesarray of stringhttps://www.googleapis.com/auth/gmail.readonly. A list you send replaces the current one. Authorize the same scopes for the service account's client ID in the Google Workspace Admin console, under Security > Access and data control > API controls > Manage domain wide delegation.service_account_jsonstringtoken_uristringhttps://oauth2.googleapis.com/token.idstringoauth_configobjectShow 18 child attributes
access_typestringaccess_type value sent to the provider, such as offline.authorize_uristringclient_idstring123456789012-abc123def456.apps.googleusercontent.com for a Google app. Get it from the provider's developer console when you create the app (for Gmail: Google Cloud console, APIs & Services > Credentials, an OAuth client ID of type web application), and add this connection's redirect_uri to the app as an authorized redirect URI. Each connector's page under Connectors has the steps for that provider.client_secretstring********abcd. Leave it out to keep the stored secret.extra_authorize_paramsobject{"hd": "example.com"}, which asks Google to suggest accounts from that domain. Check the provider's OAuth documentation for the parameters it accepts. Send {} to clear them.optional_scopesobjectuser_scope. Set field_name to that parameter's name and scopes to its values.pkce_enabledbooleanpromptstringprompt value sent to the provider, which controls whether the user signs in or consents again, such as consent. Send an empty string to send no prompt.redirect_uristringrequired_optional_scopesarray of stringoptional_scopes.scopes that users can't deselect when scope_selection_allowed is true. Each must also be in optional_scopes.scopes.required_scopesarray of stringscopes that users can't deselect when scope_selection_allowed is true, such as the read scope your tools always need. Each must also be in scopes, or the request fails with 400.scope_selection_allowedbooleantrue to let users choose which of the scopes to grant when they connect. Scopes in required_scopes stay selected.scopesarray of stringhttps://www.googleapis.com/auth/gmail.readonly for Gmail. A list you send replaces the whole current list, so include the scopes you want to keep. To build it, start from the current scopes in Get a connection, then pick from the scopes the connector offers: call List connectors with identifier set to the connector, such as GMAIL, and read auth_patterns[].oauth_config.available_scopes[].scope. You can also add a scope that isn't listed there, using the exact scope string from the provider's own documentation, such as Google's Gmail API scopes.token_access_typestringtoken_access_type value sent to the provider, for providers that use it, such as Dropbox with offline.token_endpoint_auth_methodstring (enum)DEFAULT lets Scalekit choose.NONEBASIC_AUTHREQUEST_BODYDEFAULTtoken_uristringuse_scalekit_credsbooleantrue to use Scalekit's own OAuth app instead of yours, for connectors that offer one; otherwise the request fails with 400. Sending your own client_id or client_secret sets it to false unless you also send it.user_info_uristringproviderstringGMAIL.provider_configurationsobjectShow 7 child attributes
googleads_developer_tokenstringmicrosoft_tenant_idstringprovider_domainstringmcp-eu.mixpanel.com for Mixpanel's EU region, for connectors that need one. Set it when you create the connection; it can't be changed later and isn't returned.slack_connection_typestring (enum)BOT to act as your Slack app's bot user, or USER to act as the user who connects.BOTUSERsmart_fhir_audstringaud parameter when users sign in.smart_fhir_domainstringtrello_app_namestringtypestring (enum)OAUTH. It comes from the connector and decides which settings object applies (oauth_config or google_dwd_config).OIDCSAMLPASSWORDOAUTHPASSWORDLESSBASICBEARERAPI_KEYWEBAUTHNOAUTH_M2MTRELLO_OAUTH1GOOGLE_DWDTRUSTED_IDPSMART_FHIRNO_AUTHupdate_timestringErrors
Every error has the same body: code, message and details. See Errors and rate limits.
400Invalid request - the connector is missing or unknown, or the connection name is already used or reserved. Error code DUPLICATE_IDENTIFIER when the name is already used.401Authentication required - missing or invalid access token