Getting Started

5-Minute Quickstart

Use the v1 integration API from Python or TypeScript to resolve tools and invoke them.

This guide uses the real app routes in server/routers/integrations.py. Authenticate with a user access token, list integrations, resolve tools, and then invoke one of the resolved tool keys.


Step 1: Configure the Client

Set the API host and export a user access token from the app or your auth flow.

import os

base_url = os.getenv("DATAFUSE_API_URL", "https://api.datafuse.xyz")
token = os.getenv("DF_TOKEN", "")

headers = {
    "Authorization": f"Bearer {token}",
}

Step 2: List Integrations

Use the integrations endpoint to find the connection you want to execute against.

import requests

integrations = requests.get(
    f"{base_url}/api/v1/integrations",
    headers=headers,
).json()

integration_id = integrations["items"][0]["id"]
print(f"Using integration {integration_id}")

!NOTE If your workspace has more than one integration, replace the selected id with the one you want to test.


Step 3: Resolve Tools

The resolve step discovers which tool keys are available for the integration.

tools = requests.post(
    f"{base_url}/api/v1/integrations/{integration_id}/resolve-tools",
    headers=headers,
).json()

tool_key = tools[0]["slug"]
print(f"Resolved tool: {tool_key}")

Step 4: Invoke the Tool

Pass the tool key and a JSON arguments payload back to the invoke endpoint. Adjust the payload to match the selected tool's schema.

response = requests.post(
    f"{base_url}/api/v1/integrations/{integration_id}/invoke",
    headers={**headers, "Content-Type": "application/json"},
    json={
        "tool_key": tool_key,
        "arguments": {
            "channel": "#engineering",
            "text": "Deployment is complete and staging is ready for validation."
        },
    },
).json()

print(response["successful"])
print(response["data"])

Next Steps