# Bring people into a workspace

A workspace owner can invite people, manage roles and remove members using the
CLI, Python SDK or MCP. Workspace settings also offers a copyable invitation link.

After signing in, create an invitation.

```sh
op-sys invitations create --workspace-id <workspace-id> --email colleague@example.com
```

Share the returned invitation link with the intended recipient. The link lets
them review the workspace name, Member role and expiry before sign-in. To join,
they sign in with the verified email address you invited.

```sh
op-sys invitations inspect --invitation "$INVITATION_URL"
op-sys invitations accept --invitation "$INVITATION_URL"
```

In an interactive terminal, acceptance guides browser approval on the invited
service and selects the workspace when membership is verified. Run the same
acceptance command to resume after interruption. JSON, SDK and MCP callers
receive the next action for sign-in or selection and invoke it explicitly.

A browser user can open the link, sign in, choose **Join workspace**, and then
choose **Open workspace** or copy the terminal command. On hosted services with workspace creation enabled,
new accounts receive a private **My workspace** as well. Joining opens the
invited workspace, and both appear in the workspace switcher. The private
workspace's billing setup is separate from joining. If the account email
differs from the invitation, switch to the invited account before joining.
The link expires after 24 hours by default.
`--expires-in-hours` accepts 1–168. If creation's response is lost, retry with
the original `--invitation-id`, email and expiry. Each acceptance can grant
membership once.

After selecting the workspace, the participant reads `identity.get` and
shares its verified hosted `{issuer, subject}` with the ledger administrator.
Use `access.grant` with that exact principal, the required permissions and the current ledger revision. Use `access.revoke` for targeted removal. Grants can apply directly or through a group;
a membership UUID or display name is not a ledger principal. Members can then discover,
join, read and append according to those grants. See [shared records](/docs/raw/manuals/shared-records.md)
and [authorization groups](/docs/raw/manuals/ledger-surrounding.md#authorization-groups). Generic ledger read grants include
record content; machine-key restrictions and legacy raw-data policy are unchanged.

## Manage membership

```sh
op-sys memberships list --workspace-id <workspace-id>
op-sys invitations list --workspace-id <workspace-id>
op-sys invitations revoke --workspace-id <workspace-id> --invitation-id <id>
op-sys memberships update --workspace-id <workspace-id> --member-id <id> --expected-revision 1 --role admin
op-sys memberships remove --workspace-id <workspace-id> --member-id <id> --expected-revision 2
```

Members can read the roster and remove themselves. Only owners can manage
invitations and change other members. Use the roster's member UUID and revision;
stale changes fail explicitly. The last owner cannot leave or be demoted: promote
another owner first. Invitations never grant owner/admin status.

Removing a member ends their workspace membership. A separate ledger grant can
still authorize reads or contributions. Review direct and group-derived ledger
access during offboarding and revoke grants that should end. Revoke any shared
API keys separately. To end membership after someone joins, use
`memberships.remove`. Old invitation receipts cannot recreate removed membership.

Lists return up to 100 entries. Pass `next` from invitations or `next_after`
from memberships as `--after` to continue. The initial profile permits 100 pending
invitations and 1,000 members per workspace. Team operations stop during
deletion or fenced recovery. Final workspace deletion removes invitation metadata.

## SDK and MCP

Use `memberships.list/update/remove` and `invitations.create/inspect/accept/list/revoke`
in the SDK. The corresponding MCP names include `op_sys_memberships_list`
and `op_sys_invitations_create`. Set `workspace_id` when creating, listing, or
revoking workspace invitations.

See [account administration](/docs/raw/manuals/account-administration.md) for the current HTTP
routes, legacy invitation compatibility, API keys, billing and deletion.
