.agents/features/global-connections.md
Global Connections are app connections scoped to a platform rather than an individual project (AppConnectionScope.PLATFORM). They can be shared across multiple projects simultaneously, eliminating the need for each project to re-authenticate the same service account. A platform admin creates or updates global connections; they are then accessible to any project listed in the connection's projectIds array (or pre-selected for new projects if preSelectForNewProjects is true). Gated by platform.plan.globalConnectionsEnabled.
packages/server/api/src/app/ee/global-connections/global-connection-module.ts — module + controller (no separate controller file; both are in the module file)packages/server/api/src/app/ee/app-connection/app-connection-service/app-connection-service.ts — shared connection service used by global connections (with scope: PLATFORM)packages/shared/src/lib/ — uses existing AppConnectionWithoutSensitiveData, UpsertGlobalConnectionRequestBody, UpdateGlobalConnectionValueRequestBody, ListGlobalConnectionsRequestQuery types from sharedEnterprise and Cloud. Gated by platform.plan.globalConnectionsEnabled. Module hook: platformMustHaveFeatureEnabled((platform) => platform.plan.globalConnectionsEnabled).
AppConnection with scope = PLATFORM, owned by the platform rather than a project.All mount under /v1/global-connections. All require platformAdminOnly (USER or SERVICE principal). All endpoints also accept service key authentication (SERVICE_KEY_SECURITY_OPENAPI).
| Method | Path | Auth | Response | Description |
|---|---|---|---|---|
| POST | /v1/global-connections | Platform admin (USER or SERVICE) | AppConnectionWithoutSensitiveData (201) | Upsert a global connection |
| POST | /v1/global-connections/:id | Platform admin (USER or SERVICE) | AppConnectionWithoutSensitiveData | Update metadata (displayName, projectIds) |
| GET | /v1/global-connections | Platform admin (USER or SERVICE) | SeekPage<AppConnectionWithoutSensitiveData> | List global connections for platform |
| DELETE | /v1/global-connections/:id | Platform admin (USER or SERVICE) | 204 No Content | Delete a global connection |
Query parameters for list: { displayName?, pieceName?, status?, cursor?, limit? }.
The module delegates all operations to appConnectionService with scope: AppConnectionScope.PLATFORM and projectId: null:
appConnectionService.upsert({ ..., scope: PLATFORM, platformId }). Fires CONNECTION_UPSERTED audit event.appConnectionService.update({ ..., scope: PLATFORM, projectId: null }). Only updates displayName, projectIds, and preSelectForNewProjects.appConnectionService.list({ ..., scope: PLATFORM, platformId, projectId: null }) then strips sensitive data.appConnectionService.delete({ ..., scope: PLATFORM, projectId: null }). Fires CONNECTION_DELETED audit event.app_connection table as project-scoped connections; the scope column distinguishes them.appConnectionService.list call is made with the project's ID and scope filtering handles visibility.