Organizations and installations
Organizations provide a shared scope for app installations. The Organization service lets an authorized client inspect the installations in the current organization and lets organization owners add, refresh, or remove those app connections. This page covers the installation lifecycle; organization membership and roles provide the access rules for it.
Organization installation model
An organization installation records an app connection and the access granted to that app. The record links the app to its organization context and keeps the granted scopes, optional authorization details, creator information, and access history together.
The installation result contains the following main information:
| Information | Purpose |
|---|---|
| Installation ID | Identifies one installation for later reads, updates, or removal. |
| App ID | Identifies the installed app. |
| Granted scopes | Shows the access snapshot granted to the app. |
| Authorization details | Carries richer app-specific authorization data. |
| Creator and access time | Shows who created the installation and whether it has issued an access token. |
The shared AppInstallation model also serves team installations. For an organization, the owning scope is implied by the organization service rather than passed as a team ID.
References: src/models.ts• L1245-1279 src/…/organization.ts• L6-10
Installation lifecycle
The organization installation lifecycle is exposed as one resource flow. A member can read the collection or one installation. An owner can create the connection, refresh its grant, or remove it.
The following diagram shows how an app connection moves through the organization lifecycle.
flowchart LR
A[Organization owner] --> B[Create installation]
B --> C[Active installation]
C --> D[Organization member lists or reads]
C --> E[Organization owner updates]
E --> C
C --> F[Organization owner deletes]
F --> G[Installation removed]
The lifecycle has two access levels:
| Operation group | Organization access |
|---|---|
| List and get | Any organization member can read installations. |
| Create, update, and delete | Only an organization member with the owner role can change installations. |
References: src/…/organization.ts• L11-18 src/…/organization.ts• L85-91 src/…/organization.ts• L164-170 src/…/organization.ts• L226-232 src/…/organization.ts• L306-312
Installation creation
Creation installs an app in the organization and returns the new installation record. The app ID is required. Authorization details are optional and can carry the app's richer authorization request data.
Creation grants the scopes that the app requests at that time. The resulting record is therefore the starting point for the app's access in the organization and for later scope refreshes.
References: src/…/organization.ts• L85-162 docs/…/create-installation.md• L1-16
Installation retrieval
Retrieval supports both a collection view and a single-resource view. Listing returns matching installations with a total count and can accept query rules; reading one installation uses its installation ID.
The list operation can omit the total calculation when the caller only needs the matching records. This supports collection reads where a count is not needed.
References: src/…/organization.ts• L11-83 src/…/organization.ts• L164-224 src/models.ts• L1380-1390 docs/…/list-installations.md• L1-16 docs/…/get-installation.md• L1-15
Installation update
Update changes an existing installation's authorization details and refreshes its granted scopes to the app's current requested scopes. If authorization details are omitted, the current value remains in place.
Refreshing an installation also revokes access tokens issued before the update. Consumers must treat the update as an access change rather than as a metadata-only edit.
References: src/…/organization.ts• L226-304 docs/…/update-installation.md• L1-16
Installation deletion
Deletion uninstalls the app from the organization by installation ID. It removes the organization-level app connection and revokes access tokens that the installation issued before deletion.
Deletion is the terminal lifecycle action for that installation. A later connection requires a new creation request and a new installation record.
References: src/…/organization.ts• L306-366 docs/…/delete-installation.md• L1-15
Organization service boundary
The Organization service is the SDK boundary for organization-level installation actions. It is exported from the package entry point so callers can create it with the shared client and use the same request and error model as the other services.
The service keeps organization scope in the request path. Callers provide the app or installation identity for the requested lifecycle action, while the authenticated client and project context determine the organization and access decision.
References: src/index.ts• L1-15 src/…/organization.ts• L62-82 src/…/organization.ts• L140-162
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the
AppInstallationfields and the list wrapper aligned with the create, read, update, and delete response contracts. - Preserve the difference between member read access and owner write access when changing organization installation actions.
- Treat scope refresh and token revocation as one contract when changing installation updates or deletion.
- Keep organization installation paths distinct from team installation paths, even though both use the shared installation model.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A non-owner tries to create, update, or delete an installation | The organization rejects the write action. | Check the caller's organization role before changing installation state. |
| A required app ID or installation ID is missing | The SDK raises a missing-parameter error before it sends the request. | Supply the ID that matches the lifecycle action. |
| An installation is updated or deleted while an old access token is still in use | Previously issued installation access is revoked. | Reacquire access after a successful update or create a new installation after deletion. |
| A collection read requests an unnecessary total count | The service performs count work that the caller does not need. | Set the list option that disables total calculation when only records are needed. |
Key files
| File | Why to read it |
|---|---|
| src/…/organization.ts | Defines the organization installation lifecycle and its access rules. |
| src/models.ts | Defines the installation record and collection response shape. |
| src/index.ts | Shows the public package entry point for the organization service. |
| docs/…/create-installation.md | Shows the organization installation creation flow. |
| docs/…/list-installations.md | Shows collection retrieval and optional list controls. |
| docs/…/update-installation.md | Shows authorization update input. |
| docs/…/delete-installation.md | Shows terminal removal of an installation. |