---
title: WIF mit der Admin API verwalten
url: https://platform.claude.com/docs/de/manage-claude/wif-admin-api
description: Erstelle und verwalte Service-Accounts, Issuer und Regeln für Workload Identity Federation programmatisch für Infrastructure-as-Code- und CI-Workflows.
---

Mit der Admin API kannst du Ressourcen für [Workload Identity Federation](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation) programmatisch erstellen und verwalten: Service-Accounts, Federation-Issuer und Federation-Regeln. Verwende sie, um deine Federation-Konfiguration als „infrastructure as code“ (Infrastruktur als Code) zu pflegen, sie aus der CI heraus bereitzustellen und sie über Organisationen hinweg zu reproduzieren, anstatt dich durch die Claude Console zu klicken. Diese Endpunkte teilen sich das Pfadpräfix `/v1/organizations` mit dem Rest der [Admin API](https://platform.claude.com/docs/de/manage-claude/admin-api).

## Voraussetzungen

Jede Anfrage auf dieser Seite authentifiziert sich mit einem OAuth-Bearer-Token, das den Scope `org:admin` trägt. Der Scope wird nur Organisationsmitgliedern mit der Rolle Admin, Owner oder Primary Owner gewährt und gewährt Zugriff auf die gesamte Organisation: Jede Workspace-Bindung wird ignoriert. Es gibt zwei Wege, ein Token zu erhalten, und sie tragen unterschiedliche Berechtigungen: Ein Token aus deinem eigenen Login handelt als Benutzer, während ein föderiertes Token als Service-Account handelt und nicht jede Operation auf dieser Seite ausführen kann.

### Interaktiv (dein Terminal)

Melde dich mit der [`ant` CLI](https://platform.claude.com/docs/de/cli-sdks-libraries/cli/quickstart) unter einem dedizierten Profil an, fordere dabei den Scope `org:admin` an (siehe [Admin-Zugriff](https://platform.claude.com/docs/de/cli-sdks-libraries/cli/authentication#admin-access)) und exportiere dann das Bearer-Token. Die Anmeldung mit `--profile admin` speichert die `org:admin`-Anmeldedaten unter einem eigenen Profilnamen und macht dieses Profil außerdem zum aktiven Profil der CLI, und die exportierte Variable gilt für jeden SDK- und CLI-Aufruf in dieser Shell; verwende daher eine Shell, die du für die Administration reservierst, setze die Variable zurück, wenn du fertig bist, und schalte die CLI mit `ant profile activate default` zurück:

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

Interaktive Token sind kurzlebig; wenn Anfragen beginnen, 401 zurückzugeben, führe den Export-Befehl erneut aus (er aktualisiert das Token automatisch).

Die SDKs und die `ant` CLI lesen `ANTHROPIC_AUTH_TOKEN` automatisch; lass `ANTHROPIC_API_KEY` in derselben Shell ungesetzt, da diese Endpunkte API-Keys ablehnen und manche Clients den Key bevorzugen, wenn beide gesetzt sind.

### Workload (CI und Automatisierung)

Erstelle eine Federation-Regel mit `oauth_scope: org:admin`, die auf einen Service-Account zielt, dessen `organization_role` `admin` ist. Die Regel selbst muss in der Claude Console erstellt werden: Einem Workload Organisations-Admin-Zugriff zu gewähren, ist eine bewusste menschliche Handlung und nichts, was eine Automatisierung für sich selbst bootstrappen kann. Der nächste Abschnitt führt durch diese einmalige Einrichtung pro Organisation.

## Einen Workload zur Verwaltung von WIF bootstrappen

Eine einzige in der Console erstellte Regel genügt, um den Rest deiner Federation-Konfiguration unter Infrastructure as Code zu stellen: Gewähre einem einzelnen vertrauenswürdigen Workload den Scope `org:admin` und lass diesen Workload Federation-Issuer und jede Workspace-bezogene Federation-Regel über diese API verwalten.

<Steps>
  <Step title="Die org:admin-Regel in der Console erstellen">
    Gehe in der Claude Console zur Seite [Workload identity](https://platform.claude.com/settings/workload-identity-federation) (`platform.claude.com/settings/workload-identity-federation`) und wähle **Connect workload**, um eine Federation-Regel für deinen Automatisierungs-Workload zu erstellen, zum Beispiel einen GitHub-Actions-Workflow in deinem Infrastruktur-Repository. Setze unter **Advanced rule options** den OAuth-Scope der Regel auf `org:admin`: Der Assistent erstellt dann den neuen Service-Account mit der Organisationsrolle Admin (oder fordert dich auf, einen bestehenden Admin-Service-Account als Ziel auszuwählen).

    <Warning>
      Stimme die Regel auf genau eine Workload-Identität ab, nicht auf ein breites Muster. `subject_prefix` ist eine exakte Übereinstimmung, sofern es nicht auf `*` endet. Pinne für GitHub Actions das Subject auf einen geschützten Branch, etwa `repo:my-org/my-repo:ref:refs/heads/main`. Ein abschließender Wildcard wie `repo:my-org/my-repo:*` passt auch auf `pull_request`-Läufe, einschließlich Läufen, die aus Forks ausgelöst werden, sodass jeder, der einen Pull Request gegen das Repository öffnen könnte, ein `org:admin`-Token prägen könnte. Siehe [Einschränken, welche Workflows sich authentifizieren können](https://platform.claude.com/docs/de/manage-claude/wif-providers/github-actions#restrict-which-workflows-can-authenticate).
    </Warning>
  </Step>

  <Step title="Das Identitätstoken des Workloads austauschen">
    Ein Workload, der eines der SDKs oder die `ant` CLI verwendet, führt den Austausch nicht selbst durch. Richte den Client mit den Federation-Umgebungsvariablen auf die Regel aus und konstruiere ihn ohne Argumente, genau wie für Inferenz in [Den SDK-Client konstruieren](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation#construct-the-sdk-client); der Client tauscht das Identitätstoken bei der ersten Anfrage aus und liest, bevor das resultierende Zugriffstoken abläuft, das Identitätstoken erneut ein und tauscht es wieder aus:

    ```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 ist nur erforderlich, wenn die Regel für alle
    # Workspaces oder mehr als einen aktiviert ist; die org:admin-Endpunkte ignorieren die Bindung.
    unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN       # both take precedence over federation
    ```

    Die `ant` CLI liest dieselben Variablen oder akzeptiert die Flags `--federation-rule`, `--organization-id`, `--service-account-id` und `--identity-token-file`. Verwende für einen Workload, der mehr als einen `ant`-Befehl ausführt, ein [Federation-Profil](https://platform.claude.com/docs/de/manage-claude/wif-reference#profile-configuration-file) anstelle von Flags oder Umgebungsvariablen: Mit Flags oder Variablen tauscht die CLI das Identitätstoken in jedem Prozess erneut aus, und Identitätstoken, die einen `jti`-Claim tragen (GitHub-Actions-Token tun das), werden nur einmal akzeptiert, sodass ein zweiter Befehl abgelehnt würde; ein Profil ist außerdem der einzige Weg, der CLI eine `workspace_id` für den Austausch mitzugeben, wenn die Regel für alle Workspaces oder mehr als einen aktiviert ist, denn anders als die SDKs übergibt die CLI `ANTHROPIC_WORKSPACE_ID` oder `--workspace-id` nicht an den Austausch. Jedes SDK akzeptiert dieselben Einstellungen auch als explizite Konstruktorargumente, pro Sprache gezeigt in [Den SDK-Client konstruieren](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation#construct-the-sdk-client). Siehe [Umgebungsvariablen](https://platform.claude.com/docs/de/manage-claude/wif-reference#environment-variables) und [Rangfolge der Anmeldedaten](https://platform.claude.com/docs/de/manage-claude/wif-reference#credential-precedence) für die vollständige Liste und Reihenfolge.

    Ein Workload, der die API mit curl aufruft, tauscht das JWT selbst gegen ein kurzlebiges `org:admin`-Bearer-Token aus, mit demselben [Token-Austausch](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation#authenticate-from-your-workload) wie jeder andere föderierte Workload, und sendet es im Header `authorization: Bearer`.
  </Step>

  <Step title="Issuer und Workspace-bezogene Regeln über die API verwalten">
    Mit dem konfigurierten Client (oder, für curl, dem geprägten Token in `ANTHROPIC_AUTH_TOKEN`) erstellt und verwaltet der Workload deine Federation-Konfiguration mit den Endpunkten auf dieser Seite.
  </Step>
</Steps>

Welche Operationen ein vom Workload geprägtes Token ausführen kann und welche nicht, findest du unter [Berechtigungen und Einschränkungen](https://platform.claude.com/docs/de/manage-claude/wif-admin-api#permissions-and-constraints). Wenn du bereits Issuer, Service-Accounts oder Regeln mit dem Assistenten **Connect workload** erstellt hast, liste sie mit den folgenden Endpunkten auf und importiere sie in deinen Infrastructure-as-Code-Zustand, anstatt sie neu zu erstellen.

## Authentifizierung

Alle Endpunkte liegen unter `https://api.anthropic.com/v1/organizations/`. Jede Anfrage an die Federation- und Service-Account-Endpunkte benötigt den API-Versions-Header und das Bearer-Token:

In den SDKs sind diese Endpunkte `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`) und `client.organization.federation.rules` (csharp, go: `client.Organization.Federation.Rules`; java: `client.organization().federation().rules()`; php: `$client->organization->federation->rules`) (`ant organization:service-accounts`, `federation:issuers` und `federation:rules` in der CLI). Die SDK- und CLI-Beispiele erstellen den Standard-Client, der das Bearer-Token aus `ANTHROPIC_AUTH_TOKEN` sendet oder in einem automatisierten Workload den Federation-Austausch selbst durchführt, wie in [Einen Workload zur Verwaltung von WIF bootstrappen](https://platform.claude.com/docs/de/manage-claude/wif-admin-api#bootstrap-a-workload-to-manage-wif) beschrieben. SDK-Listenmethoden rufen weitere Seiten bei Bedarf ab, daher legt `limit` die Seitengröße fest; die PHP- und Ruby-Beispiele lesen eine Seite.

<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-Keys werden an diesen Endpunkten nicht akzeptiert; die `x-api-key`-Beispiele der Admin-API-Seite gelten hier nicht.

## Service-Accounts

Ein [Service-Account](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation#service-accounts) (`svac_...`) ist die nicht-menschliche Identität, als die ein föderiertes Token handelt. Setze `organization_role` auf `developer`.

Einen Service-Account erstellen:

<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>

Service-Accounts auflisten:

<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>

Einen Service-Account archivieren:

<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>

Der Create-Endpunkt gibt den neuen Service-Account zurück:

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

Um einen einzelnen Service-Account zu lesen oder zu aktualisieren, verwende `GET` und `POST` auf `/v1/organizations/service_accounts/{service_account_id}`. Ein Service-Account muss Mitglied eines Workspace sein, bevor föderierte Token darin handeln können. Jeder Service-Account hat eine implizite Mitgliedschaft im Standard-Workspace deiner Organisation; füge explizite Mitgliedschaften für andere Workspaces mit `GET`, `POST` und `DELETE` auf `/v1/organizations/service_accounts/{service_account_id}/workspaces` hinzu, wobei `DELETE` auf `.../workspaces/{workspace_id}` zielt.

Vollständige Parameterdetails und Antwortschemas findest du in der [API-Referenz für Service-Accounts](https://platform.claude.com/docs/de/api/organization/service_accounts).

## Federation-Issuer

Ein [Federation-Issuer](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation#federation-issuers) (`fdis_...`) registriert einen OIDC-Identitätsanbieter bei deiner Organisation. Das Feld `jwks` ist eine diskriminierte Union, die steuert, wie Anthropic die Signaturschlüssel des Anbieters abruft:

| `jwks`-Wert                              | Wann zu verwenden                                                                                  |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `{"type": "discovery"}`                  | Der Anbieter stellt `/.well-known/openid-configuration` unter der Issuer-URL bereit.               |
| `{"type": "explicit_url", "url": "..."}` | Direkt auf einen JWKS-Endpunkt zeigen.                                                             |
| `{"type": "inline", "keys": [...]}`      | Den Schlüsselsatz für Anbieter hochladen, die aus dem öffentlichen Internet nicht erreichbar sind. |

Einen Issuer registrieren. Dieses Beispiel registriert GitHub Actions mit JWKS-Discovery:

<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>

Issuer auflisten:

<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>

Einen Issuer archivieren:

<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>

Um einen einzelnen Issuer zu lesen oder zu aktualisieren, verwende `GET` und `POST` auf `/v1/organizations/federation_issuers/{issuer_id}`. Ein OAuth-Aufrufer kann keinen Issuer aktualisieren, der hinter einer Regel steht, deren `oauth_scope` etwas anderes als `workspace:developer` oder `workspace:inference` ist; siehe [Berechtigungen und Einschränkungen](https://platform.claude.com/docs/de/manage-claude/wif-admin-api#permissions-and-constraints).

Vollständige Parameterdetails und Antwortschemas findest du in der [API-Referenz für Federation-Issuer](https://platform.claude.com/docs/de/api/organization/federation/issuers).

## Federation-Regeln

Eine [Federation-Regel](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation#federation-rules) (`fdrl_...`) bindet einen Issuer an einen Service-Account: JWTs des Issuers, die die Match-Bedingungen der Regel erfüllen, können Token prägen, die als Ziel der Regel handeln. Die `workspace_id` in der Create-Anfrage aktiviert die Regel bei der Erstellung in diesem Workspace; füge später weitere Workspaces über die Sub-Ressource `/federation_rules/{rule_id}/workspaces` hinzu. Beim Erstellen ist entweder `workspace_id` oder `applies_to_all_workspaces: true` erforderlich.

Eine Regel erstellen. Dieses Beispiel lässt GitHub-Actions-Deployments vom main-Branch als der Service-Account handeln:

<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>

Regeln auflisten, optional nach Issuer gefiltert:

<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>

Eine Regel archivieren:

<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>

Der List-Endpunkt gibt eine Seite mit Regeln und den Cursor für die nächste Seite zurück:

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

Um eine einzelne Regel zu lesen oder zu aktualisieren, verwende `GET` und `POST` auf `/v1/organizations/federation_rules/{rule_id}`. Um die Workspaces zu verwalten, in denen eine Regel Token prägen kann, verwende `GET` und `POST` auf `/v1/organizations/federation_rules/{rule_id}/workspaces` sowie `DELETE` auf `/v1/organizations/federation_rules/{rule_id}/workspaces/{workspace_id}`.

Vollständige Parameterdetails und Antwortschemas findest du in der [API-Referenz für Federation-Regeln](https://platform.claude.com/docs/de/api/organization/federation/rules).

## Berechtigungen und Einschränkungen

<Note>
  * OAuth-authentifizierte Aufrufer können nur Regeln erstellen oder ändern, deren `oauth_scope` `workspace:developer` oder `workspace:inference` ist. Um eine Regel mit einem anderen Scope (etwa `org:admin` oder `workspace:manage_tunnels`) zu erstellen oder zu ändern, verwende die Console.
  * Ein OAuth-Aufrufer kann keinen Federation-Issuer aktualisieren, der hinter einer Regel steht, deren `oauth_scope` etwas anderes als `workspace:developer` oder `workspace:inference` ist (etwa `org:admin` oder `workspace:manage_tunnels`). Erwäge, einen dedizierten Issuer für die Bootstrap-Regel zu registrieren, damit die Issuer hinter Workspace-bezogenen Regeln über die API aktualisierbar bleiben.
  * Admin-API-Keys werden an diesen Endpunkten nicht akzeptiert, weder für Lese- noch für Schreibzugriffe; verwende ein `org:admin`-OAuth-Token.
</Note>

Eine Regel mit `oauth_scope: org:admin` muss auf einen Service-Account zielen, dessen `organization_role` `admin` ist. Ressourcennamen müssen `^[a-z0-9-]+$` entsprechen, 1 bis 255 Zeichen lang sein und innerhalb einer Organisation für jeden Ressourcentyp eindeutig sein; die vollständigen Einschränkungen auf Feldebene findest du unter [Validierungsregeln](https://platform.claude.com/docs/de/manage-claude/wif-reference#validation-rules).

## Paginierung und Archivierung

Die List-Endpunkte für Service-Accounts, Federation-Issuer und Federation-Regeln akzeptieren `limit` (1 bis 100, Standard 20) und einen `page`-Cursor aus der vorherigen Antwort. Übergib den `next_page`-Wert der Antwort als Query-Parameter `page` bei der nächsten Anfrage. Die Liste der Sub-Ressource für Regel-Workspaces gibt die vollständige Menge ohne Paginierung zurück. Archivierte Ressourcen sind standardmäßig in Listen ausgeblendet; übergib `include_archived=true`, um sie einzuschließen.

Archivieren ist ein Soft-Delete und idempotent: Das Archivieren einer bereits archivierten Ressource ist erfolgreich. Das Archivieren eines Issuers oder eines Service-Accounts gibt `400` zurück, solange eine aktive Federation-Regel noch darauf verweist; archiviere zuerst die Regel.

## Siehe auch

* [Workload Identity Federation](https://platform.claude.com/docs/de/manage-claude/workload-identity-federation): Konzepte und die Schritt-für-Schritt-Einrichtung in der Console
* [WIF-Referenz](https://platform.claude.com/docs/de/manage-claude/wif-reference): Umgebungsvariablen, Validierungsregeln, OAuth-Scopes und Fehlercodes
* [Admin API](https://platform.claude.com/docs/de/manage-claude/admin-api): der Rest der Oberfläche zur Organisationsverwaltung
* [Admin-API-Referenz](https://platform.claude.com/docs/de/api/organization): generierte Anfrage- und Antwortschemas für die Service-Account- und Federation-Endpunkte
