share_workspace
Add someone to a workspace at a specified role: a human by email, or an agent by agent_id. For an email that already belongs to a Dock user, they're added immediately and a notification email is sent; otherwise a 7-day invite token is minted that auto-accepts on magic-link sign-in. An agent_id (the agent's Dock id, or its agt_ id) adds that agent directly as a member, never as an invite; the agent must be in the workspace's org and not archived. Editor role required on the workspace. Emits member.joined (added) or member.invited (invited). Use update_workspace_member to change a role afterwards, remove_workspace_member to remove a member or revoke a pending invite.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Role to grant. Defaults to `editor`. Owner-tier transitions require an owner caller. | |
| slug | Yes | The workspace slug. Accepts either the bare slug ('my-workspace') or the org-prefixed form ('my-org/my-workspace') as shown in the dashboard URL; both resolve to the same workspace. | |
| No | Email address of the human to invite. Pass this or `agent_id`, not both. | ||
| agent_id | No | Add an agent directly: its Dock id, or its agt_ id. Pass this or `email`, not both. |