Creating Integrations
Set up integrations with OAuth and configuration
Create integrations to connect Bifrost to external APIs with OAuth and configuration management.
Create an Integration
Section titled “Create an Integration”-
Navigate to Settings > Integrations
-
Click Create Integration
-
Fill in basic details:
- Name: Unique identifier (e.g., “Microsoft_Graph”, “HaloPSA”)
- Description: What this integration connects to
-
Configure the Config Schema (optional):
- Add fields like
base_url,api_key,tenant_id - Set types: string, int, bool, json, or secret
- Add fields like
-
Link an OAuth Provider (optional):
- Select existing OAuth connection
- Or configure custom OAuth settings
-
Save the integration
Set Integration Defaults
Section titled “Set Integration Defaults”Configure default values that apply to all organizations:
-
Open the integration
-
Go to Configuration tab
-
Fill in default values:
- Base URLs
- Default timeouts
- Shared API keys
-
Save
Create Organization Mappings
Section titled “Create Organization Mappings”Map each organization to its external entity:
-
In the integration, go to Mappings tab
-
Click Add Mapping
-
Select the Organization
-
Set the Entity ID (tenant ID, company ID, etc.)
-
Override any config values specific to this org
-
Optionally link an org-specific OAuth token
-
Save
OAuth Configuration
Section titled “OAuth Configuration”Link Existing OAuth Provider
Section titled “Link Existing OAuth Provider”If you already have an OAuth connection:
- In integration settings, select OAuth Provider
- Choose from existing connections
- Tokens are automatically available via
integration.oauth
Configure OAuth Inline
Section titled “Configure OAuth Inline”For new OAuth connections:
-
In integration OAuth settings, configure:
- Authorization URL
- Token URL
- Client ID/Secret
- Scopes
-
Click Connect to authorize
Config Schema Types
Section titled “Config Schema Types”| Type | Description | Example |
|---|---|---|
string | Text value | Base URL |
int | Integer | Timeout seconds |
bool | True/False | Enable feature flag |
json | Complex object | Custom settings |
secret | Encrypted | API keys, tokens |
Use in Workflows
Section titled “Use in Workflows”from bifrost import workflow, integrationsimport httpx
@workflowasync def fetch_customers(): # Get integration integration = await integrations.get("HaloPSA") if not integration: return {"error": "Integration not configured"}
# Access config base_url = integration.config.get("base_url") tenant = integration.entity_id
# Access OAuth token token = integration.oauth.access_token if integration.oauth else None
# Make API call async with httpx.AsyncClient() as client: response = await client.get( f"{base_url}/api/customers", headers={ "Authorization": f"Bearer {token}", "X-Tenant-ID": tenant } ) return response.json()Multi-Tenant Pattern
Section titled “Multi-Tenant Pattern”For APIs that serve multiple tenants:
-
Create one integration (e.g., “HaloPSA”)
-
Set Entity ID Name (e.g., “Tenant ID”)
-
Create mappings for each organization with their tenant ID
-
In workflows,
integration.entity_idreturns the correct tenant
# Each org gets their own tenant automaticallyintegration = await integrations.get("HaloPSA")tenant_id = integration.entity_id # Org-specificNext Steps
Section titled “Next Steps”- SDK Generation - Generate API clients
- Integrations Module - SDK reference