feat(api): add GET /api/connections listing user app connections#8
Merged
matoushavlena merged 1 commit intomainfrom Apr 17, 2026
Merged
Conversation
Thin REST wrapper over the existing listConnections service function.
Returns {id, provider, label, status, scopes, metadata, connectedAt}
per connection, which is exactly the data the OneCLI dashboard already
uses via the getAppConnections server action.
Motivation: external consumers (e.g. the Humr agent platform) need to
(a) display a user's connected apps with identity metadata (email from
Google, login from GitHub, etc.) and (b) map the connection IDs
returned by /api/agents/{id}/connections back to their providers. The
existing /api/apps endpoint strips connection.id and metadata at the
response boundary, so neither use case is solvable without this route.
No schema changes, no service-layer changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
GET /api/connections, a thin REST wrapper over the existinglistConnections(accountId)service function. Returns the user's connected apps with{id, provider, label, status, scopes, metadata, connectedAt}— exactly the shape the dashboard already consumes via thegetAppConnectionsserver action.Motivation
External consumers (e.g. the Humr agent platform) currently cannot:
/api/agents/{id}/connectionsback to their providers/labels — `/api/apps` also strips connection.id, so there's no way to join the agent assignments to the connection listBoth problems disappear with this endpoint, which exposes the exact data the dashboard's
ManageAccessDialogalready uses.Changes
apps/web/src/app/api/connections/route.ts— 16 lines. GET only. UsesresolveApiAuth+handleServiceError+unauthorizedexactly like the existing/api/secretsroute.No schema changes, no service-layer changes, no validation schemas needed (read-only, no body).
Test plan
pnpm --filter @onecli/web run lint— cleanpnpm --filter @onecli/web run check-types— cleanpnpm exec prettier --checkon the new file — cleanGET /api/connectionswith a valid API token returns the authenticated account's connections (no credentials)Follow-up on Humr side
Once this merges and a new OneCLI image ships, Humr will:
/api/apps→/api/connections(drops theflattenAppsdefensive flattener)GET /api/connectionsandGET /api/agents/{id}/connections