Stacklink

Connect an end-user account

Run a tenant through the hosted connect flow and reuse the account.

To act on a provider on behalf of your end-user, that user authorizes their account once through Stacklink's hosted connect flow. You never see or store the credential.

Find the provider from the end-user task

The agent describes the task. Stacklink resolves the canonical provider and returns a signed connection reference. The model never supplies a provider key.

const result = await session.search({
  queries: [{
    id: 'list-invoices',
    task: 'List recent Zoho Books invoices',
    providerHint: { label: 'Zoho Books' },
  }],
});
const connectionRef = result.results[0].nextAction?.connectionRef;

Start the connection from a session

const request = await session.authorize(connectionRef);
return redirect(request.redirectUrl); // send your user here
result=$(curl -sS -X POST http://localhost:4100/v1/sessions/<sessionId>/tools/search \
  -H "authorization: Bearer $STACKLINK_API_KEY" \
  -H "content-type: application/json" \
  -d '{"queries":[{"id":"list-invoices","task":"List recent Zoho Books invoices","providerHint":{"label":"Zoho Books"}}]}')

curl -X POST http://localhost:4100/v1/sessions/<sessionId>/connections/authorize \
  -H "authorization: Bearer $STACKLINK_API_KEY" \
  -H "content-type: application/json" \
  -d '{"connectionRef":"<connectionRef from result.results[0].nextAction>"}'

The user completes auth

At redirectUrl the signed-in user sees the exact provider and project. Their confirmation enables first-time project access and starts OAuth or credential entry. Calling authorize alone changes no project or provider state.

Wait for completion

const account = await request.waitForConnection();
// account.id, account.status === 'connected'
curl http://localhost:4100/v1/connection-requests/<requestId> \
  -H "authorization: Bearer $STACKLINK_API_KEY"

Reuse it forever

Future agent sessions use a signed accountRef returned by Stacklink when more than one account is available. Trusted application APIs may continue using account IDs. No re-auth is needed until the credential actually expires.

Credential-backed modes available today

sandbox, whatsapp_business, and razorpay support API-key and webhook-secret connections. OAuth2 providers are represented in the contract; provider-specific authorization adapters are rolling out per provider.

✦ Free plan

Run this flow end-to-end, free

The whole connect flow — authorize, redirect, poll, execute — runs on the free plan's 20,000 monthly standard ops, hard-capped.

Get your API key todayNo credit card or UPI mandate required

On this page