Use connected apps (Connect Hub)
Send an email, add a row, post a message: 3,000 apps through the user's own connected accounts, with credentials that never leave the platform.
A user connects an app once at Connections. From then on any door can list that app's actions, read the parameter schema, and run an action with the connected account. Each call uses one Connect Hub credit plus whatever the app itself charges.
Four calls cover everything: browse apps, list an app's actions, get one action's parameters, run it.
Three ways to run it
import { Prompteryx } from '@prompteryx/sdk'
const px = new Prompteryx({ apiKey: process.env.PROMPTERYX_API_KEY })
const apps = await px.connectHub.listApps({ search: 'gmail' }) // [{ slug: 'gmail', name: 'Gmail', … }]
const actions = await px.connectHub.listActions('gmail') // [{ action: 'gmail-send-email', name: 'Send Email', parameters: {…} }]
const accounts = await px.connectHub.listAccounts() // the user's connected accounts
const sent = await px.connectHub.run({
app: 'gmail',
action: 'gmail-send-email',
params: { to: 'hello@example.com', subject: 'Hi from Prompteryx', body: 'Sent through Connect Hub' },
credentialId: accounts[0]?.id, // only needed when several accounts are connected for the app
})npx prompteryx apps list --search gmail
npx prompteryx apps actions gmail
npx prompteryx apps accounts
npx prompteryx apps run gmail gmail-send-email --params '{"to":"hello@example.com","subject":"Hi","body":"From the CLI"}'curl "https://www.prompteryx.ai/api/v1/connect-hub/apps?q=gmail" -H "Authorization: Bearer px_live_YOUR_KEY"
curl https://www.prompteryx.ai/api/v1/connect-hub/apps/gmail/actions -H "Authorization: Bearer px_live_YOUR_KEY"
curl https://www.prompteryx.ai/api/v1/connect-hub/accounts -H "Authorization: Bearer px_live_YOUR_KEY"
curl -X POST https://www.prompteryx.ai/api/v1/connect-hub/run \
-H "Authorization: Bearer px_live_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"app":"gmail","action":"gmail-send-email","params":{"to":"hello@example.com","subject":"Hi","body":"Hello"}}'"Email hello@example.com the summary above using my Gmail."
# connect_hub_list_accounts → connect_hub_get_action → connect_hub_run_action.
# If the app is not connected yet, the assistant tells the user where to connect it.429 QUOTA_EXCEEDED: the monthly allowance (and any purchased calls) or the daily limit is used up. The Retry-After header and error.details.resetAt say when it resets; purchased Connect Hub calls are used once the plan allowance runs out.
402 QUOTA_EXCEEDED: the account's plan does not include Connect Hub.
403 FORBIDDEN: Connect Hub is paused on this account. Contact support.
404 NOT_FOUND on an action: check the key with the actions call; both gmail-send-email and gmail_send_email spellings are accepted.
An empty accounts list: the user has not connected that app yet.