> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt
> Use this file to discover all available pages before exploring further.

# クイックスタート：Enterprise

> RBAC とマルチ組織サポート付きの Enterprise ユーザーとして Devin API の利用を開始する

このガイドでは、カスタムロール、RBAC、マルチ組織サポートに対応した **Enterprise 組織**向けに、API アクセスをセットアップする手順を説明します。

<Note>
  単一組織の Teams プランをご利用で、カスタムロールが不要な場合は、よりシンプルな [Teams クイックスタート](/ja/api-reference/getting-started/teams-quickstart) を参照してください。
</Note>

<Note>
  専用デプロイメント環境をご利用の **Devin Enterprise** 契約のお客様は、すべての API URL に含まれる `api.devin.ai` を、ご利用の組織専用のカスタム API ドメイン (例: `api.your-company.devinenterprise.com`) に置き換える必要があります。API ドメインが不明な場合は、Devin 管理者または Cognition サポートまでお問い合わせください。
</Note>

<div id="understanding-service-user-scopes">
  ## サービスユーザーのスコープを理解する
</div>

Enterprise のお客様は、2 つのレベルでサービスユーザーを作成できます。

| スコープ             | ベース URL                        | ユースケース                                   |
| ---------------- | ------------------------------ | ---------------------------------------- |
| **Enterprise**   | `/v3/enterprise/*`             | 複数組織横断での管理、分析、監査ログ、メンバー管理                |
| **Organization** | `/v3/organizations/{org_id}/*` | 単一組織内でのセッション、Knowledge、Playbooks、Secrets |

Enterprise レベルの権限を持つサービスユーザーは、**すべての** Organization において、対応する Organization レベルの権限を自動的に継承します。

<div id="step-1-create-a-service-user">
  ## ステップ 1: サービスユーザーを作成する
</div>

<div id="enterprise-service-user-cross-org-access">
  ### Enterprise サービスユーザー (組織間アクセス)
</div>

1. **Enterprise settings > Service users** に移動します
2. **Create service user** をクリックします
3. 名前を指定します (例: "Analytics Dashboard"、"Org Provisioning Bot")
4. 連携に必要な権限を持つ Enterprise ロールを割り当てます

<div id="organization-service-user-single-org-access">
  ### 組織サービスユーザー (単一組織アクセス)
</div>

1. 対象の組織で **Settings > Service users** を開きます
2. **Create service user** をクリックします
3. 名前を設定し、組織レベルのロールを割り当てます

<Tip>
  **最小権限の原則** に従ってください：連携が 1 つの組織にのみアクセスを必要とする場合は、その組織スコープのサービスユーザーを作成します。複数組織にまたがるワークフローに対してのみ Enterprise サービスユーザーを使用してください。
</Tip>

<div id="step-2-generate-an-api-key">
  ## ステップ 2: APIキーを生成
</div>

1. サービスユーザーを作成したら、**Generate API key** をクリックします
2. すぐにキーをコピーします — このキーは `cog_` で始まり、一度しか表示されません
3. 環境変数として安全に保存します:

```bash theme={null}
export DEVIN_API_KEY="cog_your_key_here"
```

<div id="step-3-make-your-first-api-call">
  ## ステップ 3: 初めての API 呼び出しを行う
</div>

<div id="enterprise-endpoint-example">
  ### Enterprise エンドポイントの例
</div>

Enterprise 内のすべての組織を一覧します：

```bash theme={null}
curl "https://api.devin.ai/v3/enterprise/organizations" \
  -H "Authorization: Bearer $DEVIN_API_KEY"
```

<div id="organization-endpoint-example">
  ### 組織エンドポイントの例
</div>

特定の組織向けに Devin セッションを作成する：

```bash theme={null}
export DEVIN_ORG_ID="your_org_id"

curl -X POST "https://api.devin.ai/v3/organizations/$DEVIN_ORG_ID/sessions" \
  -H "Authorization: Bearer $DEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Implement the feature described in JIRA-123"}'
```

<div id="permissions-and-rbac">
  ## 権限と RBAC
</div>

すべての API エンドポイントには、特定の権限が設定されています。必要な権限は、各エンドポイントの API リファレンスページに記載されています。権限は大きく次の 2 つのスコープに分かれます:

* **エンタープライズ権限** — `/v3/enterprise/*` エンドポイントを制御します (例: `ManageOrganizations`, `ManageBilling`, `ViewAccountMetrics`)
* **組織権限** — `/v3/organizations/{org_id}/*` エンドポイントを制御します (例: `UseDevinSessions`, `ManageOrgSecrets`, `ManageOrgPlaybooks`)

エンタープライズレベルの権限を持つエンタープライズサービスユーザーは、すべての組織に対して対応する組織レベルの権限を自動的に継承します。たとえば、`ViewAccountSessions` を持っていると、すべての組織で `ViewOrgSessions` が付与されます。

権限の詳細な一覧については、[permissions and RBAC ドキュメント](/ja/api-reference/v3/overview#enterprise-permissions) を参照してください。

<div id="common-enterprise-workflows">
  ## 一般的な Enterprise 向けワークフロー
</div>

<div id="monitor-consumption-across-orgs">
  ### 複数組織の消費状況を監視する
</div>

```bash theme={null}
# 日次消費量の内訳を取得する（Unixタイムスタンプを使用 — 例: 2025年1月1日〜1月31日）
curl "https://api.devin.ai/v3/enterprise/consumption/daily?time_after=1735689600&time_before=1738368000" \
  -H "Authorization: Bearer $DEVIN_API_KEY"
```

<div id="audit-log-retrieval">
  ### 監査ログの取得
</div>

```bash theme={null}
curl "https://api.devin.ai/v3/enterprise/audit-logs" \
  -H "Authorization: Bearer $DEVIN_API_KEY"
```

<div id="manage-users-across-organizations">
  ### 組織横断のユーザー管理
</div>

```bash theme={null}
# Enterprise ユーザーの一覧表示
curl "https://api.devin.ai/v3/enterprise/members/users" \
  -H "Authorization: Bearer $DEVIN_API_KEY"

# 特定の組織のユーザーを一覧表示
curl "https://api.devin.ai/v3/enterprise/organizations/$DEVIN_ORG_ID/members/users" \
  -H "Authorization: Bearer $DEVIN_API_KEY"
```

<div id="next-steps">
  ## 次のステップ
</div>

* [API 権限リファレンス](/ja/api-reference/v3/overview) 全体を参照する
* [認証](/ja/api-reference/authentication) について詳しく学ぶ
* 大規模な結果セット向けに [ページネーション](/ja/api-reference/concepts/pagination) を設定する
* v1/v2 から移行する場合は [移行ガイド](/ja/api-reference/getting-started/migration-guide) を確認する
