Skip to content

Invitations, organization settings and an organization of one's own in the app - #1700

Closed
davidmckayv wants to merge 9 commits into
mainfrom
orgs/own-organization-invitations-api
Closed

davidmckayv wants to merge 9 commits into
mainfrom
orgs/own-organization-invitations-api

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What changes

Everybody has an organization of their own, and people join another one by invitation.

  • Invitations. An owner or an admin of an organization invites an email address with a role. The person needs no account yet: the invitation waits for whoever signs in with that address. They list their invitations, read one, and accept or decline it. An invitation lasts seven days. The create answer says whether OpenBot emailed the person (emailed) or the inviter should pass the link on (link).
  • The address that added an existing person by email is replaced by invitations. addOrganizationMember is gone.
  • Rename. PATCH /api/v2/organizations/{organizationId}/profile gives an organization a new name. Its id and slug stay.
  • Remove a member, or leave. DELETE /api/v2/organizations/{organizationId}/members/{personId}, with me to leave. The owner stays.
  • Change a member's role. PATCH /api/v2/organizations/{organizationId}/members/{personId}. An owner makes another member an owner and can step down once another owner exists. The organization always keeps an owner, and a person's own organization keeps exactly its one.
  • Each member says whether their membership can end (removable) and which roles the caller may give them (assignableRoles). The members screen offers Leave, Remove and a Role menu by those, with a confirm for making an owner and for stepping down.
  • personal on an organization says whether it is the caller's own.
  • Anybody signed in may create another organization where OpenBot keeps more than one.

The caller's invitations sit at /api/v2/people/me/invitations, outside an organization's address, because a person answers one before they are a member. The lint rule that keeps every path under an organization allows these four paths beside the caller's own organizations.

For an app's token, the organizations list marks active the organization its OpenBot-Organization header names, or the caller's own with none. Only an API key has no active organization.

Screens

  • Account menu. The organizations are listed wherever OpenBot lists them, with the person's own marked. "Organization settings" opens the one they are working in, and "Invitations" shows with a count when any are waiting.
  • Organization settings (Settings, Organization). The name, renamed from a dialog by an owner or admin. Members with their roles, Remove for admins, Leave for a member. Invitations sent, with their state, Copy link and Cancel, and an Invite dialog that says whether OpenBot emailed the person or there is a link to pass on.
  • Invitations (/invitations). What is waiting for the person, with Accept and Decline. Accepting keeps them working where they were and offers the switch.
  • An invitation's link (/invitations/<id>). That one invitation in every state: waiting, accepted, declined, canceled, expired, or not found.
  • The link is kept across signing in. Somebody who opens it signed out, or with no account yet, signs in, answers onboarding and lands on the invitation. Only an invitation's own address is kept or followed.
  • The personal edition shows none of this.

Checks

  • bun run api:lint, bun run lint, bun run format:check and bun run typecheck pass.
  • Clients regenerated with bun run api:generate.
  • bun test app passes, with new tests for the data layer, the screens' states and the kept link.
  • Looked at on a running team stack with real sign-in, in Chromium and WebKit, light and dark, at 1440 and 700 wide: the account menu, organization settings as admin and as member, the invite dialog and its result, the invitations list, the link page in each state, and the emailed message. No screen scrolls sideways.
  • Driven end to end there: a new person signs in and has their own organization, an admin invites three addresses, one accepts from the emailed link and switches, one declines, one is canceled, and a person with no account opens the emailed link signed out and lands on the invitation after signing in.

Known

  • A person's brand-new organization has no Bots in it yet, so home says nobody has shared a Bot with them.
  • Skins that draw their own frame do not have the organization entries in their account menu.

@davidmckayv davidmckayv changed the title Invitations, renaming an organization and leaving one in the API Invitations, organization settings and an organization of one's own in the app Nov 15, 2026
Base automatically changed from orgs/organizations-api to main November 15, 2026 22:18
… API

