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.
Python
import os
base_url = os.getenv("DATAFUSE_API_URL", "https://api.datafuse.xyz")
token = os.getenv("DF_TOKEN", "")
headers = {
"Authorization": f"Bearer {token}",
}
TypeScript
const baseUrl = process.env.DATAFUSE_API_URL || 'https://api.datafuse.xyz'
const token = process.env.DF_TOKEN || ''
const headers = {
Authorization: `Bearer ${token}`
}
Step 2: List Integrations
Use the integrations endpoint to find the connection you want to execute against.
Python
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}")
TypeScript
const integrations = await fetch(baseUrl + '/api/v1/integrations', {
headers
}).then((response) => response.json())
const integrationId = integrations.items?.[0]?.id
console.log(`Using integration ${integrationId}`)
!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.
Python
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}")
TypeScript
const tools = await fetch(baseUrl + `/api/v1/integrations/${integrationId}/resolve-tools`, {
method: 'POST',
headers
}).then((response) => response.json())
const toolKey = tools[0]?.slug
console.log(`Resolved tool: ${toolKey}`)
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.
Python
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"])
TypeScript
const response = await fetch(baseUrl + `/api/v1/integrations/${integrationId}/invoke`, {
method: 'POST',
headers: {
...headers,
'Content-Type': 'application/json'
},
body: JSON.stringify({
tool_key: toolKey,
arguments: {
channel: '#engineering',
text: 'Deployment is complete and staging is ready for validation.'
}
})
}).then((result) => result.json())
console.log(response.successful)
console.log(response.data)
Next Steps
- Open the curl quickstart if you want the same flow from the terminal.
- Review the client overview for the shared v1 route surface.
- Continue to Managed Authentication if you need to create connected accounts first.