Repository navigation
API: delete an organization, and hold keys, events, the Recorder, push and the realtime socket to one organization - #1897
Open
davidmckayv wants to merge 3 commits into
Open
davidmckayv wants to merge 3 commits into
davidmckayv wants to merge 3 commits into
Conversation
…an be held to one organization
Adds deleteOrganization (DELETE .../profile), refusing a person's own organization and default; organizationOnly on a new API key and organizationId on a key; organizationId on conversation events and on a Recorder connection; the realtime socket relayed at /api/v2/organizations/{organizationId}/realtime/websocket; and says a push device is registered per organization. Deprecates the role property of updatePerson in favour of updateOrganizationMember, sunset 2028-05-19, and reserves Intelligence's /api/v2/platform root.
Drops organizationOnly from a new key: every key is bound to the organization it was made in, and a key with no binding acts in default. ApiKey.organizationId says which, and createApiKey, the apiKey scheme and the changelog say so.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 19, 2026 21:26
…ng the network in tests The support-window tests assumed the spec deprecates nothing, and their run of the check looked every release's spec up by tag, fetching each from GitHub once the spec marks something deprecated: it timed out in CI. SUPPORT_WINDOW_RELEASE_SPECS reads release specs from a directory instead, which the test points at its fixtures, and the tests now find the real deprecation of updatePerson's role.
This branch has not been deployed
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.
The API additions for one person working in several organizations, with nothing shared between them. Spec only: sources, bundle and every generated client, plus the changelog. All of it is additive under
/api/v2.What changes
Delete an organization.
deleteOrganization,DELETE /api/v2/organizations/{organizationId}/profile, besideupdateOrganization. 204 when deleted. Owner only (403OwnerOnly). A person's own organization anddefaultare refused with 409OrganizationStays(CONFLICT). 503OrganizationNotDeletedwhen it couldn't be finished.An API key acts in the organization it was made in.
ApiKey.organizationId(optional, nullable: null for a key made before keys were bound, which acts indefault).createApiKeyand theapiKeyscheme say a key is refused in any other organization. Every install in the field has onlydefault, so no existing key behaves differently.Conversation events name their organization.
ConversationActivity.organizationId(optional) inapi/asyncapi.yaml. A client ignores a message for another organization.A Recorder connection names its organization.
RecorderConnectionGrant.organizationId(optional): the organization the connect code was made in.Push devices are registered per organization.
registerDevice,listDevicesanddeleteDevicewere already under the organization's address; their descriptions now say a device gets push notifications only from the person's Bots in that organization.The realtime socket at an organization address.
/api/v2/organizations/{organizationId}/realtime/websocketrelays the same socket as/api/intelligence/client/websocket, for a member of that organization: new channelsorganizationThreadStreamandorganizationTrajectoryCaptureand their operations.realtimeis clear ofapi/intelligence-reserved.yaml, which now also reserves the/api/v2/platformroot.Deprecated: the
roleproperty ofupdatePerson, in favour ofupdateOrganizationMember.x-deprecation-date2026-11-19,x-sunset2028-05-19, listed in the changelog's Deprecated list. The sunset leaves room for the release that first serves it, since the support window counts 365 days from that release.The support window's tests hold a real deprecation. This is the spec's first deprecation.
tests/support-window.test.tsassumed the spec deprecates nothing. Its run of the check also looked up each release's spec by tag, which fetches from GitHub once anything is deprecated, so it timed out in CI.SUPPORT_WINDOW_RELEASE_SPECSnow lets the check read release specs from a directory, the test points it at its fixtures, and the tests find the realroledeprecation. CI'sAPI specjob still reads the real release specs by tag.Checked locally
bun run api:generate: sources, bundle and clients committed together.bun run api:lint: valid.--fail-on WARN, 365-day deprecation window: no breaking change againstmain, v1.1.1 or v1.1.0 (no older release has a spec).scripts/support-window.ts check: the window holds, 1 deprecation.api:live:diffagainstmain'sasyncapi.yaml: no change breaks a client.bun test api/ shared/tests/api-deprecations.test.ts app/tests/tolerant-reader.test.ts tests/no-intelligence-in-user-copy.test.ts: 99 pass.bun run typecheck,bun run format:check: clean.