> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# mammoth workspace

> All 33 mammoth workspace commands with examples, arguments and confirmation flags: Manage workspace settings and members.

> Generated from mammoth-cli 2.4.2, released 2026-11-02: `mammoth schema list`, `mammoth capability list` and the CLI's own `--help`. Do not edit by hand; run `npm run docs:capabilities`.

Manage workspace settings and members. 33 commands.

Every command also takes the [global flags](https://mammoth.io/docs/build/cli/global-flags/) (`--output`, `--yes`, `--confirm`, `--dry-run`, `--input`, `--profile`, ...), which are not repeated below. `--input` takes a JSON or YAML document of the input fields; `mammoth schema get COMMAND_ID` prints a command's full input schema.

**Confirmation.** Commands marked `--yes --confirm TARGET` or `--yes` always need those flags, even at a terminal: they never prompt. Commands marked "`--yes` or prompt" ask at an interactive terminal (table output, no `--no-input`) and otherwise need `--yes`. `--dry-run` skips confirmation and sends nothing.

## Summary

| Command | What it does | Effect | Confirmation |
|---|---|---|---|
| [`workspace accept-invite`](#mammoth-workspace-accept-invite) | Accept a pending workspace invite using a token from '--input'. | Benign mutation | — |
| [`workspace app-usage`](#mammoth-workspace-app-usage) | Report app usage stats for the current workspace. | Read | — |
| [`workspace check-expression`](#mammoth-workspace-check-expression) | Ask the AI assistant to check an expression. Payload comes from '--input'. | Benign mutation | — |
| [`workspace create`](#mammoth-workspace-create) | Create a new workspace. Payload comes from the 'body' input field. | Benign mutation | — |
| [`workspace current`](#mammoth-workspace-current) | Show the workspace this token acts in, and the project it is fenced to. | Read | — |
| [`workspace delete`](#mammoth-workspace-delete) | Delete a workspace. High-impact: '--yes --confirm WORKSPACE_ID'. | High impact | `--yes --confirm TARGET` |
| [`workspace get`](#mammoth-workspace-get) | Get one workspace by id (positional), or the client's own workspace. | Read | — |
| [`workspace home`](#mammoth-workspace-home) | Read the Home summary: usage snapshot, health issues and suggestions. | Read | — |
| [`workspace list`](#mammoth-workspace-list) | List accessible workspaces. | Read | — |
| [`workspace llm-task`](#mammoth-workspace-llm-task) | Submit a unified LLM task. 'task_type' and 'params' come from '--input'. | Benign mutation | — |
| [`workspace reactivate`](#mammoth-workspace-reactivate) | Reactivate a deactivated workspace. High-impact: '--yes --confirm WORKSPACE_ID'. | High impact | `--yes --confirm TARGET` |
| [`workspace storage-breakdown`](#mammoth-workspace-storage-breakdown) | Report a breakdown of storage usage for the workspace. | Read | — |
| [`workspace update`](#mammoth-workspace-update) | Patch workspace settings. High-impact: '--yes --confirm WORKSPACE_ID'. | High impact | `--yes --confirm TARGET` |
| [`workspace export-hosts get`](#mammoth-workspace-export-hosts-get) | Read the hosts this workspace's custom export destinations may send to. | Read | — |
| [`workspace export-hosts set`](#mammoth-workspace-export-hosts-set) | Set the hosts custom export destinations may send to. High-impact: always needs '--yes'. | High impact | `--yes` |
| [`workspace invite delete`](#mammoth-workspace-invite-delete) | Delete pending invites and free their seats. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`workspace invite list`](#mammoth-workspace-invite-list) | List pending invites with their invite ids; 'project_id' narrows to one project. | Read | — |
| [`workspace invite resend`](#mammoth-workspace-invite-resend) | Send the invitation email again. 'invite_ids' from '--input'. | Benign mutation | — |
| [`workspace invite revoke`](#mammoth-workspace-invite-revoke) | Revoke pending invites. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`workspace invite update-role`](#mammoth-workspace-invite-update-role) | Change the role a pending invite grants. '--yes' required. | High impact | `--yes` |
| [`workspace oauth-client create`](#mammoth-workspace-oauth-client-create) | Create an OAuth client through the generated path, revealing its secret. | High impact | `--yes` |
| [`workspace oauth-client delete`](#mammoth-workspace-oauth-client-delete) | Delete an OAuth client registration; its grants stop working. | High impact | `--yes --confirm TARGET` |
| [`workspace oauth-client list`](#mammoth-workspace-oauth-client-list) | List the workspace's registered OAuth clients (no secrets). | Read | — |
| [`workspace oauth-client revoke-grant`](#mammoth-workspace-oauth-client-revoke-grant) | Revoke every grant to an OAuth client; users must authorise it again. | High impact | `--yes --confirm TARGET` |
| [`workspace segment list`](#mammoth-workspace-segment-list) | List split-test segments for the workspace. | Read | — |
| [`workspace segment update`](#mammoth-workspace-segment-update) | Update split-test segments. 'patch' comes from '--input'. | Benign mutation | — |
| [`workspace user add`](#mammoth-workspace-user-add) | Invite one or more users to the workspace. High-impact: '--yes'. | Benign mutation | `--yes` |
| [`workspace user get`](#mammoth-workspace-user-get) | Get one workspace user by id (positional), in the client's own workspace. | Read | — |
| [`workspace user list`](#mammoth-workspace-user-list) | List users in the client's own workspace, with their roles and status. | Read | — |
| [`workspace user remove`](#mammoth-workspace-user-remove) | Remove a single user from the workspace. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`workspace user remove-batch`](#mammoth-workspace-user-remove-batch) | Remove several users and/or pending invites. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`workspace user update`](#mammoth-workspace-user-update) | Update a user's role. High-impact: '--yes --confirm USER_ID'. | High impact | `--yes --confirm TARGET` |
| [`workspace user update-batch`](#mammoth-workspace-user-update-batch) | Update workspace users via JSON-patch operations. High-impact: '--yes --confirm WS'. | High impact | `--yes --confirm TARGET` |

## workspace commands

### mammoth workspace accept-invite

Accept a pending workspace invite using a token from '--input'.

```bash
mammoth workspace accept-invite --input /private/path/request.json
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `token` | `--input` field | yes | — | `str` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.accept-invite` · **Result:** `WorkspaceAcceptInviteResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.accept_invite`, API `POST /accept-invite` (AcceptInvite)

### mammoth workspace app-usage

Report app usage stats for the current workspace.

```bash
mammoth workspace app-usage
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `fields` | `--input` field | no | — | `str` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.app-usage` · **Result:** `WorkspaceAppUsageResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.app_usage`, API `GET /workspaces/{workspace_id}/app-usage` (GetAppUsage)

### mammoth workspace check-expression

Ask the AI assistant to check an expression. Payload comes from '--input'.

```bash
mammoth workspace check-expression --input '{"body": {"intent": "Summarize revenue by region"}}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `body` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.check-expression` · **Result:** `WorkspaceCheckExpressionResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.check_expression`, API `POST /workspaces/{workspace_id}/ai/check-expression` (GenerateCheckExpression)

### mammoth workspace create

Create a new workspace. Payload comes from the 'body' input field.

```bash
mammoth workspace create --input '{"body": {}}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `body` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.create` · **Result:** `WorkspaceCreateResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.create`, API `POST /workspaces` (CreateWorkspace)

### mammoth workspace current

Show the workspace this token acts in, and the project it is fenced to.

```bash
mammoth workspace current
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Read-only. The workspace this token acts in, and the server (resource) and project it is fenced to.
- **Id:** `workspace.current` · **Result:** `WorkspaceCurrentResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.current`, API `GET /workspaces/current` (GetCurrentWorkspace)

### mammoth workspace delete

Delete a workspace. High-impact: '--yes --confirm WORKSPACE_ID'.

```bash
mammoth workspace delete 123 --yes --confirm 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Exact immutable workspace-ID confirmation, not --yes alone.
- **Id:** `workspace.delete` · **Result:** `WorkspaceDeleteResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.delete`, API `DELETE /workspaces/{workspace_id}` (DeleteUserWorkspace)

### mammoth workspace get

Get one workspace by id (positional), or the client's own workspace.

```bash
mammoth workspace get 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.get` · **Result:** `WorkspaceGetResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.get`, API `GET /workspaces/{workspace_id}` (GetWorkspace)

### mammoth workspace home

Read the Home summary: usage snapshot, health issues and suggestions.

```bash
mammoth workspace home
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** The Home read: usage_summary (storage, plan), health_issues (type, severity, occurrence_count, available_actions) and suggestions. Read-only; not a chat turn.
- **Id:** `workspace.home` · **Result:** `WorkspaceHomeResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.home_summary`, API `GET /workspaces/{workspace_id}/home` (GetHomeSummary)

### mammoth workspace list

List accessible workspaces.

```bash
mammoth workspace list
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `limit` | `--input` field | no | `100` | `int` |  |
| `fields` | `--input` field | no | `id,name` | `str` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `workspace.list` · **Result:** `WorkspaceListResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.list`, API `GET /workspaces` (GetWorkspaces)

### mammoth workspace llm-task

Submit a unified LLM task. 'task_type' and 'params' come from '--input'.

```bash
mammoth workspace llm-task --input '{"task_type": "run_data_retrieval", "params": {"name": "Status"}}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `task_type` | `--input` field | yes | — | `str` |  |
| `params` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.llm-task` · **Result:** `WorkspaceLlmTaskResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.llm_task`, API `POST /workspaces/{workspace_id}/llm` (RunLlmTask)

### mammoth workspace reactivate

Reactivate a deactivated workspace. High-impact: '--yes --confirm WORKSPACE_ID'.

```bash
mammoth workspace reactivate 123 --yes --confirm 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Turns a deactivated workspace back on; its users regain access and billing resumes. Needs --yes and --confirm WORKSPACE_ID (the refusal prints it).
- **Id:** `workspace.reactivate` · **Result:** `WorkspaceReactivateResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.reactivate`, API `POST /workspaces/{workspace_id}/reactivate` (ReactivateWorkspace)

### mammoth workspace storage-breakdown

Report a breakdown of storage usage for the workspace.

```bash
mammoth workspace storage-breakdown
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `limit` | `--input` field | no | — | `int` |  |
| `offset` | `--input` field | no | — | `int` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** This is a paginated per-item list of storage-consuming resources (limit/offset); it carries no workspace total and can page through thousands of items. For the workspace's total storage used/allowed, use `workspace app-usage` instead.
- **Id:** `workspace.storage-breakdown` · **Result:** `WorkspaceStorageBreakdownResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.storage_breakdown`, API `GET /workspaces/{workspace_id}/storage-breakdown` (GetStorageBreakdown)

### mammoth workspace update

Patch workspace settings. High-impact: '--yes --confirm WORKSPACE_ID'.

```bash
mammoth workspace update 123 --input '{"patches": [{"op": "replace", "path": "name", "value": "Revenue team"}]}' --yes --confirm 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |
| `patches` | `--input` field | yes | — | `list[WorkspacePatchOp]` |  |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Patches workspace settings that apply to every member. Read them first (`workspace get`). Needs --yes and --confirm WORKSPACE_ID.
- **Id:** `workspace.update` · **Result:** `WorkspaceUpdateResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.update`, API `PATCH /workspaces/{workspace_id}` (UpdateWorkspace)

## workspace export-hosts

### mammoth workspace export-hosts get

Read the hosts this workspace's custom export destinations may send to.

```bash
mammoth workspace export-hosts get
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.export-hosts.get` · **Result:** `WorkspaceExportHostsGetResult` · **Backed by:** SDK `mammoth.api.exports.ExportsAPI.export_hosts`, API `GET /workspaces/{workspace_id}/export-hosts` (Read)

### mammoth workspace export-hosts set

Set the hosts custom export destinations may send to. High-impact: always needs '--yes'.

```bash
mammoth workspace export-hosts set --input '{"restricted": true}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `restricted` | `--input` field | yes | — | `bool` |  |
| `hosts` | `--input` field | no | — | `list[str]` |  |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Sets which hosts exports may send data to for the whole workspace. Admins only. Needs --yes.
- **Id:** `workspace.export-hosts.set` · **Result:** `WorkspaceExportHostsSetResult` · **Backed by:** SDK `mammoth.api.exports.ExportsAPI.set_export_hosts`, API `PUT /workspaces/{workspace_id}/export-hosts` (Update)

## workspace invite

### mammoth workspace invite delete

Delete pending invites and free their seats. Prompt or '--yes' required.

```bash
mammoth workspace invite delete --input '{"invite_ids": [1]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `invite_ids` | `--input` field | yes | — | `list[int]` |  |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Deletes pending invites for good and frees their seats. Take invite_ids from workspace invite list (a pending invite is not a workspace user; workspace user list never shows it).
- **Id:** `workspace.invite.delete` · **Result:** `WorkspaceInviteDeleteResult`

### mammoth workspace invite list

List pending invites with their invite ids; 'project_id' narrows to one project.

```bash
mammoth workspace invite list
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Lists pending invites with id, email, status, role and invited_at. Optional project_id keeps invites that grant a role on that project.
- **Id:** `workspace.invite.list` · **Result:** `WorkspaceInviteListResult`

### mammoth workspace invite resend

Send the invitation email again. 'invite_ids' from '--input'.

```bash
mammoth workspace invite resend --input '{"invite_ids": [1]}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `invite_ids` | `--input` field | yes | — | `list[int]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Sends the invitation email again. Take invite_ids from workspace invite list.
- **Id:** `workspace.invite.resend` · **Result:** `WorkspaceInviteResendResult`

### mammoth workspace invite revoke

Revoke pending invites. Prompt or '--yes' required.

```bash
mammoth workspace invite revoke --input '{"invite_ids": [1]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `invite_ids` | `--input` field | yes | — | `list[int]` |  |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Marks pending invites revoked; the row stays. To remove an invite for good use workspace invite delete.
- **Id:** `workspace.invite.revoke` · **Result:** `WorkspaceInviteRevokeResult`

### mammoth workspace invite update-role

Change the role a pending invite grants. '--yes' required.

```bash
mammoth workspace invite update-role --input '{"invite_id": 1, "role": "workspace_member"}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `invite_id` | `--input` field | yes | — | `int` |  |
| `role` | `--input` field | yes | — | `str` |  |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Changes the workspace role a pending invite will grant (workspace_member, workspace_admin, workspace_owner, workspace_guest).
- **Id:** `workspace.invite.update-role` · **Result:** `WorkspaceInviteUpdateRoleResult`

## workspace oauth-client

### mammoth workspace oauth-client create

Create an OAuth client through the generated path, revealing its secret.

```bash
mammoth workspace oauth-client create 123 --input '{"name": "Revenue report", "redirect_uris": ["https://example.com/data.csv"]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |
| `name` | `--input` field | yes | — | `str` |  |
| `redirect_uris` | `--input` field | yes | — | `list[str]` |  |
| `description` | `--input` field | no | — | `str` |  |
| `logo_url` | `--input` field | no | — | `str` |  |
| `tos_url` | `--input` field | no | — | `str` |  |
| `privacy_url` | `--input` field | no | — | `str` |  |
| `token_endpoint_auth_method` | `--input` field | no | `client_secret_basic` | `str` |  |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Registers an OAuth client that can sign users in. A confidential client's client_secret is returned exactly once and shown once in this output; store it now, it cannot be fetched again. Send name and redirect_uris through --input.
- **Id:** `workspace.oauth-client.create` · **Result:** `WorkspaceOauthClientCreateResult` · **Backed by:** SDK `mammoth.api.oauth_clients.OAuthClientsAPI.create`, API `POST /workspaces/{workspace_id}/oauth-clients` (CreateOauthClient)

### mammoth workspace oauth-client delete

Delete an OAuth client registration; its grants stop working.

```bash
mammoth workspace oauth-client delete 123 456 --yes --confirm 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `OAUTH_CLIENT_ID` | positional | yes | — | `int` | ID of the OAuth client. |
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Exact OAuth client ID confirmation (--yes --confirm ID). Deleting the client stops its grants working.
- **Id:** `workspace.oauth-client.delete` · **Result:** `WorkspaceOauthClientDeleteResult` · **Backed by:** SDK `mammoth.api.oauth_clients.OAuthClientsAPI.delete`, API `DELETE /workspaces/{workspace_id}/oauth-clients/{oauth_client_id}` (DeleteOauthClient)

### mammoth workspace oauth-client list

List the workspace's registered OAuth clients (no secrets).

```bash
mammoth workspace oauth-client list 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Read-only. The workspace's OAuth clients (id, client_id, name, redirect URIs). No client secret is returned.
- **Id:** `workspace.oauth-client.list` · **Result:** `AuthOauthClientListResult` · **Backed by:** SDK `mammoth.api.oauth_clients.OAuthClientsAPI.list`, API `GET /workspaces/{workspace_id}/oauth-clients` (ListOauthClients)

### mammoth workspace oauth-client revoke-grant

Revoke every grant to an OAuth client; users must authorise it again.

```bash
mammoth workspace oauth-client revoke-grant 123 456 --yes --confirm 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `OAUTH_CLIENT_ID` | positional | yes | — | `int` | ID of the OAuth client. |
| `WORKSPACE_ID` | positional | no | — | `int` | ID of the workspace to act on; defaults to the client's own workspace. |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Exact OAuth client ID confirmation (--yes --confirm ID). Every user who authorised this client must authorise it again.
- **Id:** `workspace.oauth-client.revoke-grant` · **Result:** `WorkspaceOauthClientRevokeGrantResult` · **Backed by:** SDK `mammoth.api.oauth_clients.OAuthClientsAPI.revoke_grant`, API `DELETE /workspaces/{workspace_id}/oauth-clients/{oauth_client_id}/grant` (RevokeOauthGrant)

## workspace segment

### mammoth workspace segment list

List split-test segments for the workspace.

```bash
mammoth workspace segment list
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `workspace.segment.list` · **Result:** `WorkspaceSegmentListResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.segment_list`, API `GET /workspaces/{workspace_id}/split-segments` (GetSegments)

### mammoth workspace segment update

Update split-test segments. 'patch' comes from '--input'.

```bash
mammoth workspace segment update --input '{"patch": [{"name": "Status"}]}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `patch` | `--input` field | yes | — | `list[dict[str, any]]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `workspace.segment.update` · **Result:** `WorkspaceSegmentUpdateResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.segment_update`, API `PATCH /workspaces/{workspace_id}/split-segments` (UpdateSegments)

## workspace user

### mammoth workspace user add

Invite one or more users to the workspace. High-impact: '--yes'.

```bash
mammoth workspace user add --input '{"email_ids": ["analyst@example.com"]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `email_ids` | `--input` field | yes | — | `list[str]` |  |
| `projects` | `--input` field | no | — | `list[dict[str, any]]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Id:** `workspace.user.add` · **Result:** `WorkspaceUserAddResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.user_add`, API `POST /workspaces/{workspace_id}/users` (AddUserInWorkspace)

### mammoth workspace user get

Get one workspace user by id (positional), in the client's own workspace.

```bash
mammoth workspace user get resource-123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `USER_ID` | positional | yes | — | `str` | ID of the user. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Required inputs: USER_ID.
- **Id:** `workspace.user.get` · **Result:** `WorkspaceUserGetResult`

### mammoth workspace user list

List users in the client's own workspace, with their roles and status.

```bash
mammoth workspace user list
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `fields` | `--input` field | no | — | `str` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Preconditions:** Lists members only; a pending invite is not a member. For pending invites and their ids run workspace invite list. Optional project_id keeps one project's members.
- **Id:** `workspace.user.list` · **Result:** `WorkspaceUserListResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.list_users`, API `GET /workspaces/{workspace_id}/users` (GetUsersInWorkspace)

### mammoth workspace user remove

Remove a single user from the workspace. Prompt or '--yes' required.

```bash
mammoth workspace user remove 123 --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `USER_ID` | positional | yes | — | `int` | ID of the user. |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Required inputs: USER_ID.
- **Id:** `workspace.user.remove` · **Result:** `WorkspaceUserRemoveResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.user_remove`, API `DELETE /workspaces/{workspace_id}/users/{user_id}` (RemoveUser)

### mammoth workspace user remove-batch

Remove several users and/or pending invites. Prompt or '--yes' required.

```bash
mammoth workspace user remove-batch --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `ids` | `--input` field | no | — | `str` |  |
| `invite_ids` | `--input` field | no | — | `str` |  |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Removes members (ids) and/or pending invites (invite_ids). Take invite ids from workspace invite list; workspace invite delete is the dedicated command for invites.
- **Id:** `workspace.user.remove-batch` · **Result:** `WorkspaceUserRemoveBatchResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.user_remove_batch`, API `DELETE /workspaces/{workspace_id}/users` (RemoveUserFromWorkspace)

### mammoth workspace user update

Update a user's role. High-impact: '--yes --confirm USER_ID'.

```bash
mammoth workspace user update resource-123 --input '{"patches": [{"op": "replace", "path": "role", "value": "workspace_member"}]}' --yes --confirm resource-123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `USER_ID` | positional | yes | — | `str` | ID of the user. |
| `patches` | `--input` field | yes | — | `list[UserRolePatchOp]` |  |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Exact user-ID confirmation for owner/admin role changes.
- **Id:** `workspace.user.update` · **Result:** `WorkspaceUserUpdateResult` · **Backed by:** SDK `mammoth.api.workspace.WorkspaceAPI.update_user`, API `PATCH /workspaces/{workspace_id}/users/{user_id}` (UpdateUserInWorkspace)

### mammoth workspace user update-batch

Update workspace users via JSON-patch operations. High-impact: '--yes --confirm WS'.

```bash
mammoth workspace user update-batch --input '{"patches": [{"name": "Status"}]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `patches` | `--input` field | yes | — | `list[dict[str, any]]` |  |

- **Effect:** High impact, scope `workspace` · **Confirmation:** always `--yes --confirm TARGET`, even at a terminal (TARGET is the exact id or name acted on; the `confirmation_required` error's hint names it)
- **Preconditions:** Changes the roles of several workspace users in one JSON-patch call; each gains or loses access at once. Read `workspace user list` first. Needs --yes and --confirm WORKSPACE_ID.
- **Id:** `workspace.user.update-batch` · **Result:** `WorkspaceUserUpdateBatchResult` · **Backed by:** SDK `mammoth.api.workspaces.WorkspacesAPI.user_update_batch`, API `PATCH /workspaces/{workspace_id}/users` (UpdateUserToWorkspace)

---
Source: https://mammoth.io/docs/build/cli/workspace.md · Updated: 2026-11-02
