Agents Hub SDK · integration guide

Every way an app can build on Agents Hub

One organization API key, a set of scopes, and a few signed events. An app can use Agents Hub only for its members' mailboxes and tokens, as an AI function that answers in JSON, or as the place its workflows run for every member. Pick the level you need, and the hosting model that fits the customer.

available already on develop PR #622 in the open app-integration PR idea not built, a direction
01 · Building blocks

What the SDK gives an app

Everything goes through one organization API key. A manager chooses its scopes, expiry and allowed IPs, and its webhook URL. Every call after provisioning acts as one member (hub.asMember(externalUserId)).

members:write

Members

Provision the app's users as organization members, or link existing ones after a manager approves.

connections

Connectors

Connect links for Google, Microsoft, Slack and more. Tokens stay in Agents Hub, encrypted; the app never holds one.

runs:*

Runs

Raise an action (send an email from the member's own mailbox, post to Slack…), approve it, follow it.

workflows:*

Member workflows

List, change and run a member's own workflows from the app.

mail:read

Mail events

mail.received for every new email in a linked member's mailbox, and a full-message read.

chat

Agent chat

Start and continue a chat as a member, with images and context. The agent uses that member's connections.

outputSchema · wait

Structured replies

Send a JSON Schema, get output back, checked with one retry. ?wait= or chat.replied: no polling.

workflows:org

Org workflows + actions

One definition, a copy per member. Integration steps call actions the app registered, signed.

Signed events to the key's webhook URL

EventWhenTypical use
run.updatedA run raised by the key changes status or a step runsShow "sent", "failed", retryavailable
mail.receivedA new email reaches a linked member's connected mailboxStore and match mail, trigger the app's own logicPR #622
chat.repliedA reply in a chat the key started is final (completed, failed, or could not queue)Long agent turns without pollingPR #622
action.callAn integration step of an org workflow runs; synchronous, 15 s, idempotency keyCreate a record in the app, answer with its idPR #622

All are HMAC-SHA256 signed over <timestamp>.<raw body>; verifyWebhook() in the SDK checks them. Deliveries can repeat: dedupe on the event id.

02 · Integration levels

From "just the tokens" to "run it all"

Each level adds to the one before. Most apps start at the top and stop where the app's own logic wants to stay in charge.

LEVEL 1

Connectors only

Agents Hub is the member's token vault and outbox. No AI involved.

Scopesmembers:writeconnectionsruns:raiseruns:approveruns:read
Eventsrun.updated
Statusavailable
Appconnect link →Agents HubOAuth →Google / Microsoft / Slack← raise run · run.updated →App
const ana = hub.asMember("usr_123");
const { authorizeUrl } = await ana.connections.start("google", { returnUrl });
// later, for a reply a person approved in the app:
await ana.runs.raise({ externalRef: `inquiry:42`, steps: [{ key: "reply", actionType: "email", payload }], approve: true });
Send as the salespersonReplies leave from the user's own Gmail, threaded, without the app storing a token.
One consent screenThe org's Google/Slack apps are already verified; the app ships no OAuth app of its own.
Audit for freeEvery run records the key and member behind it.
LEVEL 2

Events only

The app listens to members' mailboxes and keeps its own records. Still no AI.

Scopesmail:read (+ level 1 to connect)
Eventsmail.received
StatusPR #622
New email→Agents Hubmail.received →App webhookread message →App's own DB
const event = await verifyWebhook({ secret, rawBody, headers });
if (isMailReceivedEvent(event)) {
  const msg = await hub.asMember(event.data.member.externalUserId)
    .request("GET", `/connections/${event.data.connectionId}/messages/${event.data.messageId}`);
  await storeAndMatch(msg); // match to contacts by address
}
Customer timelineEmails matched to contacts show in the activity log and on the customer (Podkrižnik does this).
Follow-up remindersA customer writing in pushes their follow-up date back.
Shared inboxMail to info@ on one member's connection lands in the CRM.
LEVEL 3

Raw chat: AI as a function

One call in, JSON out, on the organization's AI subscription. The app decides what to do with the answer.

Scopeschat
Eventschat.replied (only for slow turns)
StatusPR #622
AppPOST /cases/agent?wait=20 + outputSchema →Agents Hub→Robodev agent← reply.output
const chat = await ana.chats.create(
  { mode: "task", prompt, attachments: [photo], outputSchema: CARDS_SCHEMA },
  { wait: 20 },
);
const cards = chat.reply?.output; // valid against the schema, or chat.reply.outputError
await ana.request("POST", `/cases/${chat.id}/agent/complete`); // keep it out of the member's open chats
Business card scannerOCR lines in, structured contacts out (Podkrižnik's card reader).
Document extractionInvoice, order or drawing fields from a PDF or photo.
Classify or route"Is this an inquiry, which product, how urgent?" as an enum.
Draft textA reply or summary the app then shows for review.

Good

  • No workflow to set up; the app keeps full control
  • Answers in one request (up to 25 s)
  • The agent can still use the member's tools if the prompt needs them

Mind

  • Each call is a chat (a case) the member can see in Agents Hub; mark it done
  • Runs as one member: needs a linked member
  • Slower than a bare model call; keep a fallback for hard deadlines
LEVEL 4

Events + chat: the app orchestrates

Levels 2 and 3 together. The app reacts to mail with an agent call and writes its own records. No Agents Hub workflow.

Scopesmail:readchat
Eventsmail.receivedchat.replied
StatusPR #622
mail.received→App: worth a model call?→ chat + schema →Agents Hub→ output →App review screen
if (isMailReceivedEvent(event) && looksRelevant(event.data)) {
  const chat = await member.chats.create(
    { mode: "task", prompt: triagePrompt(message), outputSchema: INQUIRY_SCHEMA }, { wait: 20 });
  if (chat.reply?.output?.isInquiry) await createAgentRequest(chat.reply.output);
}
Inquiry triage, app-sideSame result as the Inquiry intake workflow, with the app's own rules and review UI.
Smart CRM updatesExtract a new phone number or address from a signature and propose the change.
Lead scoringScore every new email against the pipeline and flag hot ones.

Good

  • Product logic stays in the app's code and tests
  • The app decides which mail costs a model call

Mind

  • The app builds what Agents Hub otherwise gives: review, retries, per-member off switch
  • No Agents Hub inbox entry; nothing for the member to approve there
LEVEL 5

Embedded assistant

A full conversation inside the app: the member's agent, their connections, proposals they apply.

Scopeschat (+runs:approve to apply, workflows:write to change workflows)
Eventschat.replied
StatusPR #622
App's Ask pagesend ?wait →Agents Hub chattools →Gmail · Slack · app's MCPchat.replied →App
const convo = await ana.chats.send(chatId, { text, clientMessageId }, { wait: 20 });
// longer turns: the chat.replied webhook marks the chat; the page re-reads once.
await ana.request("POST", `/cases/${chatId}/agent/proposals/${proposalId}/apply`);
"Which customers still need a reply?"Answers from the CRM when the member connected the app's MCP server in Agents Hub.
Do it for meThe agent proposes a Slack post or email; the member applies it in the app.
Build an automation"Every Monday, send me open offers" becomes a workflow proposal.

The agent is held to the key's scopes: without workflows:write a workflow proposal waits for the member in Agents Hub; without runs:raise it starts no runs.

LEVEL 6

Managed workflows

The app pushes one workflow; Agents Hub runs a copy for every member, with its inbox, approvals and history.

Scopesworkflows:org
Eventsaction.callrun.updated
StatusPR #622
AppPUT /org-api/workflows/:key →Org workflowsync →Copy per memberintegration step · action.call →App action
// The actions integration steps may call (replaces the key's whole set):
await hub.request("PUT", "/org-api/actions", { body: [{ key: "inquiry.create", title, description, inputSchema }] });
await hub.request("PUT", "/org-api/workflows/inquiry-intake", { body: {
  enabled: true, memberCanDisable: true, target: { mode: "all" },
  workflow: { name: "Inquiry intake", trigger: "email", classificationHint, prepareInstruction,
    steps: [{ key: "create-inquiry", actionType: "integration",
      config: { source: "podkriznik", action: "inquiry.create", autoApprove: true } }] },
} });
Inquiry intake for the whole sales teamEvery member's mailbox, one definition, an admin switch in the app.
Company-wide policies"File every invoice in Drive and post it to #finance", owned by the app.
OnboardingNew members get the standard workflows the moment they are provisioned.

Good

  • Agents Hub handles triggers, retries, review, approvals, audit
  • Members see and can switch off their copy

Mind

  • Logic lives in a workflow definition, not the app's code
  • Integration steps can't be added in the editors yet (API only)
LEVEL 0

No SDK: the app as a connector

The app only exposes an MCP server. Members add it in Agents Hub and build their own workflows and chats on top.

Scopesnone (no API key)
Needsan MCP server with OAuth (Podkrižnik has one: every CRM route is a tool)
Statusavailable
Memberadds MCP →Agents Hubtool calls as the member →App's MCP server
Power usersA salesperson builds "log every customer email as a note" themselves.
Org catalogA manager adds the app's MCP to the organization's MCP catalog for one-click connect.
Pairs with level 5The embedded assistant reads the app's data through it.

idea Let organization workflows use an MCP step by server URL, resolved to each member's own connection. Today org workflows refuse MCP steps because MCP connections are per member.

03 · Compare

Who does what at each level

1 Connectors2 Events3 Raw chat4 Events + chat5 Assistant6 Managed0 MCP only
Holds the tokensAgents HubAgents HubAgents HubAgents HubAgents HubAgents HubAgents Hub
Uses AInonoper callper relevant emailper messageper triggered runmember's choice
Business logic inappappappappagent + appworkflowmember
Review / approval UIapp—appappappAgents Hub or appAgents Hub
Creates a casea runnoa chata chata chata run per triggerdepends
Polling neededno (run.updated)nono (wait)nono (chat.replied)no (action.call)no
Member can switch off—disconnect—app's own switch—per copyremove MCP
04 · Which one?

Pick by the question you are answering

"Send email or Slack as our users, without us storing tokens."Level 1
"Show customer emails in our CRM."Level 2
"Turn this photo, PDF or text into fields."Level 3
"Act on incoming mail with our own rules and screens."Level 4
"Give users an assistant inside our app."Level 5
"Same automation for the whole team, with approvals and audit."Level 6
"Let users wire our app into their own automations."Level 0
05 · Hosting

Where it runs

The SDK calls are the same everywhere; only the base URL and key change. What moves is who runs Agents Hub, whose OAuth apps the consent screen shows, and where the agents and models run.

customer's infrastructurePovio / Agents Hubthird party
available

A. Shared cloud

Each customer is an organization on mission-control.povio.dev. Members, keys, catalogs and workflows are per organization.

Customer app (e.g. Podkrižnik on Robodev)their side
Agents Hub API + PostgresPovio, multi-tenant
Google / Slack OAuth appsPovio's
Robodev managed agents + modelorg's AI subscription
  • Fastest start; nothing to operate
  • Consent screens say "Agents Hub"
idea

B. Shared cloud, own OAuth apps

Same tenant, but the organization brings its own Google Workspace / Slack OAuth client, so consent shows the customer's name and their admin controls access.

Customer apptheir side
Agents Hub API + PostgresPovio, multi-tenant
Google / Slack OAuth appscustomer's own
Robodev managed agents + modelorg's AI subscription
  • Fits Workspace admins who allowlist apps
  • Needs per-org OAuth client settings in Agents Hub
idea

C. Dedicated tenant, hosted by Povio

A separate Agents Hub instance and database for one customer, in a region they choose. Same image as production.

Customer apptheir side
Agents Hub API + PostgresPovio, single-tenant
OAuth appscustomer's or Povio's
Robodev managed agents + modelshared or dedicated
  • Data isolation and residency without running it themselves
  • One more stack to deploy, upgrade and monitor per customer
idea

D. Self-hosted on premises

Everything runs on the customer's machines: the production setup is already one host with Docker Compose (Traefik, the API + SPA container, Postgres).

Customer appon prem
Agents Hub (Compose: Traefik · API/SPA · Postgres)on prem
OAuth apps, Gmail push (Pub/Sub)customer's
Agent runtime + modelon prem AI agent
  • Agents Hub itself is ready for it: one image, one .env, secrets generated on the host
  • The missing piece is the agents: they run on Robodev managed agents today, so on-prem also needs a self-hosted agent runtime (or a local model behind one)
  • Customer also runs their own Google/Microsoft/Slack apps and mail push

What changes for the app between hosting models

A SharedB Own OAuthC DedicatedD On prem
AGENTS_HUB_URLsharedsharedcustomer's instancecustomer's instance
API key, scopes, webhookssame everywhere
Consent screen showsAgents Hubcustomereithercustomer
Data leaves the customeryesyesto a dedicated stackno (if agents run on prem too)
Who operates itPovioPovioPoviocustomer (or Povio remotely)
06 · Example

Podkrižnik uses almost every level

Level 1

Connect + send

Salespeople connect Google under Automations; approved inquiry replies go out from their own mailbox.

Level 2

Mail in the CRM

Every new email becomes an activity on the matching contact and customer, marked "via Agents Hub".

Level 3

Card scanner

OCR lines go to a chat with the cards schema and ?wait=20; the fields come back in the same request.

Level 5

Ask

An assistant page in the CRM; replies come with wait or the chat.replied webhook.

Level 6

Inquiry intake

An admin turns it on; every member's copy drafts an agent request through the inquiry.create action.

Level 0

Podkrižnik MCP

Members can add the CRM's MCP server in Agents Hub and build their own workflows on it.