Skip to content

Creating Integrations

Set up integrations with OAuth and configuration

Create integrations to connect Bifrost to external APIs with OAuth and configuration management.

  1. Navigate to Settings > Integrations

  2. Click Create Integration

  3. Fill in basic details:

    • Name: Unique identifier (e.g., “Microsoft_Graph”, “HaloPSA”)
    • Description: What this integration connects to
  4. Configure the Config Schema (optional):

    • Add fields like base_url, api_key, tenant_id
    • Set types: string, int, bool, json, or secret
  5. Link an OAuth Provider (optional):

    • Select existing OAuth connection
    • Or configure custom OAuth settings
  6. Save the integration

Configure default values that apply to all organizations:

  1. Open the integration

  2. Go to Configuration tab

  3. Fill in default values:

    • Base URLs
    • Default timeouts
    • Shared API keys
  4. Save

Map each organization to its external entity:

  1. In the integration, go to Mappings tab

  2. Click Add Mapping

  3. Select the Organization

  4. Set the Entity ID (tenant ID, company ID, etc.)

  5. Override any config values specific to this org

  6. Optionally link an org-specific OAuth token

  7. Save

If you already have an OAuth connection:

  1. In integration settings, select OAuth Provider
  2. Choose from existing connections
  3. Tokens are automatically available via integration.oauth

For new OAuth connections:

  1. In integration OAuth settings, configure:

    • Authorization URL
    • Token URL
    • Client ID/Secret
    • Scopes
  2. Click Connect to authorize

TypeDescriptionExample
stringText valueBase URL
intIntegerTimeout seconds
boolTrue/FalseEnable feature flag
jsonComplex objectCustom settings
secretEncryptedAPI keys, tokens
from bifrost import workflow, integrations
import httpx
@workflow
async 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()

For APIs that serve multiple tenants:

  1. Create one integration (e.g., “HaloPSA”)

  2. Set Entity ID Name (e.g., “Tenant ID”)

  3. Create mappings for each organization with their tenant ID

  4. In workflows, integration.entity_id returns the correct tenant

# Each org gets their own tenant automatically
integration = await integrations.get("HaloPSA")
tenant_id = integration.entity_id # Org-specific