---
title: Admin APIでWIFを管理する
url: https://platform.claude.com/docs/ja/manage-claude/wif-admin-api
description: Infrastructure as CodeやCIワークフロー向けに、Workload Identity Federationのサービスアカウント、イシュアー、ルールをプログラムから作成・管理します。
---

Admin APIを使用すると、[Workload Identity Federation](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation)のリソース（サービスアカウント、フェデレーションイシュアー、フェデレーションルール）をプログラムから作成・管理できます。Claude Consoleをクリックして操作する代わりに、フェデレーション設定を「infrastructure as code」（コードとしてのインフラストラクチャ）として保持し、CIからプロビジョニングし、複数の組織にわたって再現するために使用してください。これらのエンドポイントは、[Admin API](https://platform.claude.com/docs/ja/manage-claude/admin-api)の他の部分と同じ`/v1/organizations`パスプレフィックスを共有します。

## 前提条件

このページのすべてのリクエストは、`org:admin`スコープを持つOAuthベアラートークンで認証します。このスコープは、admin、owner、またはprimary ownerロールを持つ組織メンバーにのみ付与され、組織全体へのアクセスを許可します。ワークスペースへのバインディングはすべて無視されます。トークンを取得する方法は2つあり、それぞれ異なる権限を持ちます。自分自身のログインから取得したトークンはユーザーとして動作しますが、フェデレーションされたトークンはサービスアカウントとして動作し、このページのすべての操作を実行できるわけではありません。

### インタラクティブ（ターミナル）

専用のプロファイルで[`ant` CLI](https://platform.claude.com/docs/ja/cli-sdks-libraries/cli/quickstart)にログインし、`org:admin`スコープを要求してから（[管理者アクセス](https://platform.claude.com/docs/ja/cli-sdks-libraries/cli/authentication#admin-access)を参照）、ベアラートークンをエクスポートします。`--profile admin`でログインすると、`org:admin`の認証情報が独自のプロファイル名で保存され、同時にそれがCLIのアクティブなプロファイルになります。また、エクスポートした変数はそのシェル内のすべてのSDKおよびCLI呼び出しに適用されます。そのため、管理専用に確保したシェルを使用し、作業が終わったら変数をunsetし、`ant profile activate default`でCLIを元に戻してください。

```bash CLI
ant auth login --profile admin --scope "org:admin"
export ANTHROPIC_AUTH_TOKEN=$(ant auth print-credentials --profile admin --access-token)
```

インタラクティブトークンは有効期間が短いため、リクエストが401を返し始めたら、エクスポートコマンドを再実行してください（トークンは自動的に更新されます）。

SDKと`ant` CLIは`ANTHROPIC_AUTH_TOKEN`を自動的に読み取ります。同じシェルでは`ANTHROPIC_API_KEY`を未設定のままにしてください。これらのエンドポイントはAPIキーを拒否し、一部のクライアントは両方が設定されている場合にキーを優先するためです。

### ワークロード（CIと自動化）

`organization_role`が`admin`であるサービスアカウントをターゲットとする、`oauth_scope: org:admin`を持つフェデレーションルールを作成します。ルール自体はClaude Consoleで作成する必要があります。ワークロードに組織管理者アクセスを付与することは、人間による意図的な操作であり、自動化が自らブートストラップできるものではありません。次のセクションでは、組織ごとに1回行うこのセットアップについて説明します。

## WIFを管理するワークロードをブートストラップする

Consoleで作成したルールが1つあれば、残りのフェデレーション設定をinfrastructure as codeの管理下に置くことができます。信頼できる単一のワークロードに`org:admin`スコープを付与し、そのワークロードがこのAPIを通じてフェデレーションイシュアーとすべてのワークスペーススコープのフェデレーションルールを管理できるようにします。

<Steps>
  <Step title="Consoleでorg:adminルールを作成する">
    Claude Consoleで[Workload identity](https://platform.claude.com/settings/workload-identity-federation)ページ（`platform.claude.com/settings/workload-identity-federation`）に移動し、**Connect workload**を選択して、自動化ワークロード（たとえば、インフラストラクチャリポジトリ内のGitHub Actionsワークフロー）用のフェデレーションルールを1つ作成します。**Advanced rule options**で、ルールのOAuthスコープを`org:admin`に設定します。するとウィザードは、Admin組織ロールを持つ新しいサービスアカウントを作成します（または、既存のadminサービスアカウントをターゲットとして選択するよう求めます）。

    <Warning>
      ルールは広範なパターンではなく、1つの正確なワークロードIDに一致させてください。`subject_prefix`は、末尾が`*`でない限り完全一致です。GitHub Actionsの場合は、`repo:my-org/my-repo:ref:refs/heads/main`のように、保護されたブランチにsubjectを固定してください。`repo:my-org/my-repo:*`のような末尾のワイルドカードは、フォークからトリガーされた実行を含む`pull_request`の実行にも一致するため、リポジトリに対してプルリクエストを開くことができる人なら誰でも`org:admin`トークンを発行できてしまいます。[認証できるワークフローを制限する](https://platform.claude.com/docs/ja/manage-claude/wif-providers/github-actions#restrict-which-workflows-can-authenticate)を参照してください。
    </Warning>
  </Step>

  <Step title="ワークロードのIDトークンを交換する">
    SDKのいずれかまたは`ant` CLIを使用するワークロードは、自分自身で交換を実行しません。[SDKクライアントを構築する](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#construct-the-sdk-client)の推論の場合とまったく同じように、フェデレーション環境変数でクライアントをルールに向け、引数なしで構築します。クライアントは最初のリクエスト時にIDトークンを交換し、得られたアクセストークンの有効期限が切れる前にIDトークンを再度読み取って再交換します。

    ```bash
    export ANTHROPIC_FEDERATION_RULE_ID=fdrl_...        # the org:admin rule from step 1
    export ANTHROPIC_ORGANIZATION_ID=00000000-0000-0000-0000-000000000000
    export ANTHROPIC_SERVICE_ACCOUNT_ID=svac_...       # the rule's target service account
    export ANTHROPIC_IDENTITY_TOKEN_FILE=/path/to/jwt  # or ANTHROPIC_IDENTITY_TOKEN
    # ANTHROPIC_WORKSPACE_IDは、ルールがすべてのワークスペースまたは
    # 複数のワークスペースで有効な場合のみ必須です。org:adminエンドポイントはこのバインディングを無視します。
    unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN       # both take precedence over federation
    ```

    `ant` CLIは同じ変数を読み取るか、`--federation-rule`、`--organization-id`、`--service-account-id`、`--identity-token-file`フラグを受け取ります。複数の`ant`コマンドを実行するワークロードでは、フラグや環境変数ではなく[フェデレーションプロファイル](https://platform.claude.com/docs/ja/manage-claude/wif-reference#profile-configuration-file)を使用してください。フラグや変数を使用すると、CLIはプロセスごとにIDトークンを再度交換しますが、`jti`クレームを持つIDトークン（GitHub Actionsのトークンが該当します）は1回しか受け付けられないため、2つ目のコマンドは拒否されます。また、ルールがすべてのワークスペースまたは複数のワークスペースで有効になっている場合、交換用の`workspace_id`をCLIに渡す唯一の方法もプロファイルです。SDKとは異なり、CLIは`ANTHROPIC_WORKSPACE_ID`や`--workspace-id`を交換に渡さないためです。すべてのSDKは、同じ設定を明示的なコンストラクタ引数としても受け付けます。言語ごとの例は[SDKクライアントを構築する](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#construct-the-sdk-client)に示されています。完全な一覧と優先順位については、[環境変数](https://platform.claude.com/docs/ja/manage-claude/wif-reference#environment-variables)と[認証情報の優先順位](https://platform.claude.com/docs/ja/manage-claude/wif-reference#credential-precedence)を参照してください。

    curlでAPIを呼び出すワークロードは、他のフェデレーションワークロードと同じ[トークン交換](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#authenticate-from-your-workload)を使用して、JWTを有効期間の短い`org:admin`ベアラートークンに自分自身で交換し、`authorization: Bearer`ヘッダーで送信します。
  </Step>

  <Step title="APIを通じてイシュアーとワークスペーススコープのルールを管理する">
    クライアントを設定したら（curlの場合は、発行されたトークンを`ANTHROPIC_AUTH_TOKEN`に設定したら）、ワークロードはこのページのエンドポイントを使用してフェデレーション設定を作成・管理します。
  </Step>
</Steps>

ワークロードが発行したトークンで実行できる操作とできない操作については、[権限と制約](https://platform.claude.com/docs/ja/manage-claude/wif-admin-api#permissions-and-constraints)を参照してください。すでに**Connect workload**ウィザードでイシュアー、サービスアカウント、またはルールを作成している場合は、再作成するのではなく、以下のエンドポイントで一覧を取得し、infrastructure-as-codeの状態にインポートしてください。

## 認証

すべてのエンドポイントは`https://api.anthropic.com/v1/organizations/`の下にあります。フェデレーションおよびサービスアカウントのエンドポイントへのすべてのリクエストには、APIバージョンヘッダーとベアラートークンが必要です。

SDKでは、これらのエンドポイントは`client.organization.service_accounts` (typescript: `client.organization.serviceAccounts`; csharp, go: `client.Organization.ServiceAccounts`; java: `client.organization().serviceAccounts()`; php: `$client->organization->serviceAccounts`)、`client.organization.federation.issuers` (csharp, go: `client.Organization.Federation.Issuers`; java: `client.organization().federation().issuers()`; php: `$client->organization->federation->issuers`)、および`client.organization.federation.rules` (csharp, go: `client.Organization.Federation.Rules`; java: `client.organization().federation().rules()`; php: `$client->organization->federation->rules`)です（CLIでは`ant organization:service-accounts`、`federation:issuers`、`federation:rules`）。SDKとCLIの例ではデフォルトのクライアントを構築します。このクライアントは`ANTHROPIC_AUTH_TOKEN`のベアラートークンを送信するか、自動化されたワークロードでは[WIFを管理するワークロードをブートストラップする](https://platform.claude.com/docs/ja/manage-claude/wif-admin-api#bootstrap-a-workload-to-manage-wif)で説明したようにフェデレーション交換を自ら実行します。SDKのlistメソッドは必要に応じて後続のページを取得するため、`limit`はページサイズを設定します。PHPとRubyの例は1ページを読み取ります。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:service-accounts list
  ```

  ```python Python
  client = anthropic.Anthropic()

  service_accounts = client.organization.service_accounts.list()

  for service_account in service_accounts:
      print(f"{service_account.id}: {service_account.name}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  for await (const serviceAccount of client.organization.serviceAccounts.list()) {
    console.log(`${serviceAccount.id}: ${serviceAccount.name}`);
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var page = await client.Organization.ServiceAccounts.List();

  await foreach (var serviceAccount in page.Paginate())
  {
      Console.WriteLine($"{serviceAccount.ID}: {serviceAccount.Name}");
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  serviceAccounts := client.Organization.ServiceAccounts.ListAutoPaging(context.Background(), anthropic.OrganizationServiceAccountListParams{})

  for serviceAccounts.Next() {
  	serviceAccount := serviceAccounts.Current()
  	fmt.Printf("%s: %s\n", serviceAccount.ID, serviceAccount.Name)
  }
  if err := serviceAccounts.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var serviceAccounts = client.organization().serviceAccounts().list();

  for (var serviceAccount : serviceAccounts.autoPager()) {
      IO.println(serviceAccount.id() + ": " + serviceAccount.name());
  }
  ```

  ```php PHP
  $client = new Client();

  $serviceAccounts = $client->organization->serviceAccounts->list();

  foreach ($serviceAccounts->getItems() as $serviceAccount) {
      echo "{$serviceAccount->id}: {$serviceAccount->name}\n";
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  service_accounts = client.organization.service_accounts.list

  service_accounts.data.each do |service_account|
    puts "#{service_account.id}: #{service_account.name}"
  end
  ```
</CodeGroup>

Admin APIキーはこれらのエンドポイントでは受け付けられません。Admin APIページの`x-api-key`の例はここには適用されません。

## サービスアカウント

[サービスアカウント](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#service-accounts)（`svac_...`）は、フェデレーションされたトークンがその身元として動作する非人間のIDです。`organization_role`を`developer`に設定してください。

サービスアカウントを作成します。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "name": "inference-worker",
      "organization_role": "developer"
    }'
  ```

  ```bash CLI
  ant organization:service-accounts create \
    --name inference-worker \
    --organization-role developer
  ```

  ```python Python
  client = anthropic.Anthropic()

  service_account = client.organization.service_accounts.create(
      name="inference-worker", organization_role="developer"
  )

  print(f"id: {service_account.id}")
  print(f"name: {service_account.name}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const serviceAccount = await client.organization.serviceAccounts.create({
    name: "inference-worker",
    organization_role: "developer"
  });

  console.log(`id: ${serviceAccount.id}`);
  console.log(`name: ${serviceAccount.name}`);
  ```

  ```csharp C#
  using Anthropic.Models.Organization.ServiceAccounts;

  AnthropicClient client = new();

  var serviceAccount = await client.Organization.ServiceAccounts.Create(new()
  {
      Name = "inference-worker",
      OrganizationRole = OrganizationRole.Developer
  });

  Console.WriteLine($"id: {serviceAccount.ID}");
  Console.WriteLine($"name: {serviceAccount.Name}");
  ```

  ```go Go
  client := anthropic.NewClient()

  serviceAccount, err := client.Organization.ServiceAccounts.New(context.Background(), anthropic.OrganizationServiceAccountNewParams{
  	Name:             "inference-worker",
  	OrganizationRole: anthropic.OrganizationServiceAccountNewParamsOrganizationRoleDeveloper,
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", serviceAccount.ID)
  fmt.Printf("name: %s\n", serviceAccount.Name)
  ```

  ```java Java
  import com.anthropic.models.organization.serviceaccounts.ServiceAccountCreateParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = ServiceAccountCreateParams.builder()
          .name("inference-worker")
          .organizationRole(ServiceAccountCreateParams.OrganizationRole.DEVELOPER)
          .build();
      var serviceAccount = client.organization().serviceAccounts().create(params);

      IO.println("id: " + serviceAccount.id());
      IO.println("name: " + serviceAccount.name());
  }
  ```

  ```php PHP
  use Anthropic\Organization\ServiceAccounts\ServiceAccountCreateParams\OrganizationRole;
  // ...

  $client = new Client();

  $serviceAccount = $client->organization->serviceAccounts->create(
      name: 'inference-worker',
      organizationRole: OrganizationRole::DEVELOPER,
  );

  echo "id: {$serviceAccount->id}\n";
  echo "name: {$serviceAccount->name}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  service_account = client.organization.service_accounts.create(
    name: "inference-worker",
    organization_role: :developer
  )

  puts "id: #{service_account.id}"
  puts "name: #{service_account.name}"
  ```
</CodeGroup>

サービスアカウントの一覧を取得します。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts?limit=20" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:service-accounts list --limit 20
  ```

  ```python Python
  client = anthropic.Anthropic()

  service_accounts = client.organization.service_accounts.list(limit=20)

  for service_account in service_accounts:
      print(f"{service_account.id}: {service_account.name}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  for await (const serviceAccount of client.organization.serviceAccounts.list({
    limit: 20
  })) {
    console.log(`${serviceAccount.id}: ${serviceAccount.name}`);
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var page = await client.Organization.ServiceAccounts.List(new() { Limit = 20 });

  await foreach (var serviceAccount in page.Paginate())
  {
      Console.WriteLine($"{serviceAccount.ID}: {serviceAccount.Name}");
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  serviceAccounts := client.Organization.ServiceAccounts.ListAutoPaging(context.Background(), anthropic.OrganizationServiceAccountListParams{
  	Limit: anthropic.Int(20),
  })

  for serviceAccounts.Next() {
  	serviceAccount := serviceAccounts.Current()
  	fmt.Printf("%s: %s\n", serviceAccount.ID, serviceAccount.Name)
  }
  if err := serviceAccounts.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.serviceaccounts.ServiceAccountListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = ServiceAccountListParams.builder()
          .limit(20)
          .build();
      var serviceAccounts = client.organization().serviceAccounts().list(params);

      for (var serviceAccount : serviceAccounts.autoPager()) {
          IO.println(serviceAccount.id() + ": " + serviceAccount.name());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $serviceAccounts = $client->organization->serviceAccounts->list(limit: 20);

  foreach ($serviceAccounts->getItems() as $serviceAccount) {
      echo "{$serviceAccount->id}: {$serviceAccount->name}\n";
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  service_accounts = client.organization.service_accounts.list(limit: 20)

  service_accounts.data.each do |service_account|
    puts "#{service_account.id}: #{service_account.name}"
  end
  ```
</CodeGroup>

サービスアカウントをアーカイブします。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/service_accounts/svac_01ABCDEFabcdef0123456789XY/archive" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:service-accounts archive svac_01ABCDEFabcdef0123456789XY
  ```

  ```python Python
  client = anthropic.Anthropic()

  service_account = client.organization.service_accounts.archive(
      "svac_01ABCDEFabcdef0123456789XY"
  )

  print(f"id: {service_account.id}")
  print(f"archived_at: {service_account.archived_at}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const serviceAccount = await client.organization.serviceAccounts.archive(
    "svac_01ABCDEFabcdef0123456789XY"
  );

  console.log(`id: ${serviceAccount.id}`);
  console.log(`archived_at: ${serviceAccount.archived_at}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var serviceAccount = await client.Organization.ServiceAccounts.Archive(
      "svac_01ABCDEFabcdef0123456789XY"
  );

  Console.WriteLine($"id: {serviceAccount.ID}");
  Console.WriteLine($"archived_at: {serviceAccount.ArchivedAt:O}");
  ```

  ```go Go
  client := anthropic.NewClient()

  serviceAccount, err := client.Organization.ServiceAccounts.Archive(
  	context.Background(),
  	"svac_01ABCDEFabcdef0123456789XY",
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", serviceAccount.ID)
  fmt.Printf("archived_at: %s\n", serviceAccount.ArchivedAt)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var serviceAccount = client.organization().serviceAccounts()
      .archive("svac_01ABCDEFabcdef0123456789XY");

  IO.println("id: " + serviceAccount.id());
  IO.println("archived_at: " + serviceAccount.archivedAt().orElseThrow());
  ```

  ```php PHP
  $client = new Client();

  $serviceAccount = $client->organization->serviceAccounts->archive(
      serviceAccountID: 'svac_01ABCDEFabcdef0123456789XY',
  );

  echo "id: {$serviceAccount->id}\n";
  echo "archived_at: {$serviceAccount->archivedAt?->format(DATE_ATOM)}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  service_account_id = "svac_01ABCDEFabcdef0123456789XY"
  service_account = client.organization.service_accounts.archive(service_account_id)

  puts "id: #{service_account.id}"
  puts "archived_at: #{service_account.archived_at}"
  ```
</CodeGroup>

作成エンドポイントは新しいサービスアカウントを返します。

```json
{
  "id": "svac_...",
  "name": "inference-worker",
  "organization_role": "developer",
  "created_at": "...",
  "type": "service_account",
  "...": "..."
}
```

単一のサービスアカウントを読み取りまたは更新するには、`/v1/organizations/service_accounts/{service_account_id}`に対して`GET`と`POST`を使用します。フェデレーションされたトークンがワークスペース内で動作できるようにするには、サービスアカウントがそのワークスペースのメンバーである必要があります。すべてのサービスアカウントは、組織のデフォルトワークスペースに暗黙的なメンバーシップを持っています。他のワークスペースへの明示的なメンバーシップは、`/v1/organizations/service_accounts/{service_account_id}/workspaces`に対する`GET`、`POST`、`DELETE`で追加します。`DELETE`は`.../workspaces/{workspace_id}`を対象とします。

パラメータの詳細とレスポンススキーマの全体については、[サービスアカウントAPIリファレンス](https://platform.claude.com/docs/ja/api/organization/service_accounts)を参照してください。

## フェデレーションイシュアー

[フェデレーションイシュアー](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#federation-issuers)（`fdis_...`）は、OIDC IDプロバイダーを組織に登録します。`jwks`フィールドは、Anthropicがプロバイダーの署名鍵を取得する方法を制御する判別共用体（discriminated union）です。

| `jwks`の値                                 | 使用する場面                                                        |
| ---------------------------------------- | ------------------------------------------------------------- |
| `{"type": "discovery"}`                  | プロバイダーがイシュアーURLで`/.well-known/openid-configuration`を提供している場合。 |
| `{"type": "explicit_url", "url": "..."}` | JWKSエンドポイントを直接指定する場合。                                         |
| `{"type": "inline", "keys": [...]}`      | パブリックインターネットから到達できないプロバイダー向けに鍵セットをアップロードする場合。                 |

イシュアーを登録します。この例では、JWKSディスカバリーを使用してGitHub Actionsを登録します。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_issuers" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "name": "github-actions",
      "issuer_url": "https://token.actions.githubusercontent.com",
      "jwks": {"type": "discovery"}
    }'
  ```

  ```bash CLI
  ant organization:federation:issuers create \
    --name github-actions \
    --issuer-url https://token.actions.githubusercontent.com \
    --jwks '{type: discovery}'
  ```

  ```python Python
  client = anthropic.Anthropic()

  issuer = client.organization.federation.issuers.create(
      name="github-actions",
      issuer_url="https://token.actions.githubusercontent.com",
      jwks={"type": "discovery"},
  )

  print(f"id: {issuer.id}")
  print(f"name: {issuer.name}")
  print(f"issuer_url: {issuer.issuer_url}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const issuer = await client.organization.federation.issuers.create({
    name: "github-actions",
    issuer_url: "https://token.actions.githubusercontent.com",
    jwks: { type: "discovery" }
  });

  console.log(`id: ${issuer.id}`);
  console.log(`name: ${issuer.name}`);
  console.log(`issuer_url: ${issuer.issuer_url}`);
  ```

  ```csharp C#
  using Anthropic.Models.Organization.Federation.Issuers;

  AnthropicClient client = new();

  var issuer = await client.Organization.Federation.Issuers.Create(new()
  {
      Name = "github-actions",
      IssuerUrl = "https://token.actions.githubusercontent.com",
      Jwks = new JwksDiscovery()
  });

  Console.WriteLine($"id: {issuer.ID}");
  Console.WriteLine($"name: {issuer.Name}");
  Console.WriteLine($"issuer_url: {issuer.IssuerUrl}");
  ```

  ```go Go
  client := anthropic.NewClient()

  issuer, err := client.Organization.Federation.Issuers.New(context.Background(), anthropic.OrganizationFederationIssuerNewParams{
  	Name:      "github-actions",
  	IssuerURL: "https://token.actions.githubusercontent.com",
  	JWKS: anthropic.OrganizationFederationIssuerNewParamsJWKSUnion{
  		OfDiscovery: &anthropic.JWKSDiscoveryParam{},
  	},
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", issuer.ID)
  fmt.Printf("name: %s\n", issuer.Name)
  fmt.Printf("issuer_url: %s\n", issuer.IssuerURL)
  ```

  ```java Java
  import com.anthropic.models.organization.federation.issuers.JwksDiscovery;
  import com.anthropic.models.organization.federation.issuers.IssuerCreateParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = IssuerCreateParams.builder()
          .name("github-actions")
          .issuerUrl("https://token.actions.githubusercontent.com")
          .jwks(JwksDiscovery.builder().build())
          .build();
      var issuer = client.organization().federation().issuers().create(params);

      IO.println("id: " + issuer.id());
      IO.println("name: " + issuer.name());
      IO.println("issuer_url: " + issuer.issuerUrl());
  }
  ```

  ```php PHP
  $client = new Client();

  $issuer = $client->organization->federation->issuers->create(
      name: 'github-actions',
      issuerURL: 'https://token.actions.githubusercontent.com',
      jwks: ['type' => 'discovery'],
  );

  echo "id: {$issuer->id}\n";
  echo "name: {$issuer->name}\n";
  echo "issuer_url: {$issuer->issuerURL}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  issuer = client.organization.federation.issuers.create(
    name: "github-actions",
    issuer_url: "https://token.actions.githubusercontent.com",
    jwks: {type: :discovery}
  )

  puts "id: #{issuer.id}"
  puts "name: #{issuer.name}"
  puts "issuer_url: #{issuer.issuer_url}"
  ```
</CodeGroup>

イシュアーの一覧を取得します。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_issuers?limit=20" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:federation:issuers list --limit 20
  ```

  ```python Python
  client = anthropic.Anthropic()

  issuers = client.organization.federation.issuers.list(limit=20)

  for issuer in issuers:
      print(f"{issuer.id}: {issuer.name}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  for await (const issuer of client.organization.federation.issuers.list({ limit: 20 })) {
    console.log(`${issuer.id}: ${issuer.name}`);
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var page = await client.Organization.Federation.Issuers.List(new() { Limit = 20 });

  await foreach (var issuer in page.Paginate())
  {
      Console.WriteLine($"{issuer.ID}: {issuer.Name}");
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  issuers := client.Organization.Federation.Issuers.ListAutoPaging(context.Background(), anthropic.OrganizationFederationIssuerListParams{
  	Limit: anthropic.Int(20),
  })

  for issuers.Next() {
  	issuer := issuers.Current()
  	fmt.Printf("%s: %s\n", issuer.ID, issuer.Name)
  }
  if err := issuers.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.federation.issuers.IssuerListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = IssuerListParams.builder()
          .limit(20)
          .build();
      var issuers = client.organization().federation().issuers().list(params);

      for (var issuer : issuers.autoPager()) {
          IO.println(issuer.id() + ": " + issuer.name());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $issuers = $client->organization->federation->issuers->list(limit: 20);

  foreach ($issuers->getItems() as $issuer) {
      echo "{$issuer->id}: {$issuer->name}\n";
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  issuers = client.organization.federation.issuers.list(limit: 20)

  issuers.data.each do |issuer|
    puts "#{issuer.id}: #{issuer.name}"
  end
  ```
</CodeGroup>

イシュアーをアーカイブします。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/federation_issuers/fdis_01ABCDEFabcdef0123456789XY/archive" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:federation:issuers archive \
    --federation-issuer-id fdis_01ABCDEFabcdef0123456789XY
  ```

  ```python Python
  client = anthropic.Anthropic()

  issuer = client.organization.federation.issuers.archive(
      "fdis_01ABCDEFabcdef0123456789XY"
  )

  print(f"id: {issuer.id}")
  print(f"archived_at: {issuer.archived_at}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const issuer = await client.organization.federation.issuers.archive(
    "fdis_01ABCDEFabcdef0123456789XY"
  );

  console.log(`id: ${issuer.id}`);
  console.log(`archived_at: ${issuer.archived_at}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var issuer = await client.Organization.Federation.Issuers.Archive(
      "fdis_01ABCDEFabcdef0123456789XY"
  );

  Console.WriteLine($"id: {issuer.ID}");
  Console.WriteLine($"archived_at: {issuer.ArchivedAt:O}");
  ```

  ```go Go
  client := anthropic.NewClient()

  issuer, err := client.Organization.Federation.Issuers.Archive(
  	context.Background(),
  	"fdis_01ABCDEFabcdef0123456789XY",
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", issuer.ID)
  fmt.Printf("archived_at: %s\n", issuer.ArchivedAt)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var issuer = client.organization().federation().issuers()
      .archive("fdis_01ABCDEFabcdef0123456789XY");

  IO.println("id: " + issuer.id());
  IO.println("archived_at: " + issuer.archivedAt().orElseThrow());
  ```

  ```php PHP
  $client = new Client();

  $issuer = $client->organization->federation->issuers->archive(
      federationIssuerID: 'fdis_01ABCDEFabcdef0123456789XY',
  );

  echo "id: {$issuer->id}\n";
  echo "archived_at: {$issuer->archivedAt?->format(DATE_ATOM)}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  issuer_id = "fdis_01ABCDEFabcdef0123456789XY"
  issuer = client.organization.federation.issuers.archive(issuer_id)

  puts "id: #{issuer.id}"
  puts "archived_at: #{issuer.archived_at}"
  ```
</CodeGroup>

単一のイシュアーを読み取りまたは更新するには、`/v1/organizations/federation_issuers/{issuer_id}`に対して`GET`と`POST`を使用します。OAuthの呼び出し元は、`oauth_scope`が`workspace:developer`または`workspace:inference`以外であるルールの基盤となっているイシュアーを更新できません。[権限と制約](https://platform.claude.com/docs/ja/manage-claude/wif-admin-api#permissions-and-constraints)を参照してください。

パラメータの詳細とレスポンススキーマの全体については、[フェデレーションイシュアーAPIリファレンス](https://platform.claude.com/docs/ja/api/organization/federation/issuers)を参照してください。

## フェデレーションルール

[フェデレーションルール](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#federation-rules)（`fdrl_...`）は、イシュアーをサービスアカウントにバインドします。ルールの一致条件を満たすイシュアーからのJWTは、ルールのターゲットとして動作するトークンを発行できます。作成リクエストの`workspace_id`は、作成時にそのワークスペースでルールを有効にします。後から`/federation_rules/{rule_id}/workspaces`サブリソースを通じてワークスペースを追加できます。作成時には`workspace_id`または`applies_to_all_workspaces: true`のいずれかが必須です。

ルールを作成します。この例では、mainブランチからのGitHub Actionsデプロイがサービスアカウントとして動作できるようにします。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_rules" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "name": "gha-deploy",
      "issuer_id": "fdis_01ABCDEFabcdef0123456789XY",
      "match": {
        "subject_prefix": "repo:my-org/my-repo:ref:refs/heads/main",
        "claims": {"repository_owner": "my-org"}
      },
      "target": {
        "type": "service_account",
        "service_account_id": "svac_01ABCDEFabcdef0123456789XY"
      },
      "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      "oauth_scope": "workspace:developer",
      "token_lifetime_seconds": 600
    }'
  ```

  ```bash CLI
  ant organization:federation:rules create <<'YAML'
  name: gha-deploy
  issuer_id: fdis_01ABCDEFabcdef0123456789XY
  match:
    subject_prefix: "repo:my-org/my-repo:ref:refs/heads/main"
    claims:
      repository_owner: my-org
  target:
    type: service_account
    service_account_id: svac_01ABCDEFabcdef0123456789XY
  workspace_id: wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ
  oauth_scope: "workspace:developer"
  token_lifetime_seconds: 600
  YAML
  ```

  ```python Python
  client = anthropic.Anthropic()

  rule = client.organization.federation.rules.create(
      name="gha-deploy",
      issuer_id="fdis_01ABCDEFabcdef0123456789XY",
      match={
          "subject_prefix": "repo:my-org/my-repo:ref:refs/heads/main",
          "claims": {"repository_owner": "my-org"},
      },
      target={
          "type": "service_account",
          "service_account_id": "svac_01ABCDEFabcdef0123456789XY",
      },
      workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      oauth_scope="workspace:developer",
      token_lifetime_seconds=600,
  )

  print(f"id: {rule.id}")
  print(f"name: {rule.name}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rule = await client.organization.federation.rules.create({
    name: "gha-deploy",
    issuer_id: "fdis_01ABCDEFabcdef0123456789XY",
    match: {
      subject_prefix: "repo:my-org/my-repo:ref:refs/heads/main",
      claims: { repository_owner: "my-org" }
    },
    target: {
      type: "service_account",
      service_account_id: "svac_01ABCDEFabcdef0123456789XY"
    },
    workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
    oauth_scope: "workspace:developer",
    token_lifetime_seconds: 600
  });

  console.log(`id: ${rule.id}`);
  console.log(`name: ${rule.name}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rule = await client.Organization.Federation.Rules.Create(new()
  {
      Name = "gha-deploy",
      IssuerID = "fdis_01ABCDEFabcdef0123456789XY",
      Match = new()
      {
          SubjectPrefix = "repo:my-org/my-repo:ref:refs/heads/main",
          Claims = new Dictionary<string, string> { ["repository_owner"] = "my-org" }
      },
      Target = new() { ServiceAccountID = "svac_01ABCDEFabcdef0123456789XY" },
      WorkspaceID = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      OAuthScope = "workspace:developer",
      TokenLifetimeSeconds = 600
  });

  Console.WriteLine($"id: {rule.ID}");
  Console.WriteLine($"name: {rule.Name}");
  ```

  ```go Go
  client := anthropic.NewClient()

  rule, err := client.Organization.Federation.Rules.New(context.Background(), anthropic.OrganizationFederationRuleNewParams{
  	Name:     "gha-deploy",
  	IssuerID: "fdis_01ABCDEFabcdef0123456789XY",
  	Match: anthropic.FederationRuleMatchParam{
  		SubjectPrefix: anthropic.String("repo:my-org/my-repo:ref:refs/heads/main"),
  		Claims:        map[string]string{"repository_owner": "my-org"},
  	},
  	Target: anthropic.ServiceAccountTargetParam{
  		ServiceAccountID: "svac_01ABCDEFabcdef0123456789XY",
  	},
  	WorkspaceID:          anthropic.String("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"),
  	OAuthScope:           "workspace:developer",
  	TokenLifetimeSeconds: anthropic.Int(600),
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", rule.ID)
  fmt.Printf("name: %s\n", rule.Name)
  ```

  ```java Java
  import com.anthropic.core.JsonValue;
  import com.anthropic.models.organization.federation.rules.FederationRuleMatch;
  import com.anthropic.models.organization.federation.rules.ServiceAccountTarget;
  import com.anthropic.models.organization.federation.rules.RuleCreateParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var match = FederationRuleMatch.builder()
          .subjectPrefix("repo:my-org/my-repo:ref:refs/heads/main")
          .claims(FederationRuleMatch.Claims.builder()
              .putAdditionalProperty("repository_owner", JsonValue.from("my-org"))
              .build())
          .build();
      var params = RuleCreateParams.builder()
          .name("gha-deploy")
          .issuerId("fdis_01ABCDEFabcdef0123456789XY")
          .match(match)
          .target(ServiceAccountTarget.of("svac_01ABCDEFabcdef0123456789XY"))
          .workspaceId("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ")
          .oauthScope("workspace:developer")
          .tokenLifetimeSeconds(600)
          .build();
      var rule = client.organization().federation().rules().create(params);

      IO.println("id: " + rule.id());
      IO.println("name: " + rule.name());
  }
  ```

  ```php PHP
  $client = new Client();

  $rule = $client->organization->federation->rules->create(
      name: 'gha-deploy',
      issuerID: 'fdis_01ABCDEFabcdef0123456789XY',
      match: [
          'subjectPrefix' => 'repo:my-org/my-repo:ref:refs/heads/main',
          'claims' => ['repository_owner' => 'my-org'],
      ],
      target: [
          'type' => 'service_account',
          'serviceAccountID' => 'svac_01ABCDEFabcdef0123456789XY',
      ],
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
      oauthScope: 'workspace:developer',
      tokenLifetimeSeconds: 600,
  );

  echo "id: {$rule->id}\n";
  echo "name: {$rule->name}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rule = client.organization.federation.rules.create(
    name: "gha-deploy",
    issuer_id: "fdis_01ABCDEFabcdef0123456789XY",
    match: {
      subject_prefix: "repo:my-org/my-repo:ref:refs/heads/main",
      claims: {repository_owner: "my-org"}
    },
    target: {
      type: :service_account,
      service_account_id: "svac_01ABCDEFabcdef0123456789XY"
    },
    workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
    oauth_scope: "workspace:developer",
    token_lifetime_seconds: 600
  )

  puts "id: #{rule.id}"
  puts "name: #{rule.name}"
  ```
</CodeGroup>

ルールの一覧を取得します。必要に応じてイシュアーでフィルタリングできます。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_rules?issuer_id=fdis_01ABCDEFabcdef0123456789XY" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:federation:rules list \
    --issuer-id fdis_01ABCDEFabcdef0123456789XY
  ```

  ```python Python
  client = anthropic.Anthropic()

  rules = client.organization.federation.rules.list(
      issuer_id="fdis_01ABCDEFabcdef0123456789XY"
  )

  for rule in rules:
      print(f"{rule.id}: {rule.name}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  for await (const rule of client.organization.federation.rules.list({
    issuer_id: "fdis_01ABCDEFabcdef0123456789XY"
  })) {
    console.log(`${rule.id}: ${rule.name}`);
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var page = await client.Organization.Federation.Rules.List(new()
  {
      IssuerID = "fdis_01ABCDEFabcdef0123456789XY"
  });

  await foreach (var rule in page.Paginate())
  {
      Console.WriteLine($"{rule.ID}: {rule.Name}");
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rules := client.Organization.Federation.Rules.ListAutoPaging(context.Background(), anthropic.OrganizationFederationRuleListParams{
  	IssuerID: anthropic.String("fdis_01ABCDEFabcdef0123456789XY"),
  })

  for rules.Next() {
  	rule := rules.Current()
  	fmt.Printf("%s: %s\n", rule.ID, rule.Name)
  }
  if err := rules.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.federation.rules.RuleListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = RuleListParams.builder()
          .issuerId("fdis_01ABCDEFabcdef0123456789XY")
          .build();
      var rules = client.organization().federation().rules().list(params);

      for (var rule : rules.autoPager()) {
          IO.println(rule.id() + ": " + rule.name());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $rules = $client->organization->federation->rules->list(
      issuerID: 'fdis_01ABCDEFabcdef0123456789XY',
  );

  foreach ($rules->getItems() as $rule) {
      echo "{$rule->id}: {$rule->name}\n";
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rules = client.organization.federation.rules.list(
    issuer_id: "fdis_01ABCDEFabcdef0123456789XY"
  )

  rules.data.each do |rule|
    puts "#{rule.id}: #{rule.name}"
  end
  ```
</CodeGroup>

ルールをアーカイブします。

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/federation_rules/fdrl_01ABCDEFabcdef0123456789XY/archive" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:federation:rules archive \
    --federation-rule-id fdrl_01ABCDEFabcdef0123456789XY
  ```

  ```python Python
  client = anthropic.Anthropic()

  rule = client.organization.federation.rules.archive("fdrl_01ABCDEFabcdef0123456789XY")

  print(f"id: {rule.id}")
  print(f"archived_at: {rule.archived_at}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rule = await client.organization.federation.rules.archive(
    "fdrl_01ABCDEFabcdef0123456789XY"
  );

  console.log(`id: ${rule.id}`);
  console.log(`archived_at: ${rule.archived_at}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rule = await client.Organization.Federation.Rules.Archive(
      "fdrl_01ABCDEFabcdef0123456789XY"
  );

  Console.WriteLine($"id: {rule.ID}");
  Console.WriteLine($"archived_at: {rule.ArchivedAt:O}");
  ```

  ```go Go
  client := anthropic.NewClient()

  rule, err := client.Organization.Federation.Rules.Archive(
  	context.Background(),
  	"fdrl_01ABCDEFabcdef0123456789XY",
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", rule.ID)
  fmt.Printf("archived_at: %s\n", rule.ArchivedAt)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var rule = client.organization().federation().rules()
      .archive("fdrl_01ABCDEFabcdef0123456789XY");

  IO.println("id: " + rule.id());
  IO.println("archived_at: " + rule.archivedAt().orElseThrow());
  ```

  ```php PHP
  $client = new Client();

  $rule = $client->organization->federation->rules->archive(
      federationRuleID: 'fdrl_01ABCDEFabcdef0123456789XY',
  );

  echo "id: {$rule->id}\n";
  echo "archived_at: {$rule->archivedAt?->format(DATE_ATOM)}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rule_id = "fdrl_01ABCDEFabcdef0123456789XY"
  rule = client.organization.federation.rules.archive(rule_id)

  puts "id: #{rule.id}"
  puts "archived_at: #{rule.archived_at}"
  ```
</CodeGroup>

一覧エンドポイントは、ルールの1ページ分と次のページのカーソルを返します。

```json
{
  "data": [{ "id": "fdrl_...", "name": "gha-deploy", "...": "..." }],
  "next_page": "..."
}
```

単一のルールを読み取りまたは更新するには、`/v1/organizations/federation_rules/{rule_id}`に対して`GET`と`POST`を使用します。ルールがトークンを発行できるワークスペースを管理するには、`/v1/organizations/federation_rules/{rule_id}/workspaces`に対して`GET`と`POST`を、`/v1/organizations/federation_rules/{rule_id}/workspaces/{workspace_id}`に対して`DELETE`を使用します。

パラメータの詳細とレスポンススキーマの全体については、[フェデレーションルールAPIリファレンス](https://platform.claude.com/docs/ja/api/organization/federation/rules)を参照してください。

## 権限と制約

<Note>
  * OAuthで認証された呼び出し元は、`oauth_scope`が`workspace:developer`または`workspace:inference`であるルールのみを作成または変更できます。それ以外のスコープ（`org:admin`や`workspace:manage_tunnels`など）を持つルールを作成または変更するには、Consoleを使用してください。
  * OAuthの呼び出し元は、`oauth_scope`が`workspace:developer`または`workspace:inference`以外（`org:admin`や`workspace:manage_tunnels`など）であるルールの基盤となっているフェデレーションイシュアーを更新できません。ワークスペーススコープのルールの背後にあるイシュアーをAPI経由で更新可能な状態に保つために、ブートストラップルール専用のイシュアーを登録することを検討してください。
  * Admin APIキーは、読み取りでも書き込みでも、これらのエンドポイントでは受け付けられません。`org:admin` OAuthトークンを使用してください。
</Note>

`oauth_scope: org:admin`を持つルールは、`organization_role`が`admin`であるサービスアカウントをターゲットにする必要があります。リソース名は`^[a-z0-9-]+$`に一致し、1〜255文字で、リソースタイプごとに組織内で一意である必要があります。フィールドレベルの制約の全体については、[バリデーションルール](https://platform.claude.com/docs/ja/manage-claude/wif-reference#validation-rules)を参照してください。

## ページネーションとアーカイブ

サービスアカウント、フェデレーションイシュアー、フェデレーションルールの一覧エンドポイントは、`limit`（1〜100、デフォルト20）と、前のレスポンスから取得した`page`カーソルを受け付けます。レスポンスの`next_page`の値を、次のリクエストの`page`クエリパラメータとして渡してください。ルールのワークスペースサブリソースの一覧は、ページネーションなしで全件を返します。アーカイブされたリソースはデフォルトで一覧から非表示になります。含めるには`include_archived=true`を渡してください。

アーカイブはソフトデリートであり、冪等です。すでにアーカイブ済みのリソースをアーカイブしても成功します。有効なフェデレーションルールがまだ参照している間は、イシュアーまたはサービスアカウントのアーカイブは`400`を返します。先にルールをアーカイブしてください。

## 関連項目

* [Workload Identity Federation](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation)：概念とConsoleでのセットアップ手順
* [WIFリファレンス](https://platform.claude.com/docs/ja/manage-claude/wif-reference)：環境変数、バリデーションルール、OAuthスコープ、エラーコード
* [Admin API](https://platform.claude.com/docs/ja/manage-claude/admin-api)：組織管理機能のその他の部分
* [Admin APIリファレンス](https://platform.claude.com/docs/ja/api/organization)：サービスアカウントおよびフェデレーションエンドポイントの生成されたリクエストおよびレスポンススキーマ