An organization invites people by email address, and the person answers the invitation from their own list, before they are a member. The address that added an existing person by email is replaced by invitations. An organization says whether it is the caller's own, an admin can rename it, and a member can be removed or leave.
For an app's token the list marks active the organization its OpenBot-Organization header names, or the caller's own with none. Only an API key has no active organization. Switching with a token checks membership, stores nothing and answers the organization.
Organization settings (Settings, Organization) shows the organization the person is working in: its name, renamed from a dialog by its owner and admins, its members with their roles, and the invitations it sent with Copy link and Cancel. An owner or admin invites an address with a role and reads what happened in the same dialog: OpenBot emailed it, or there is a link to pass on. A member reads the name and the members, and may leave, after which the app works in another of their organizations from home.

Invitations lists what is waiting for the person, with Accept and Decline. Accepting keeps them working where they were and offers the switch. The page an invitation's link opens (/invitations/<id>) says what happened to that one invitation in every state, and what to check when there is none.

The account menu draws the organizations wherever OpenBot lists them, marks the person's own, and adds Organization settings and, when invitations are waiting, Invitations with their count. The personal edition shows none of this.
Somebody invited by email opens the link before they have signed in, or before they have an account. The invitation is remembered in the tab while they sign in and answer onboarding, and home hands them on to it once. Only an invitation's own address is kept or followed.
Adding an existing person by email was described before any release and is replaced by invitations, so the gate lets that one removal through.
A member says whether their membership can end, as the server's verdict: the owner stays, so nobody is offered to leave their own organization, and so does somebody OpenBot's settings keep as an admin. The members screen offers Leave and Remove by that.
An owner makes another member an owner, and can step down once another owner exists. The organization always keeps an owner, and a person's own organization keeps exactly its one. Each member says which roles the caller may give them.
Each member's row offers a Role menu listing the roles the API says the person looking may give them (assignableRoles), by name. Making somebody an owner, and stepping down from owner, are asked about first and say what it means. Other changes apply at once. A refusal is shown in its own sentence, in the dialog or under the members list. Rows with no assignable roles draw nothing extra.

The organizations list is read again after a change, because the role that changed can be the person's own.
@davidmckayv
davidmckayv force-pushed the orgs/own-organization-invitations-api branch from 77d6cef to 23616db Compare November 15, 2026 22:20
Remove took a person's access away on one click. It now opens a confirm dialog that names the person (their name, or their address when they have none) and says what ends: they are signed out everywhere and can't sign in again, and their API keys, app sign-ins and connected credentials stop working. Cancel changes nothing, the confirm button shows the pending state, and a refusal is said in the dialog. Restore still applies at once, since it ends nothing.

The Remove and Restore buttons are now named for the person they act on, so each row's button can be told apart.
davidmckayv added a commit that referenced this pull request Nov 16, 2026
…ory and Learning, one's own organization and invitations, teams, and Desktop connected to a remote OpenBot (#1705)

Organizations, phase 2, fused into one branch: each organization governs itself, memory and Learning are kept per organization, an organization of one's own at first sign-in with invitations, teams inside an organization, and OpenBot Desktop connected to an OpenBot that runs somewhere else.

This branch merges, at their current heads:

- #1701 Say in the spec and Admin that each organization governs itself
- #1697 Say in the API that memory and Learning are kept per organization
- #1700 Invitations, organization settings and an organization of one's own in the app
- #1699 Teams inside an organization: the API, the screens, and granting to a team
- #1698 Add an API keys page to Settings, and say what OAuth needs in the spec
- #1702 Connect OpenBot Desktop to an OpenBot that runs somewhere else
- main, with #1704

On top of the merges:

- The spec bundled once and the clients generated again from it, keeping every piece's additions in the shared spec files.
- The teams tests' organization and member fixtures carry the fields an organization and a member answer with (`personal`, `removable`, `assignableRoles`).
- The rust-toolchain action's pin is commented with the tag it is (`v1`), as the static analysis of the workflows asks.

Checked locally: format, lint, typecheck, API lint, the teams, Learning and audit tests.

Draft: the pieces' own PRs stay open; this lands them together after one end-to-end test.
@davidmckayv

Copy link
Copy Markdown
Contributor Author

Carried in #1705.

@davidmckayv
davidmckayv deleted the orgs/own-organization-invitations-api branch November 16, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant