---
title: organization
description: 所属組織の設定・メンバー・招待を管理する。
canonical_url: https://orchestor.io/docs/cli/organization
markdown_url: https://orchestor.io/docs/cli/organization.md
contentType: reference
---

# organization

`orc organization` は、所属するOrganizationを一覧にし、CLIの操作対象を切り替え、組織設定・メンバー・招待を管理するコマンドです。組織名やBrand / Agency設定を変更し、メンバーの組織ロールを更新し、招待の送信と取り消しを行えます。

実行前に `orc auth login` で認証してください。組織を切り替えるには、切替先への所属と、利用できるWorkspaceが必要です。API keyは認証された組織の範囲で使用します。本人の表示名を変更する場合は [`orc profile`](https://orchestor.io/docs/cli/profile.md) を使用してください。

`use` はCLIの選択を保存します。現在のWorkspaceが切替先に属していれば維持し、属していなければ切替先で利用できるWorkspaceを選択します。切替先に属していないディレクトリのWorkspaceリンクは解除されます。

## 使い方

```bash title="terminal"
orc organization list
```

*所属する組織のID、名前、組織ロールを一覧にします。*

## 組織とWorkspaceの切り替え

`organization use` には `organization list` の組織IDを指定します。組織名やslugでは指定できません。IDを省略した対話式の選択はありません。

```bash title="terminal"
orc organization use <organization-id>
orc organization current
orc workspace current
```

*組織を切り替え、組織とWorkspaceの選択結果を確認します。*

切り替えでは、所属組織と利用可能なWorkspaceを取得し、選択したWorkspaceをAPIで検証してから現在のCLIプロファイルに保存します。切替先で利用できるWorkspaceがなければ、選択を変更せずエラーを返します。別のWorkspaceを選ぶ場合は `orc workspace` の `list` と `use` を使用してください。

```bash title="terminal"
orc workspace list
orc workspace use <workspace-id>
orc workspace link <workspace-id>
```

*同じ組織内でWorkspaceを選び、必要に応じて現在のディレクトリに関連付けます。*

Workspaceの解決順は、`--workspace`、`ORCHESTOR_WORKSPACE_ID`、ディレクトリのリンク、保存した既定値です。1回のAPI操作だけ対象を指定する場合は `--workspace <workspace-id>` を使用します。組織切替で、切替先に属していないディレクトリのリンクは解除されます。切替先と異なる `ORCHESTOR_WORKSPACE_ID` が設定されている場合は、環境変数を解除してから再実行してください。

## サブコマンド

### `use`

組織IDを指定してCLIの選択を保存します。切替先に属する現在のWorkspaceは維持し、属していなければ利用可能なWorkspaceを選択します。所属確認とAPIでの検証に成功するまで保存しません。

```bash title="terminal"
orc organization use <organization-id> [options]
```

#### 使用例

```bash title="terminal"
orc organization use <organization-id>
```

*組織IDを指定してCLIの選択を保存します。*

### `current`

現在のWorkspaceから解決された組織の設定と本人の組織ロールを表示します。組織名、`organization_type`、`slug`、`website_url`、`member_count`を確認できます。

```bash title="terminal"
orc organization current [options]
```

#### 使用例

```bash title="terminal"
orc organization current --json
```

*現在のWorkspaceから解決された組織の設定と本人の組織ロールを表示します。*

### `update`

組織の`name`、`type`、`slug`、`website_url`を更新します。`type`は`brand`または`agency`です。省略した項目は保持し、`website_url`は`null`で解除できます。`type`と互換フィールド`organization_type`は同時に指定しないでください。

```bash title="terminal"
orc organization update [options]
```

#### 固有のオプション

##### `--name`

Body field: name

型: `string`。任意。

```bash title="terminal"
orc organization update --name <value>
```

##### `--slug`

Body field: slug

型: `string`。任意。

```bash title="terminal"
orc organization update --slug <value>
```

##### `--organization-type`

Body field: organization_type; enum: brand|agency

型: `string`。任意。

```bash title="terminal"
orc organization update --organization-type <value>
```

##### `--website-url`

The agency Organization's own website URL. Brand Organizations may leave this null because the managed brand URL belongs to Workspace setup.; (use "null" or "reset" to clear)

型: `string`。任意。

```bash title="terminal"
orc organization update --website-url <value>
```

##### `--type`

Body field: type; enum: brand|agency

型: `string`。任意。

```bash title="terminal"
orc organization update --type <value>
```

#### 使用例

```bash title="terminal"
orc organization update --stdin < organization.json
```

*組織のname、type、slug、website_urlを更新します。*

### `invites list`

現在の組織の招待ID、宛先、`org_role`、`workspace_assignments`、有効期限と状態を一覧にします。`--state`は`pending`、`accepted`、`expired`、`revoked`で絞り込みます。次のページは応答の`next_cursor`を`--cursor`に渡し、`--limit`で1ページの件数を指定します。

```bash title="terminal"
orc organization invites list [options]
```

#### 固有のオプション

##### `--state`

enum: pending|accepted|expired|revoked

型: `string`。任意。

```bash title="terminal"
orc organization invites list --state <value>
```

#### 使用例

```bash title="terminal"
orc organization invites list --state pending --limit 50 --json
```

*現在の組織の招待ID、宛先、org_role、workspace_assignments、有効期限と状態を一覧にします。*

### `invites create`

本文に`email`と`role`を指定して1人を招待します。`role`は`owner`、`admin`、`member`です。互換フィールド`org_role`も使用できますが、`role`と異なる値を同時に指定できません。`owner`を招待できるのは`owner`です。既存メンバーや有効な招待がある宛先は拒否されます。

```bash title="terminal"
orc organization invites create [options]
```

#### 固有のオプション

##### `--idempotency-key`

Retry identity for operations that support idempotency. Use a unique key for each new operation, and reuse it only when retrying the same HTTP method, path, query values and exact request body. JSON whitespace changes can count as a different body. Keys contain 1–255 characters after trimming and expire after 24 hours. A completed JSON response is replayed without repeating the operation. A different request using the same key returns 409 idempotency_error. An in-progress request returns 409 idempotency_in_progress with Retry-After: 2. Whether this header is required depends on the operation.

型: `string`。任意。

```bash title="terminal"
orc organization invites create --idempotency-key <value>
```

##### `--email`

(required) Body field: email; max 255 chars

型: `string`。任意。

```bash title="terminal"
orc organization invites create --email <value>
```

##### `--org-role`

Body field: org_role; enum: owner|admin|member

型: `string`。任意。

```bash title="terminal"
orc organization invites create --org-role <value>
```

##### `--workspace-assignments`

Body field: workspace_assignments; JSON array of objects (use --stdin for large resources)

型: `string`。任意。

```bash title="terminal"
orc organization invites create --workspace-assignments <value>
```

##### `--role`

Body field: role; enum: owner|admin|member

型: `string`。任意。

```bash title="terminal"
orc organization invites create --role <value>
```

#### 使用例

```bash title="terminal"
orc organization invites create --stdin < invitation.json
```

*本文にemailとroleを指定して1人を招待します。*

### `invites delete`

invites listの招待IDを指定して`pending`の招待を取り消します。`accepted`、`expired`、`revoked`の招待は取り消せません。承諾済みのメンバーを除外するには`members delete`を使用します。

```bash title="terminal"
orc organization invites delete <id> [options]
```

#### 使用例

```bash title="terminal"
orc organization invites delete <invite-id> --dry-run
```

*invites listの招待IDを指定してpendingの招待を取り消します。*

### `list`

所属する組織のID、名前、組織ロールを一覧にします。人のアカウントでは有効な所属だけを返し、API keyでは認証された組織の範囲を返します。

```bash title="terminal"
orc organization list [options]
```

#### 使用例

```bash title="terminal"
orc organization list --json
```

*所属する組織のID、名前、組織ロールを一覧にします。*

### `members list`

現在の組織に有効な所属を持つメンバーの`user_id`、`first_name`、`last_name`、`role`を一覧にします。Workspace内だけの一覧ではありません。

```bash title="terminal"
orc organization members list [options]
```

#### 使用例

```bash title="terminal"
orc organization members list --json
```

*現在の組織に有効な所属を持つメンバーのuser_id、first_name、last_name、roleを一覧にします。*

### `members update`

`members list`の`user_id`と、本文の`role`を指定して組織ロールを変更します。`role`は`owner`、`admin`、`member`です。`owner`を管理できるのは`owner`で、最後の`owner`の降格は拒否されます。

```bash title="terminal"
orc organization members update <user-id> [options]
```

#### 固有のオプション

##### `--role`

(required) Body field: role; enum: owner|admin|member

型: `string`。任意。

```bash title="terminal"
orc organization members update <user-id> --role <value>
```

#### 使用例

```bash title="terminal"
orc organization members update <user-id> --stdin < member.json
```

*members listのuser_idと、本文のroleを指定して組織ロールを変更します。*

### `members delete`

現在の組織への所属と、それに紐付くWorkspaceアクセスを除外します。アカウント自体は削除しません。`owner`の除外は`owner`だけが実行でき、最後の`owner`は除外できません。実行時に対象の確認があります。

```bash title="terminal"
orc organization members delete <user-id> [options]
```

#### 使用例

```bash title="terminal"
orc organization members delete <user-id> --dry-run
```

*現在の組織への所属と、それに紐付くWorkspaceアクセスを除外します。*

## 使用例

### 組織と現在の操作対象を確認します。

`list` の `id` は `use` に渡す組織IDです。`current` の `workos_organization_id` も同じ組織識別子を示します。

```bash title="terminal"
orc organization list --json
orc organization current --json
```

*組織と現在の操作対象を確認します。*

### 組織設定の更新本文を用意します。

`name` と `type` は省略した項目を保持します。`type` は `brand` または `agency` です。

```json title="organization.json"
{
  "name": "Example Agency",
  "type": "agency"
}
```

*組織設定の更新本文を用意します。*

### 組織設定のリクエストを確認してから更新します。

更新の `--dry-run` はリクエストのプレビューを表示し、更新APIを呼び出しません。サーバーでの権限確認の成功を保証するものではありません。

```bash title="terminal"
orc organization update --stdin < organization.json --dry-run
orc organization update --stdin < organization.json
```

*組織設定のリクエストを確認してから更新します。*

### 組織ロールを変更する本文を用意します。

組織ロールは `owner`、`admin`、`member` です。Workspaceロールとは別の設定です。

```json title="member.json"
{
  "role": "member"
}
```

*組織ロールを変更する本文を用意します。*

### メンバー一覧からuser IDを確認してロールを変更します。

`members list` の `user_id` を指定します。Workspace member IDや招待IDは使用しません。

```bash title="terminal"
orc organization members list --json
orc organization members update <user-id> --stdin < member.json
```

*メンバー一覧からuser IDを確認してロールを変更します。*

### 招待する宛先と組織ロールを指定します。

1回の操作で1人を招待します。組織ロールの付与と、Workspaceへのアクセス割り当ては別の指定です。

```json title="invitation.json"
{
  "email": "member@example.com",
  "role": "member"
}
```

*招待する宛先と組織ロールを指定します。*

### 招待を作成し、未承諾の招待を確認します。

既存メンバーや有効な招待がある宛先への作成は拒否されます。成功した招待のID、状態、期限はAPIの応答で確認します。

```bash title="terminal"
orc organization invites create --stdin < invitation.json
orc organization invites list --state pending --json
```

*招待を作成し、未承諾の招待を確認します。*

## 組織ロールとWorkspaceへのアクセス

組織ロールには `owner`、`admin`、`member` を使用します。`owner` を招待・変更・除外できるのは組織の `owner` です。`admin` は `member` と `admin` を管理できますが、`owner` を付与したり管理したりできません。最後の組織 `owner` の降格・除外は拒否されます。

`members delete` はその組織への所属を除外し、その所属に紐付くWorkspaceアクセスも無効にします。アカウントそのものや他の組織への所属は削除しません。招待の `workspace_assignments` を使用する場合、各要素に `workspace_id` と `workspace_role` を指定します。Workspaceロールは `owner` または `member` で、別の組織のWorkspaceは割り当てられません。

```json title="invitation.json"
{
  "email": "member@example.com",
  "role": "member",
  "workspace_assignments": [
    { "workspace_id": "<workspace-id>", "workspace_role": "member" }
  ]
}
```

*組織への招待と、同じ組織のWorkspaceへのアクセスを指定します。*

## 必要な権限

一覧・現在の組織・メンバー一覧は認証済みの所属範囲で参照します。組織設定の更新には組織の `owner` または `admin` と `workspace:settings` 権限、招待操作には組織の `owner` または `admin` と `workspace:invite` 権限が必要です。メンバーの更新・除外には組織の `owner` または `admin` が必要です。Workspaceの `owner` であっても、組織管理権限が自動的に付与されるわけではありません。

## グローバルオプション

`orc organization` では、次の[グローバルオプション](https://orchestor.io/docs/cli/global-flags.md)を使用できます。

- [`--help`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%98%E3%83%AB%E3%83%97)
- [`--workspace`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%AF%E3%83%BC%E3%82%AF%E3%82%B9%E3%83%9A%E3%83%BC%E3%82%B9)
- [`--json`](https://orchestor.io/docs/cli/global-flags.md#json-%E5%87%BA%E5%8A%9B)
- [`--pretty`](https://orchestor.io/docs/cli/global-flags.md#json-%E5%87%BA%E5%8A%9B)
- [`--format`](https://orchestor.io/docs/cli/global-flags.md#%E5%87%BA%E5%8A%9B%E5%BD%A2%E5%BC%8F)
- [`--field`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%81%AE%E6%8A%BD%E5%87%BA)
- [`--fields`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%81%AE%E6%8A%BD%E5%87%BA)
- [`--raw`](https://orchestor.io/docs/cli/global-flags.md#%E5%80%A4%E3%81%A0%E3%81%91%E3%82%92%E5%87%BA%E5%8A%9B)
- [`--output`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%B8%E3%81%AE%E5%87%BA%E5%8A%9B)
- [`--no-pager`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%9A%E3%83%BC%E3%82%B8%E9%80%81%E3%82%8A)
- [`--dry-run`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E4%BA%8B%E5%89%8D%E7%A2%BA%E8%AA%8D)
- [`--yes`](https://orchestor.io/docs/cli/global-flags.md#%E7%A2%BA%E8%AA%8D%E3%81%AE%E7%9C%81%E7%95%A5)
- [`--limit`](https://orchestor.io/docs/cli/global-flags.md)
- [`--cursor`](https://orchestor.io/docs/cli/global-flags.md)
- [`--stdin`](https://orchestor.io/docs/cli/global-flags.md#%E6%A8%99%E6%BA%96%E5%85%A5%E5%8A%9B)
- [`--from-stdin`](https://orchestor.io/docs/cli/global-flags.md#%E6%A8%99%E6%BA%96%E5%85%A5%E5%8A%9B)
- [`--page-all`](https://orchestor.io/docs/cli/global-flags.md#%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E5%8F%96%E5%BE%97)
- [`--timing`](https://orchestor.io/docs/cli/global-flags.md#%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E6%99%82%E9%96%93)

各オプションの詳細と使用例は、[グローバルオプション](https://orchestor.io/docs/cli/global-flags.md)を参照してください。

## トラブルシューティング

### 組織を切り替えられない

`organization list` の `id` を指定していることと、切替先で利用できるWorkspaceがあることを確認します。`ORCHESTOR_WORKSPACE_ID` が別の組織を指定している場合は解除してください。API keyの組織範囲を超えて切り替えることはできません。人のアカウントでログインし、再度実行してください。

### 組織設定やメンバーを変更できない

`organization current` の `role` を確認します。Workspaceの管理権限と組織の管理権限は別です。`admin` からの `owner` 付与、`owner` の管理、最後の `owner` の除外は拒否されます。メンバーの指定には `members list` の `user_id` を使用してください。

### 招待が作成できない、または取り消せない

宛先が既存メンバーである場合や、有効な招待が残っている場合は重複する招待を作成できません。`invites list --state pending` で状態を確認してください。取り消せるのは `pending` の招待です。承諾済みのメンバーを除外するには `members delete` を使用します。

### 非対話環境で除外を実行する

DELETE操作には確認が必要です。自動実行では対象IDと組織を確認し、[`--yes`](https://orchestor.io/docs/cli/global-flags.md#yes) を指定します。まず `--dry-run` で対象リクエストを確認できます。

## 関連項目

- `orc auth`: CLIへのログインと認証情報の確認。
- `orc workspace`: Workspaceの選択とディレクトリへの関連付け。
- [`orc profile`](https://orchestor.io/docs/cli/profile.md): 本人のプロフィールの確認・更新。
- [グローバルオプション](https://orchestor.io/docs/cli/global-flags.md): JSON出力、標準入力、リクエストのプレビュー、削除の確認。

---

[Documentation index](https://orchestor.io/docs/llms.txt)
