Skip to main content
This guide grants an agent read access to a single scope on one connected account, and revokes it when the task is done.
Connecting a source works in the app today. The API steps that share a connection with an agent are in preview.

Prerequisites

  • An ego account with the app running. See the project README to run it locally.
  • The source you want to share. This guide uses a Google account.

Connect the source

  1. Open the app and go to Integrations.
  2. Select Connect on the Google card.
  3. Sign in to the Google account and approve only the scopes you intend to share, such as gmail.readonly.
The account now shows as active in your connections, holding just the scopes you approved. ego stores which account and which scopes; the OAuth tokens stay outside your reach.

Hand the scope to an agent

Give the agent an API key and the connection it may read. The agent calls the ego API with that key and never sees the underlying token.
curl https://api.myego.dev/v1/connections \
  -H "Authorization: Bearer $EGO_API_KEY"
The agent reads through ego from then on, so every request it makes is scoped to that connection and logged.

Revoke when done

Disconnect the account from Integrations in the app. ego revokes the grant at the source and drops the connection, so the key and the agent lose access at once.

Next steps

API reference

The endpoints behind these grants.

Quickstart

Make your first request.