Skip to content
Agents API
Tools and integrations

Platform connections

Give an API Agent access to accounts already connected in Rebyte, with authorization managed by the platform.

On this pageAdd an existing connectionPersonal and Organization accessRun the Agent from your applicationOAuth and credential ownershipUpdating tools and existing SessionsRemove or reconnect

Connect an account in Rebyte, add it to an API Agent in Platform, then run that Agent from your application. The Agent can use the selected account without your application collecting access tokens, copying secrets into a Vault, or implementing a second OAuth flow.

This is a Rebyte extension to the Agents API. It combines a person choosing and authorizing a connection in Platform with an application creating Sessions through the API.

Add an existing connection

  1. Open Platform → Agents in the organization that owns your API Agent, and select the Agent. You can use an Agent you previously created through the API.
  2. Expand Configuration and find Connections. This section lists the connections already added to the Agent.
  3. Click Add connection to open the selection dialog. Search or browse your existing Personal and Organization connections. Entries marked Added are already attached and cannot be selected again.
  4. Select a connection, review the account-access notice, and click Add to Agent.
  5. Start a New session in Platform or create a Session through the API with this Agent's ID.

If the account is not listed, use Manage connections to connect it in Settings, then return to the Agent. The picker offers supported remote MCP connections and supported connected apps; it does not expose every product integration or channel connection.

Personal and Organization access

ConnectionWhat you can selectWhat adding it grants
PersonalYour own connected accounts in the current organization. Other users' personal accounts are not available in the picker.This organization's API Agent and its API callers can use your selected account.
OrganizationShared connections in the current organization.This API Agent can use the selected shared account.

Adding a Personal connection is an explicit delegation. A Session started with an organization API key uses the attached account, even when the caller is not the person who originally connected it. Only add accounts you intend this Agent's callers to use.

Rebyte stores an organization-bound connection reference in the Agent's tools. Provider access tokens, refresh tokens, and API secrets are not returned in the Agent definition. Treat the reference as delegated access, not as a public identifier to distribute outside your application.

Run the Agent from your application

After adding a connection in Platform, keep your organization API key on your application server and use the saved Agent ID:

import Rebyte from '@rebyteai/agent-sdk';

const client = new Rebyte(); // Reads REBYTE_API_KEY.
const agentId = 'agent_...'; // The Agent you configured in Platform.

const stream = await client.beta.agents.sessions.create({
  agent_id: agentId,
  input: 'Use the connected Google Drive account to find my latest report.',
  stream: true,
});

for await (const event of stream) {
  if (event.type === 'agent.session.turn.output_text.delta') {
    process.stdout.write(event.delta);
  }
  if (event.type === 'agent.session.turn.failed' ||
      event.type === 'agent.session.failed') {
    throw new Error(JSON.stringify(event));
  }
}

Omit agent.tools to inherit the saved Agent's tools, including its attached connections. These connections run through the service and do not require an environment or create a Sandbox. Tool discovery and calls use the normal MCP search and execution flow.

Sessions still have independent conversation and execution state. Attaching the same connection gives them access to the same external account; it does not create a separate Google Drive, mailbox, or other provider account for each Session.

OAuth and credential ownership

The existing platform connection manages authentication. OAuth connections continue using their existing refresh mechanism; your API application does not need to extract or refresh their tokens. Revoked consent or a connection that can no longer authenticate requires reconnection in Settings.

For this path, no vault_ids or inline transport.authorization is needed. Use Vaults or Session HTTP authentication when your application supplies and manages the credentials itself.

Updating tools and existing Sessions

Platform and the API edit the same saved Agent configuration. There is no separate hidden list of attached connections.

ActionEffect
Add or remove a connection in PlatformChanges the saved Agent's tools for new Sessions. Existing Sessions retain their configuration snapshot.
Update an Agent through the API without toolsPreserves its current tools and connection references.
Update an Agent with toolsReplaces the entire tool list, including Platform-added connections. Include every tool and connection reference you want to keep.
Create a Session with agent.toolsReplaces the inherited tool list for that Session only. The saved Agent is unchanged.
Supply tools: []Clears the tool list at the level being configured.

For example, updating just the instructions preserves the attached connections:

await client.beta.agents.update(agentId, {
  instructions: 'Use connected accounts for read-only research.',
});

To replace tools while retaining connections, retrieve the current Agent first and preserve the corresponding MCP entries unchanged. Their transport has type: 'connection' and an opaque connection_id. Keep the full entry, including server_label; do not manufacture a reference from a connection's database ID or a provider token. These references are valid only within their organization.

Remove or reconnect

Click Remove beside an attached connection and confirm. This removes it from the Agent for new Sessions; it does not disconnect the source account or remove the reference from existing Sessions.

A Session's configuration snapshot does not preserve a revoked credential. The runtime checks the selected source connection again when it is used. If that connection is deleted or no longer available, calls fail rather than switching to another account. Reconnect in Settings and attach the connection again in Platform, then start a new Session.