Connect third-party services to Weavz using OAuth2, API keys, or custom authentication.
Connections store the authentication credentials needed to interact with third-party services. Weavz supports OAuth2, API key, and custom authentication methods.
Connecting apps for your own AI client? Start with Connect Apps to Your AI. This guide covers For your product and embedding connections in your product.
For the main dashboard flow, open Apps, choose an app and create an Auth configuration. Then open Users, add your customer's user ID and choose Manage → Create connection link for the intended app configuration. Send that temporary link only to the intended customer. Configurations define app access; connections hold each customer's credentials. Project Members are your teammates and connect their own accounts in For your AI.
The advanced dashboard procedures below use Advanced → Connection records to manage individual records. Existing links may open this advanced flow with a particular workspace and app already selected. Confirm that setup before continuing.
OAuth2 connections use the hosted connect flow — a Weavz-hosted page that handles the full authorization process. You create a connect token, open the connect page (as a popup or redirect), and the user completes authorization there. Once finished, you retrieve the session to get the resulting connection.
OAuth2 integrations can use two OAuth app sources:
Source
Availability
Selection
Weavz-managed OAuth app
Default where Weavz has configured provider credentials
Omit oauthAppId, or set oauthAppMode to weavz_managed
Tenant-owned custom OAuth app
Team, Scale, and Enterprise
Register it in Settings > OAuth Apps, then select oauthAppMode: "custom" and pass the app's real oauthAppId
The connection type does not decide whether the provider sees a Weavz-managed OAuth client or your own OAuth client. That choice comes from OAuth app selection during hosted connect or from the configured workspace integration selected with workspaceIntegrationId. If no Weavz-managed OAuth app exists for the integration and you do not select a valid custom app, creating the connect token returns NO_OAUTH_APP.
1
Navigate to Connections
Choose For your product, then open Advanced → Connection records.
2
New Connection
Click New Connection and select the configured workspace integration, or choose an integration from the catalog.
3
Authorize
Review the configured sign-in method and connection owner. A per-user app requires the intended end user. Click Connect to open the secure authorization window.
4
Approve Access
Approve access in the popup — it closes automatically and your connection appears in the list.
The hosted connect flow has three steps: create a token, open the connect page, and retrieve the session result.
workspaceId associates the connect session with a workspace for access, setup, and selection. The stored credential scope still follows the Connect API defaults unless you pass scope: it defaults to ORGANIZATION, or you can explicitly choose WORKSPACE or USER. Connect token creation also accepts:
Option
Use when
endUserId
The connection should belong to a specific end user, identified by their externalId
scope
You need to explicitly choose ORGANIZATION, WORKSPACE, or USER connection scope
workspaceIntegrationId
You want hosted connect to inherit the workspace integration's selected auth method and OAuth app policy
authMethodKey
The integration supports multiple auth methods and you are connecting by integrationName instead of workspaceIntegrationId
oauthAppMode
You want to choose Weavz-managed or custom OAuth for this connect session
oauthAppId
You selected oauthAppMode: "custom" and need to use a tenant-owned OAuth app
successRedirectUri
Your product should receive the user after successful authorization
errorRedirectUri
Your product should receive the user after a failed authorization
See the Connect API reference for the complete request body and OAuth app selection errors.
Step 2: Open the Connect Page
Open connectUrl in a popup window or redirect the user to it. The hosted connect page guides them through the OAuth2 consent flow.
In a browser environment, the TypeScript SDK provides a convenience method that handles the popup automatically:
typescript
// On your backend. Use your configured frontend origin, not untrusted input.const connectClient = new WeavzClient({ apiKey: process.env.WEAVZ_API_KEY!, headers: { Origin: 'https://app.example.com' },})const session = await connectClient.connect.createToken({ integrationName: 'slack', connectionName: 'My Slack Workspace', externalId: 'tenant_123_slack', workspaceId: '550e8400-e29b-41d4-a716-446655440000',})// Return session.connectUrl to the authorized browser.
Keep the API key on your backend. Set Origin to the exact frontend origin that opens the popup so OAuth completion returns to that page. For multiple frontends, choose it from your server-side allowlist. Prepare the short-lived connect URL before the user clicks Connect. Open the popup directly from that click handler:
typescript
import { openConnectPopup } from '@weavz-io/sdk'async function onConnectClick(connectUrl: string) { const result = await openConnectPopup({ connectUrl }) console.log('Connection created:', result.connectionId)}
Step 3: Retrieve the Session
If you opened the connect page manually (not using the popup helper), poll the session endpoint to check when the user has completed authorization:
Choose For your product, then open Advanced → Connection records.
2
New Connection
Click New Connection and select the configured app or integration (e.g., OpenAI). Review its sign-in method and owner, then click Connect.
3
Enter Credentials
Enter your API key in the secure connection window.
4
Save
Complete the credential form and return to the dashboard. Check the connection status. Display names and external IDs are optional advanced details in the dashboard.
Direct connection creation also accepts workspaceId, endUserId, scope, and auth-type-specific fields. scope defaults to ORGANIZATION; pass workspaceId plus endUserId when creating a user-scoped connection for an end user's externalId. See the Connections API reference.
Choose For your product, then open Advanced → Connection records.
2
New Connection
Click New Connection and select the configured app or integration (e.g., Freshsales). Review its sign-in method and owner, then click Connect.
3
Fill in Fields
The secure connection window shows the required fields for the integration. Fill in all required values (e.g., base URL and API key).
4
Save
Complete the credential form and return to the dashboard. Check the connection status. Display names and external IDs are optional advanced details in the dashboard.
// Register the end userconst { endUser } = await client.endUsers.create({ workspaceId: '550e8400-e29b-41d4-a716-446655440000', externalId: 'user_456', displayName: 'Alice Johnson',})// Generate a connect URL for Slackconst { connectUrl } = await client.endUsers.createConnectToken( endUser.id, { integrationName: 'slack' })// Open connectUrl in a popup for the user to authorize
python
# Register the end userresult = client.end_users.create( workspace_id="550e8400-e29b-41d4-a716-446655440000", external_id="user_456", display_name="Alice Johnson",)end_user = result["endUser"]# Generate a connect URL for Slackresult = client.end_users.create_connect_token( end_user["id"], integration_name="slack",)connect_url = result["connectUrl"]# Open connect_url in a popup for the user to authorize
import httpxheaders = {"Authorization": "Bearer wvz_your_key"}# Register the end userres = httpx.post( "https://platform.weavz.io/api/v1/end-users", headers=headers, json={ "workspaceId": "550e8400-e29b-41d4-a716-446655440000", "externalId": "user_456", "displayName": "Alice Johnson", },)end_user = res.json()["endUser"]# Generate a connect URL for Slackres = httpx.post( f"https://platform.weavz.io/api/v1/end-users/{end_user['id']}/connect-token", headers=headers, json={"integrationName": "slack"},)connect_url = res.json()["connectUrl"]
Connections created through the end user connect portal are automatically linked to the end user. When executing actions directly, pass endUserId and the workspace integration integrationAlias so Weavz can resolve the right configured integration and the right user's credential. integrationName alone is convenient only when one configured instance exists.
Connection external IDs are your stable identifiers for individual credential sets. Use them when your backend needs to retrieve or execute against a specific connection, such as a project API key, shared customer bot, or tenant-level account.
For per-user credentials, use end users instead: store your user's ID in endUser.externalId and pass that value as endUserId during execution.
When resolving by connection external ID, always pass the same context you used when creating or using the connection. workspaceId is required for resolution, and mismatched scope is rejected.