---
title: Admin API
url: https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api
description: Verwalte Organisationsmitglieder, Workspaces, Einladungen und API-Keys programmatisch mit der Admin API, unter Verwendung eines Admin-API-Keys, eines `org:admin`-OAuth-Tokens oder eines persönlichen Keys bzw. Service-Account-Keys.
---

Mit der [Admin API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization) kannst du die Mitglieder, Workspaces, Einladungen und API-Keys deiner Organisation programmatisch verwalten, statt dies manuell in der [Claude Console](https://code.saschaberens.de/_h/platform.claude.com/) zu tun.

## Verfügbarkeit

Die Admin API ist für Organisationen der Claude Console und von Claude Enterprise verfügbar. Sie ist nicht verfügbar für Organisationen mit dem claude.ai-Team-Plan oder für Einzelkonten in der Console. Für ein Einzelkonto in der Console musst du zuerst auf der Seite [Organisation](https://code.saschaberens.de/_h/platform.claude.com/settings/organization) (`platform.claude.com/settings/organization`) in der Claude Console eine Organisation einrichten. Unter [Einen Admin-API-Key erstellen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api-keys) erfährst du, wo der jeweilige Organisationstyp seinen Key erstellt.

Claude-Enterprise-Organisationen (claude.ai) rufen die Admin API mit einem in claude.ai erstellten, eingeschränkten API-Key auf. Von dieser Seite gelten für sie nur die Endpunkte für Mitglieder, Einladungen und [Organisationsinformationen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api#accessing-organization-info). Außerhalb dieser Seite können sie außerdem die folgenden APIs und Endpunkte aufrufen:

* Die [Usage and Cost Analytics API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/usage-cost-analytics-api), die sich in der Beta befindet, und die veraltete [Usage and Cost API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/usage-cost-api). Beide erfordern einen Key mit dem Scope `read:analytics`.
* Endpunkte, die nur für Enterprise verfügbar sind: Gruppen, Lesezugriff auf benutzerdefinierte Rollen und die [Spend Limits API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/spend-limits-api).
* Die [Plugins API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/plugins-api) und die [Claude Tag API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/claude-tag-api), die nur für Enterprise verfügbar sind und sich in der Beta befinden.

Für Mitglieder, Einladungen, Gruppen und benutzerdefinierte Rollen siehe [Benutzerverwaltung](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/user-management).

Auf [Claude Platform on AWS](https://code.saschaberens.de/_h/platform.claude.com/docs/de/build-with-claude/claude-platform-on-aws) sind nur diese Admin-API-Endpunkte verfügbar:

* Die Workspace-Endpunkte: Erstellen, Abrufen, Auflisten, Aktualisieren und Archivieren unter `/v1/organizations/workspaces`.
* Die Endpunkte für externe Keys, für [CMEK](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/cmek-claude-platform-on-aws): Registrieren, Abrufen, Auflisten, Aktualisieren und Löschen unter `/v1/organizations/external_keys`. Es gibt keinen Validierungs-Endpunkt, da Keys beim Anhängen an einen Workspace validiert werden.
* Die [Endpunkte für Telemetrie-Ziele](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/claude-platform-on-aws-iam-actions#telemetry-destinations).
* Die Endpunkte der [Usage and Cost Analytics API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/usage-cost-analytics-api): `/v1/organizations/analytics/usage` und `/v1/organizations/analytics/cost`.

Organisationsmitglieder, Workspace-Mitglieder, Einladungen, API-Keys, die veraltete [Usage and Cost API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/usage-cost-api) sowie die Ratenlimit-Berichte sind auf Claude Platform on AWS nicht verfügbar.

## Authentifizierung

Die Admin API akzeptiert jede dieser drei Arten von Anmeldedaten:

* Einen **Admin-API-Key** (beginnend mit `sk-ant-admin...`), der im `x-api-key`-Header gesendet wird. Nur Organisationsmitglieder mit der Rolle admin können einen bereitstellen. Siehe [Einen Admin-API-Key erstellen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api-keys).
* Ein **OAuth-Bearer-Token** mit dem Scope `org:admin`, das im `authorization: Bearer`-Header gesendet wird. Nur Benutzer und Service-Accounts mit der Rolle admin können eines erhalten. Siehe [Ein OAuth-Bearer-Token erhalten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api#oauth-bearer-token).
* Einen **persönlichen Key** oder **Service-Account-Key**, der nicht auf einen bestimmten Workspace beschränkt ist und im `x-api-key`-Header gesendet wird. Der Key hat dieselben Berechtigungen wie das verknüpfte Konto. Siehe [Key-Typen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/authentication#key-types).

Ein Admin-API-Key deckt die meisten Endpunkte ab. Die Endpunkte für Service-Accounts, Federation-Issuer und Federation-Regeln akzeptieren nur ein `org:admin`-OAuth-Token. Sende einen persönlichen Key oder Service-Account-Key im `x-api-key`-Header, genau wie einen Admin-API-Key. Die folgenden Beispiele rufen den [Endpunkt für Organisationsinformationen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api#accessing-organization-info) mit einem OAuth-Token und mit einem Admin-API-Key auf.

Das SDK stellt die Endpunkte auf dieser Seite unter `client.organization` (csharp, go: `client.Organization`; java: `client.organization()`; php: `$client->organization`) bereit, und die `ant`-CLI unter `ant organization`. Die Beispiele auf dieser Seite verwenden den Standard-Client, der einen Admin-API-Key aus `ANTHROPIC_API_KEY` oder ein OAuth-Bearer-Token aus `ANTHROPIC_AUTH_TOKEN` liest. Die Kommentare in jedem Listenbeispiel geben an, ob es weitere Seiten abruft oder nur die erste liest. Die Parameter und Antworten der einzelnen Endpunkte findest du in der [Admin-API-Referenz](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization).

### OAuth-Bearer-Token

Melde dich mit der [`ant`-CLI](https://code.saschaberens.de/_h/platform.claude.com/docs/de/cli-sdks-libraries/cli/quickstart) unter einem dedizierten Profil mit dem Scope `org:admin` an (siehe [Admin-Zugriff](https://code.saschaberens.de/_h/platform.claude.com/docs/de/cli-sdks-libraries/cli/authentication#admin-access)) und exportiere dann das Bearer-Token. `--profile admin` speichert die `org:admin`-Anmeldedaten unter einem eigenen Profil und macht es zum aktiven Profil der CLI. Die exportierte Variable gilt für jeden SDK- und CLI-Aufruf in dieser Shell. Verwende 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 Tokens sind kurzlebig. Wenn Anfragen beginnen, 401 zurückzugeben, führe den `export`-Befehl erneut aus, um das Token zu aktualisieren.

Das SDK und die `ant`-CLI lesen `ANTHROPIC_AUTH_TOKEN` automatisch. Lass `ANTHROPIC_API_KEY` in derselben Shell ungesetzt, damit sie das Bearer-Token senden. Automatisierte Workloads überspringen die Anmeldung: Sie authentifizieren sich über Workload Identity Federation, und das SDK und die CLI führen den Token-Austausch anhand der Federation-Umgebungsvariablen durch. Siehe [Workload zur Verwaltung von WIF einrichten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/wif-admin-api#bootstrap-a-workload-to-manage-wif).

Rufe die Admin API mit dem exportierten Token auf:

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/me" \
    -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant organization retrieve
  ```

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

  organization = client.organization.retrieve()

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

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

  const organization = await client.organization.retrieve();

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

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

  var organization = await client.Organization.Retrieve();

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

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

  organization, err := client.Organization.Get(context.Background())
  if err != nil {
  	log.Fatal(err)
  }

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

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

  var organization = client.organization().retrieve();

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

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

  $organization = $client->organization->retrieve();

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

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

  organization = client.organization.retrieve

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

Ein `org:admin`-Token gewährt Zugriff auf die gesamte Organisation, unabhängig davon, an welchen Workspace das zugrunde liegende Profil oder die [Federation-Regel](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api#federation-rules) gebunden ist.

Für CI und andere nicht-interaktive Workloads erzeuge das Token mit Workload Identity Federation, anstatt dich interaktiv anzumelden. Siehe [WIF mit der Admin API verwalten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/wif-admin-api#workload-ci-and-automation).

### Admin-API-Key

Um einen Admin-API-Key für deinen Organisationstyp zu erstellen, siehe [Einen Admin-API-Key erstellen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api-keys).

<CodeGroup>
  ```bash cURL
  curl --fail-with-body -sS "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/me" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant organization retrieve
  ```

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

  organization = client.organization.retrieve()

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

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

  const organization = await client.organization.retrieve();

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

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

  var organization = await client.Organization.Retrieve();

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

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

  organization, err := client.Organization.Get(context.Background())
  if err != nil {
  	log.Fatal(err)
  }

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

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

  var organization = client.organization().retrieve();

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

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

  $organization = $client->organization->retrieve();

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

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

  organization = client.organization.retrieve

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

## So funktioniert die Admin API

Authentifiziere dich mit beliebigen Anmeldedaten aus [Authentifizierung](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api#authentication) und verwalte dann die folgenden Ressourcen:

* Organisationsmitglieder und ihre Rollen
* Organisationseinladungen
* Workspaces und ihre Mitglieder
* API-Keys
* Service-Accounts, Federation-Issuer und Federation-Regeln (nur mit `org:admin`-OAuth-Token)

Häufige Anwendungsfälle sind die Automatisierung von Onboarding und Offboarding, die Verwaltung des Workspace-Zugriffs und das Auditieren von API-Keys.

## Organisationsrollen und Berechtigungen

Organisationen der Claude Console haben fünf Rollen auf Organisationsebene. Details findest du unter [API-Console-Rollen und -Berechtigungen](https://code.saschaberens.de/_h/support.claude.com/en/articles/10186004-api-console-roles-and-permissions).

| Rolle | Berechtigungen |
| ----- | ----- |
| user | Kann den Playground nutzen |
| claude\_code\_user | Kann den Playground und [Claude Code](https://code.saschaberens.de/_h/code.claude.com/docs/de/overview) nutzen |
| developer | Kann den Playground nutzen und API-Keys verwalten |
| billing | Kann den Playground nutzen und Abrechnungsdetails verwalten |
| admin | Kann alles Vorgenannte und zusätzlich Benutzer verwalten |

Claude-Enterprise-Organisationen haben andere Rollen, darunter Eigentümer und einen Haupteigentümer. Siehe [Organisationsrollen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/user-management#organization-roles).

## Wichtige Konzepte

### Organisationsmitglieder

Liste [Organisationsmitglieder](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization/users/retrieve) auf, aktualisiere ihre Rollen und entferne sie.

Liste die Mitglieder deiner Organisation auf:

<CodeGroup>
  ```bash cURL
  # Gibt eine Seite zurück.
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/users?limit=10" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  # Im Terminal lädt die Ansicht beim Scrollen weitere Seiten nach. Bei Pipe-Ausgabe oder mit `--format json` begrenzt `--limit` die Ergebnisse.
  ant organization:users list --limit 10
  ```

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

  users = client.organization.users.list(limit=10)

  # Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for user in users:
      print(f"{user.id}: {user.email} ({user.role})")
  ```

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

  const users = await client.organization.users.list({ limit: 10 });

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for await (const user of users) {
    console.log(`${user.id}: ${user.email} (${user.role})`);
  }
  ```

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

  var page = await client.Organization.Users.List(new() { Limit = 10 });

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  await foreach (var user in page.Paginate())
  {
      Console.WriteLine($"{user.ID}: {user.Email} ({user.Role.Raw()})");
  }
  ```

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

  users := client.Organization.Users.ListAutoPaging(context.Background(), anthropic.OrganizationUserListParams{
  	Limit: anthropic.Int(10),
  })

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for users.Next() {
  	user := users.Current()
  	fmt.Printf("%s: %s (%s)\n", user.ID, user.Email, user.Role)
  }
  if err := users.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.users.UserListParams;

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

      var params = UserListParams.builder()
          .limit(10)
          .build();
      var users = client.organization().users().list(params);

      // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
      for (var user : users.autoPager()) {
          IO.println(user.id() + ": " + user.email() + " (" + user.role().asString() + ")");
      }
  }
  ```

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

  $users = $client->organization->users->list(limit: 10);

  // Liest nur die erste Seite.
  foreach ($users->getItems() as $user) {
      echo "{$user->id}: {$user->email} ({$user->role})\n";
  }
  ```

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

  users = client.organization.users.list(limit: 10)

  # Liest nur die erste Seite.
  users.data.each do |user|
    puts "#{user.id}: #{user.email} (#{user.role})"
  end
  ```
</CodeGroup>

Aktualisiere die Rolle eines Mitglieds:

<CodeGroup>
  ```bash cURL
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/users/user_01WxYzAbCdEfGhJkMnPqRsTu" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{"role": "developer"}'
  ```

  ```bash CLI
  ant organization:users update \
    --user-id user_01WxYzAbCdEfGhJkMnPqRsTu \
    --role developer
  ```

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

  user = client.organization.users.update(
      "user_01WxYzAbCdEfGhJkMnPqRsTu", role="developer"
  )

  print(f"id: {user.id}")
  print(f"role: {user.role}")
  ```

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

  const user = await client.organization.users.update("user_01WxYzAbCdEfGhJkMnPqRsTu", {
    role: "developer"
  });

  console.log(`id: ${user.id}`);
  console.log(`role: ${user.role}`);
  ```

  ```csharp C#
  using Anthropic.Models.Organization.Users;
  // ...

  AnthropicClient client = new();

  var user = await client.Organization.Users.Update(
      "user_01WxYzAbCdEfGhJkMnPqRsTu",
      new() { Role = Role.Developer }
  );

  Console.WriteLine($"id: {user.ID}");
  Console.WriteLine($"role: {user.Role.Raw()}");
  ```

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

  user, err := client.Organization.Users.Update(
  	context.Background(),
  	"user_01WxYzAbCdEfGhJkMnPqRsTu",
  	anthropic.OrganizationUserUpdateParams{
  		Role: anthropic.OrganizationUserUpdateParamsRoleDeveloper,
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", user.ID)
  fmt.Printf("role: %s\n", user.Role)
  ```

  ```java Java
  import com.anthropic.models.organization.users.UserUpdateParams;

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

      var params = UserUpdateParams.builder()
          .role(UserUpdateParams.Role.DEVELOPER)
          .build();
      var user = client.organization().users()
          .update("user_01WxYzAbCdEfGhJkMnPqRsTu", params);

      IO.println("id: " + user.id());
      IO.println("role: " + user.role().asString());
  }
  ```

  ```php PHP
  use Anthropic\Organization\Users\UserUpdateParams\Role;
  // ...

  $client = new Client();

  $user = $client->organization->users->update(
      userID: 'user_01WxYzAbCdEfGhJkMnPqRsTu',
      role: Role::DEVELOPER,
  );

  echo "id: {$user->id}\n";
  echo "role: {$user->role}\n";
  ```

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

  user_id = "user_01WxYzAbCdEfGhJkMnPqRsTu"
  user = client.organization.users.update(user_id, role: :developer)

  puts "id: #{user.id}"
  puts "role: #{user.role}"
  ```
</CodeGroup>

Entferne ein Mitglied aus der Organisation:

<CodeGroup>
  ```bash cURL
  curl -X DELETE "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/users/user_01WxYzAbCdEfGhJkMnPqRsTu" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant organization:users remove --user-id user_01WxYzAbCdEfGhJkMnPqRsTu
  ```

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

  removed_user = client.organization.users.remove("user_01WxYzAbCdEfGhJkMnPqRsTu")

  print(f"id: {removed_user.id}")
  ```

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

  const removedUser = await client.organization.users.remove("user_01WxYzAbCdEfGhJkMnPqRsTu");

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

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

  var removedUser = await client.Organization.Users.Remove("user_01WxYzAbCdEfGhJkMnPqRsTu");

  Console.WriteLine($"id: {removedUser.ID}");
  ```

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

  removedUser, err := client.Organization.Users.Remove(context.Background(), "user_01WxYzAbCdEfGhJkMnPqRsTu")
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", removedUser.ID)
  ```

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

  var removedUser = client.organization().users()
      .remove("user_01WxYzAbCdEfGhJkMnPqRsTu");

  IO.println("id: " + removedUser.id());
  ```

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

  $removedUser = $client->organization->users->remove(
      userID: 'user_01WxYzAbCdEfGhJkMnPqRsTu',
  );

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

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

  user_id = "user_01WxYzAbCdEfGhJkMnPqRsTu"
  removed_user = client.organization.users.remove(user_id)

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

### Organisationseinladungen

Lade Benutzer in deine Organisation ein und verwalte ausstehende [Einladungen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization/invites/retrieve).

Lade einen Benutzer in deine Organisation ein:

<CodeGroup>
  ```bash cURL
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/invites" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "email": "user@example.com",
      "role": "developer"
    }'
  ```

  ```bash CLI
  ant organization:invites create --email user@example.com --role developer
  ```

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

  invite = client.organization.invites.create(email="user@example.com", role="developer")

  print(f"id: {invite.id}")
  print(f"email: {invite.email}")
  print(f"status: {invite.status}")
  print(f"expires_at: {invite.expires_at}")
  ```

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

  const invite = await client.organization.invites.create({
    email: "user@example.com",
    role: "developer"
  });

  console.log(`id: ${invite.id}`);
  console.log(`email: ${invite.email}`);
  console.log(`status: ${invite.status}`);
  console.log(`expires_at: ${invite.expires_at}`);
  ```

  ```csharp C#
  using Anthropic.Models.Organization.Invites;
  // ...

  AnthropicClient client = new();

  var invite = await client.Organization.Invites.Create(new()
  {
      Email = "user@example.com",
      Role = Role.Developer
  });

  Console.WriteLine($"id: {invite.ID}");
  Console.WriteLine($"email: {invite.Email}");
  Console.WriteLine($"status: {invite.Status.Raw()}");
  Console.WriteLine($"expires_at: {invite.ExpiresAt:O}");
  ```

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

  invite, err := client.Organization.Invites.New(context.Background(), anthropic.OrganizationInviteNewParams{
  	Email: "user@example.com",
  	Role:  anthropic.OrganizationInviteNewParamsRoleDeveloper,
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", invite.ID)
  fmt.Printf("email: %s\n", invite.Email)
  fmt.Printf("status: %s\n", invite.Status)
  fmt.Printf("expires_at: %s\n", invite.ExpiresAt.Format(time.RFC3339))
  ```

  ```java Java
  import com.anthropic.models.organization.invites.InviteCreateParams;

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

      var params = InviteCreateParams.builder()
          .email("user@example.com")
          .role(InviteCreateParams.Role.DEVELOPER)
          .build();
      var invite = client.organization().invites().create(params);

      IO.println("id: " + invite.id());
      IO.println("email: " + invite.email());
      IO.println("status: " + invite.status().asString());
      IO.println("expires_at: " + invite.expiresAt());
  }
  ```

  ```php PHP
  use Anthropic\Organization\Invites\InviteCreateParams\Role;
  // ...

  $client = new Client();

  $invite = $client->organization->invites->create(
      email: 'user@example.com',
      role: Role::DEVELOPER,
  );

  echo "id: {$invite->id}\n";
  echo "email: {$invite->email}\n";
  echo "status: {$invite->status}\n";
  echo "expires_at: {$invite->expiresAt->format(DATE_ATOM)}\n";
  ```

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

  invite = client.organization.invites.create(email: "user@example.com", role: :developer)

  puts "id: #{invite.id}"
  puts "email: #{invite.email}"
  puts "status: #{invite.status}"
  puts "expires_at: #{invite.expires_at.iso8601}"
  ```
</CodeGroup>

Liste ausstehende, angenommene und abgelaufene Einladungen auf:

<CodeGroup>
  ```bash cURL
  # Gibt eine Seite zurück.
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/invites?limit=10" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  # Im Terminal lädt die Ansicht beim Scrollen weitere Seiten nach. Bei Ausgabe in eine Pipe oder mit `--format json` begrenzt `--limit` die Ergebnisse.
  ant organization:invites list --limit 10
  ```

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

  invites = client.organization.invites.list(limit=10)

  # Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for invite in invites:
      print(f"{invite.id}: {invite.email} ({invite.status})")
  ```

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

  const invites = await client.organization.invites.list({ limit: 10 });

  // Lädt bei Bedarf automatisch weitere Seiten nach; `limit` legt also die Seitengröße fest, nicht die Gesamtzahl.
  for await (const invite of invites) {
    console.log(`${invite.id}: ${invite.email} (${invite.status})`);
  }
  ```

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

  var page = await client.Organization.Invites.List(new() { Limit = 10 });

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  await foreach (var invite in page.Paginate())
  {
      Console.WriteLine($"{invite.ID}: {invite.Email} ({invite.Status.Raw()})");
  }
  ```

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

  invites := client.Organization.Invites.ListAutoPaging(context.Background(), anthropic.OrganizationInviteListParams{
  	Limit: anthropic.Int(10),
  })

  // Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for invites.Next() {
  	invite := invites.Current()
  	fmt.Printf("%s: %s (%s)\n", invite.ID, invite.Email, invite.Status)
  }
  if err := invites.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.invites.InviteListParams;

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

      var params = InviteListParams.builder()
          .limit(10)
          .build();
      var invites = client.organization().invites().list(params);

      // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
      for (var invite : invites.autoPager()) {
          IO.println(invite.id() + ": " + invite.email() + " (" + invite.status().asString() + ")");
      }
  }
  ```

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

  $invites = $client->organization->invites->list(limit: 10);

  // Liest nur die erste Seite.
  foreach ($invites->getItems() as $invite) {
      echo "{$invite->id}: {$invite->email} ({$invite->status})\n";
  }
  ```

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

  invites = client.organization.invites.list(limit: 10)

  # Liest nur die erste Seite.
  invites.data.each do |invite|
    puts "#{invite.id}: #{invite.email} (#{invite.status})"
  end
  ```
</CodeGroup>

Lösche eine Einladung:

<CodeGroup>
  ```bash cURL
  curl -X DELETE "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/invites/invite_015gWxHNr6h6TdRPZTmuCGnn" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant organization:invites delete --invite-id invite_015gWxHNr6h6TdRPZTmuCGnn
  ```

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

  deleted_invite = client.organization.invites.delete("invite_015gWxHNr6h6TdRPZTmuCGnn")

  print(f"id: {deleted_invite.id}")
  ```

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

  const deletedInvite = await client.organization.invites.delete(
    "invite_015gWxHNr6h6TdRPZTmuCGnn"
  );

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

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

  var deletedInvite = await client.Organization.Invites.Delete(
      "invite_015gWxHNr6h6TdRPZTmuCGnn"
  );

  Console.WriteLine($"id: {deletedInvite.ID}");
  ```

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

  deletedInvite, err := client.Organization.Invites.Delete(context.Background(), "invite_015gWxHNr6h6TdRPZTmuCGnn")
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", deletedInvite.ID)
  ```

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

  var deletedInvite = client.organization().invites()
      .delete("invite_015gWxHNr6h6TdRPZTmuCGnn");

  IO.println("id: " + deletedInvite.id());
  ```

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

  $deletedInvite = $client->organization->invites->delete(
      inviteID: 'invite_015gWxHNr6h6TdRPZTmuCGnn',
  );

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

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

  invite_id = "invite_015gWxHNr6h6TdRPZTmuCGnn"
  deleted_invite = client.organization.invites.delete(invite_id)

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

### Workspaces

Siehe [Workspaces](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/workspaces) für Beispiele zur Console und zur API.

### Workspace-Mitglieder

Verwalte den [Benutzerzugriff auf bestimmte Workspaces](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization/workspaces/members/retrieve).

Füge ein Mitglied zu einem Workspace hinzu:

<CodeGroup>
  ```bash cURL
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/members" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu",
      "workspace_role": "workspace_developer"
    }'
  ```

  ```bash CLI
  ant organization:workspaces:members add \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ \
    --user-id user_01WxYzAbCdEfGhJkMnPqRsTu \
    --workspace-role workspace_developer
  ```

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

  member = client.organization.workspaces.members.add(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      user_id="user_01WxYzAbCdEfGhJkMnPqRsTu",
      workspace_role="workspace_developer",
  )

  print(f"user_id: {member.user_id}")
  print(f"workspace_role: {member.workspace_role}")
  ```

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

  const member = await client.organization.workspaces.members.add(
    "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
    {
      user_id: "user_01WxYzAbCdEfGhJkMnPqRsTu",
      workspace_role: "workspace_developer"
    }
  );

  console.log(`user_id: ${member.user_id}`);
  console.log(`workspace_role: ${member.workspace_role}`);
  ```

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

  AnthropicClient client = new();

  var member = await client.Organization.Workspaces.Members.Add(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      new()
      {
          UserID = "user_01WxYzAbCdEfGhJkMnPqRsTu",
          WorkspaceRole = NoBillingWorkspaceRole.WorkspaceDeveloper
      }
  );

  Console.WriteLine($"user_id: {member.UserID}");
  Console.WriteLine($"workspace_role: {member.WorkspaceRole.Raw()}");
  ```

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

  member, err := client.Organization.Workspaces.Members.Add(
  	context.Background(),
  	"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  	anthropic.OrganizationWorkspaceMemberAddParams{
  		UserID:        "user_01WxYzAbCdEfGhJkMnPqRsTu",
  		WorkspaceRole: anthropic.NoBillingWorkspaceRoleWorkspaceDeveloper,
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("user_id: %s\n", member.UserID)
  fmt.Printf("workspace_role: %s\n", member.WorkspaceRole)
  ```

  ```java Java
  import com.anthropic.models.organization.workspaces.NoBillingWorkspaceRole;
  import com.anthropic.models.organization.workspaces.members.MemberAddParams;

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

      var params = MemberAddParams.builder()
          .userId("user_01WxYzAbCdEfGhJkMnPqRsTu")
          .workspaceRole(NoBillingWorkspaceRole.WORKSPACE_DEVELOPER)
          .build();
      var member = client.organization().workspaces().members()
          .add("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ", params);

      IO.println("user_id: " + member.userId());
      IO.println("workspace_role: " + member.workspaceRole().asString());
  }
  ```

  ```php PHP
  use Anthropic\Organization\Workspaces\NoBillingWorkspaceRole;
  // ...

  $client = new Client();

  $member = $client->organization->workspaces->members->add(
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
      userID: 'user_01WxYzAbCdEfGhJkMnPqRsTu',
      workspaceRole: NoBillingWorkspaceRole::WORKSPACE_DEVELOPER,
  );

  echo "user_id: {$member->userID}\n";
  echo "workspace_role: {$member->workspaceRole}\n";
  ```

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

  workspace_id = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  member = client.organization.workspaces.members.add(
    workspace_id,
    user_id: "user_01WxYzAbCdEfGhJkMnPqRsTu",
    workspace_role: :workspace_developer
  )

  puts "user_id: #{member.user_id}"
  puts "workspace_role: #{member.workspace_role}"
  ```
</CodeGroup>

Liste die Mitglieder eines Workspace auf:

<CodeGroup>
  ```bash cURL
  # Gibt eine Seite zurück.
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/members?limit=10" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  # Im Terminal lädt die Ansicht beim Scrollen weitere Seiten nach. Bei Pipe-Ausgabe oder mit `--format json` begrenzt `--limit` die Ergebnisse.
  ant organization:workspaces:members list \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ \
    --limit 10
  ```

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

  members = client.organization.workspaces.members.list(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ", limit=10
  )

  # Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for member in members:
      print(f"{member.user_id}: {member.workspace_role}")
  ```

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

  const members = await client.organization.workspaces.members.list(
    "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
    { limit: 10 }
  );

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for await (const member of members) {
    console.log(`${member.user_id}: ${member.workspace_role}`);
  }
  ```

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

  var page = await client.Organization.Workspaces.Members.List(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      new() { Limit = 10 }
  );

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  await foreach (var member in page.Paginate())
  {
      Console.WriteLine($"{member.UserID}: {member.WorkspaceRole.Raw()}");
  }
  ```

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

  members := client.Organization.Workspaces.Members.ListAutoPaging(
  	context.Background(),
  	"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  	anthropic.OrganizationWorkspaceMemberListParams{
  		Limit: anthropic.Int(10),
  	},
  )

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for members.Next() {
  	member := members.Current()
  	fmt.Printf("%s: %s\n", member.UserID, member.WorkspaceRole)
  }
  if err := members.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.workspaces.members.MemberListParams;

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

      var params = MemberListParams.builder()
          .limit(10)
          .build();
      var members = client.organization().workspaces().members()
          .list("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ", params);

      // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
      for (var member : members.autoPager()) {
          IO.println(member.userId() + ": " + member.workspaceRole().asString());
      }
  }
  ```

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

  $members = $client->organization->workspaces->members->list(
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
      limit: 10,
  );

  // Liest nur die erste Seite.
  foreach ($members->getItems() as $member) {
      echo "{$member->userID}: {$member->workspaceRole}\n";
  }
  ```

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

  workspace_id = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  members = client.organization.workspaces.members.list(workspace_id, limit: 10)

  # Liest nur die erste Seite.
  members.data.each do |member|
    puts "#{member.user_id}: #{member.workspace_role}"
  end
  ```
</CodeGroup>

Aktualisiere die Rolle eines Workspace-Mitglieds:

<CodeGroup>
  ```bash cURL
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/members/user_01WxYzAbCdEfGhJkMnPqRsTu" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{"workspace_role": "workspace_admin"}'
  ```

  ```bash CLI
  ant organization:workspaces:members update \
    --user-id user_01WxYzAbCdEfGhJkMnPqRsTu \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ \
    --workspace-role workspace_admin
  ```

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

  member = client.organization.workspaces.members.update(
      "user_01WxYzAbCdEfGhJkMnPqRsTu",
      workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      workspace_role="workspace_admin",
  )

  print(f"user_id: {member.user_id}")
  print(f"workspace_role: {member.workspace_role}")
  ```

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

  const member = await client.organization.workspaces.members.update(
    "user_01WxYzAbCdEfGhJkMnPqRsTu",
    {
      workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      workspace_role: "workspace_admin"
    }
  );

  console.log(`user_id: ${member.user_id}`);
  console.log(`workspace_role: ${member.workspace_role}`);
  ```

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

  AnthropicClient client = new();

  var member = await client.Organization.Workspaces.Members.Update(
      "user_01WxYzAbCdEfGhJkMnPqRsTu",
      new()
      {
          WorkspaceID = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
          WorkspaceRole = WorkspaceRole.WorkspaceAdmin
      }
  );

  Console.WriteLine($"user_id: {member.UserID}");
  Console.WriteLine($"workspace_role: {member.WorkspaceRole.Raw()}");
  ```

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

  member, err := client.Organization.Workspaces.Members.Update(
  	context.Background(),
  	"user_01WxYzAbCdEfGhJkMnPqRsTu",
  	anthropic.OrganizationWorkspaceMemberUpdateParams{
  		WorkspaceID:   "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  		WorkspaceRole: anthropic.WorkspaceRoleWorkspaceAdmin,
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("user_id: %s\n", member.UserID)
  fmt.Printf("workspace_role: %s\n", member.WorkspaceRole)
  ```

  ```java Java
  import com.anthropic.models.organization.workspaces.WorkspaceRole;
  import com.anthropic.models.organization.workspaces.members.MemberUpdateParams;

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

      var params = MemberUpdateParams.builder()
          .workspaceId("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ")
          .workspaceRole(WorkspaceRole.WORKSPACE_ADMIN)
          .build();
      var member = client.organization().workspaces().members()
          .update("user_01WxYzAbCdEfGhJkMnPqRsTu", params);

      IO.println("user_id: " + member.userId());
      IO.println("workspace_role: " + member.workspaceRole().asString());
  }
  ```

  ```php PHP
  use Anthropic\Organization\Workspaces\WorkspaceRole;
  // ...

  $client = new Client();

  $member = $client->organization->workspaces->members->update(
      userID: 'user_01WxYzAbCdEfGhJkMnPqRsTu',
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
      workspaceRole: WorkspaceRole::WORKSPACE_ADMIN,
  );

  echo "user_id: {$member->userID}\n";
  echo "workspace_role: {$member->workspaceRole}\n";
  ```

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

  user_id = "user_01WxYzAbCdEfGhJkMnPqRsTu"
  member = client.organization.workspaces.members.update(
    user_id,
    workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
    workspace_role: :workspace_admin
  )

  puts "user_id: #{member.user_id}"
  puts "workspace_role: #{member.workspace_role}"
  ```
</CodeGroup>

Entferne ein Mitglied aus einem Workspace:

<CodeGroup>
  ```bash cURL
  curl -X DELETE "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/members/user_01WxYzAbCdEfGhJkMnPqRsTu" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant organization:workspaces:members remove \
    --user-id user_01WxYzAbCdEfGhJkMnPqRsTu \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ
  ```

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

  removed_member = client.organization.workspaces.members.remove(
      "user_01WxYzAbCdEfGhJkMnPqRsTu", workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  )

  print(f"user_id: {removed_member.user_id}")
  ```

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

  const removedMember = await client.organization.workspaces.members.remove(
    "user_01WxYzAbCdEfGhJkMnPqRsTu",
    { workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ" }
  );

  console.log(`user_id: ${removedMember.user_id}`);
  ```

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

  var removedMember = await client.Organization.Workspaces.Members.Remove(
      "user_01WxYzAbCdEfGhJkMnPqRsTu",
      new() { WorkspaceID = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ" }
  );

  Console.WriteLine($"user_id: {removedMember.UserID}");
  ```

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

  removedMember, err := client.Organization.Workspaces.Members.Remove(
  	context.Background(),
  	"user_01WxYzAbCdEfGhJkMnPqRsTu",
  	anthropic.OrganizationWorkspaceMemberRemoveParams{
  		WorkspaceID: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("user_id: %s\n", removedMember.UserID)
  ```

  ```java Java
  import com.anthropic.models.organization.workspaces.members.MemberRemoveParams;

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

      var params = MemberRemoveParams.builder()
          .workspaceId("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ")
          .build();
      var removedMember = client.organization().workspaces().members()
          .remove("user_01WxYzAbCdEfGhJkMnPqRsTu", params);

      IO.println("user_id: " + removedMember.userId());
  }
  ```

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

  $removedMember = $client->organization->workspaces->members->remove(
      userID: 'user_01WxYzAbCdEfGhJkMnPqRsTu',
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
  );

  echo "user_id: {$removedMember->userID}\n";
  ```

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

  user_id = "user_01WxYzAbCdEfGhJkMnPqRsTu"
  removed_member = client.organization.workspaces.members.remove(
    user_id,
    workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  )

  puts "user_id: #{removed_member.user_id}"
  ```
</CodeGroup>

### API-Keys

Überwache und verwalte [API-Keys](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization/api_keys/list). Jeder Key in der Antwort enthält seinen `expires_at`-Zeitstempel (`null` für Keys ohne [Ablaufdatum](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/authentication#key-expiration)) sowie `principal`, die Identität, als die er agiert (siehe [Key-Typen](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/authentication#key-types)). Bei einem persönlichen Key ist `principal` gleich `{"type": "user_actor", "user_id": "user_..."}`. Bei einem Service-Account-Key ist es `{"type": "service_account_actor", "service_account_id": "svac_..."}`. Bei einem Workspace-Key ist es `null`. Jeder Key hat außerdem ein `scope`-Objekt: `{"type": "workspace", "workspace_id": "wrkspc_..."}` für einen Key, der an einen Workspace gebunden ist, oder `{"type": "organization"}` für einen Key, der in jedem Workspace funktionieren kann, auf den das Konto Zugriff hat. Wenn du die Liste nach `workspace_id` mit der ID des Standard-Workspace filterst, werden nur Keys zurückgegeben, die an den Standard-Workspace gebunden sind; Keys ohne Workspace-Scope werden unter keinem `workspace_id`-Filter zurückgegeben.

Liste die aktiven API-Keys in einem Workspace auf:

<CodeGroup>
  ```bash cURL
  # Gibt eine Seite zurück.
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/api_keys?limit=10&status=active&workspace_id=wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  # Im Terminal lädt die Ansicht beim Scrollen weitere Seiten nach. Bei einer Pipe oder mit `--format json` begrenzt `--limit` die Ergebnisse.
  ant organization:api-keys list \
    --limit 10 \
    --status active \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ
  ```

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

  api_keys = client.organization.api_keys.list(
      limit=10, status="active", workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  )

  # Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for api_key in api_keys:
      print(f"{api_key.id}: {api_key.name} ({api_key.status})")
  ```

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

  const apiKeys = await client.organization.apiKeys.list({
    limit: 10,
    status: "active",
    workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  });

  // Lädt bei Bedarf automatisch weitere Seiten, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for await (const apiKey of apiKeys) {
    console.log(`${apiKey.id}: ${apiKey.name} (${apiKey.status})`);
  }
  ```

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

  AnthropicClient client = new();

  var page = await client.Organization.ApiKeys.List(new()
  {
      Limit = 10,
      Status = ApiKeyListParamsStatus.Active,
      WorkspaceID = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  });

  // Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  await foreach (var apiKey in page.Paginate())
  {
      Console.WriteLine($"{apiKey.ID}: {apiKey.Name} ({apiKey.Status.Raw()})");
  }
  ```

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

  apiKeys := client.Organization.APIKeys.ListAutoPaging(context.Background(), anthropic.OrganizationAPIKeyListParams{
  	Limit:       anthropic.Int(10),
  	Status:      anthropic.OrganizationAPIKeyListParamsStatusActive,
  	WorkspaceID: anthropic.String("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"),
  })

  // Lädt bei Bedarf automatisch weitere Seiten nach, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
  for apiKeys.Next() {
  	apiKey := apiKeys.Current()
  	fmt.Printf("%s: %s (%s)\n", apiKey.ID, apiKey.Name, apiKey.Status)
  }
  if err := apiKeys.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.apikeys.ApiKeyListParams;

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

      var params = ApiKeyListParams.builder()
          .limit(10)
          .status(ApiKeyListParams.Status.ACTIVE)
          .workspaceId("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ")
          .build();
      var apiKeys = client.organization().apiKeys().list(params);

      // Ruft bei Bedarf automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl.
      for (var apiKey : apiKeys.autoPager()) {
          IO.println(apiKey.id() + ": " + apiKey.name() + " (" + apiKey.status().asString() + ")");
      }
  }
  ```

  ```php PHP
  use Anthropic\Organization\APIKeys\APIKeyListParams\Status;
  // ...

  $client = new Client();

  $apiKeys = $client->organization->apiKeys->list(
      limit: 10,
      status: Status::ACTIVE,
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
  );

  // Liest nur die erste Seite.
  foreach ($apiKeys->getItems() as $apiKey) {
      echo "{$apiKey->id}: {$apiKey->name} ({$apiKey->status})\n";
  }
  ```

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

  api_keys = client.organization.api_keys.list(
    limit: 10,
    status: :active,
    workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  )

  # Liest nur die erste Seite.
  api_keys.data.each do |api_key|
    puts "#{api_key.id}: #{api_key.name} (#{api_key.status})"
  end
  ```
</CodeGroup>

Benenne einen API-Key um oder deaktiviere ihn:

<CodeGroup>
  ```bash cURL
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/api_keys/apikey_01Rj2N8SVvo6BePZj99NhmiT" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "status": "inactive",
      "name": "New Key Name"
    }'
  ```

  ```bash CLI
  ant organization:api-keys update \
    --api-key-id apikey_01Rj2N8SVvo6BePZj99NhmiT \
    --status inactive \
    --name "New Key Name"
  ```

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

  api_key = client.organization.api_keys.update(
      "apikey_01Rj2N8SVvo6BePZj99NhmiT", status="inactive", name="New Key Name"
  )

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

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

  const apiKey = await client.organization.apiKeys.update("apikey_01Rj2N8SVvo6BePZj99NhmiT", {
    status: "inactive",
    name: "New Key Name"
  });

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

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

  AnthropicClient client = new();

  var apiKey = await client.Organization.ApiKeys.Update(
      "apikey_01Rj2N8SVvo6BePZj99NhmiT",
      new()
      {
          Status = Status.Inactive,
          Name = "New Key Name"
      }
  );

  Console.WriteLine($"id: {apiKey.ID}");
  Console.WriteLine($"name: {apiKey.Name}");
  Console.WriteLine($"status: {apiKey.Status.Raw()}");
  ```

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

  apiKey, err := client.Organization.APIKeys.Update(
  	context.Background(),
  	"apikey_01Rj2N8SVvo6BePZj99NhmiT",
  	anthropic.OrganizationAPIKeyUpdateParams{
  		Status: anthropic.OrganizationAPIKeyUpdateParamsStatusInactive,
  		Name:   anthropic.String("New Key Name"),
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

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

  ```java Java
  import com.anthropic.models.organization.apikeys.ApiKeyUpdateParams;

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

      var params = ApiKeyUpdateParams.builder()
          .status(ApiKeyUpdateParams.Status.INACTIVE)
          .name("New Key Name")
          .build();
      var apiKey = client.organization().apiKeys()
          .update("apikey_01Rj2N8SVvo6BePZj99NhmiT", params);

      IO.println("id: " + apiKey.id());
      IO.println("name: " + apiKey.name());
      IO.println("status: " + apiKey.status().asString());
  }
  ```

  ```php PHP
  use Anthropic\Organization\APIKeys\APIKeyUpdateParams\Status;
  // ...

  $client = new Client();

  $apiKey = $client->organization->apiKeys->update(
      apiKeyID: 'apikey_01Rj2N8SVvo6BePZj99NhmiT',
      status: Status::INACTIVE,
      name: 'New Key Name',
  );

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

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

  api_key_id = "apikey_01Rj2N8SVvo6BePZj99NhmiT"
  api_key = client.organization.api_keys.update(
    api_key_id,
    status: :inactive,
    name: "New Key Name"
  )

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

### Service-Accounts

Erstelle und verwalte Service-Accounts (`svac_...`), die nicht-menschlichen Identitäten, als die [Service-Account-Keys](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/authentication#key-types) und [Workload Identity Federation](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/workload-identity-federation)-Tokens agieren. Diese Endpunkte erfordern, wie die Endpunkte für Federation-Issuer und Federation-Regeln, ein `org:admin`-OAuth-Token. Siehe [Service-Accounts unter WIF mit der Admin API verwalten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/wif-admin-api#service-accounts).

### Federation-Issuer

Registriere die OIDC-Identitätsanbieter (`fdis_...`), deren Tokens eine Workload-Identität für deine Organisation geltend machen dürfen. Siehe [Federation-Issuer unter WIF mit der Admin API verwalten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/wif-admin-api#federation-issuers).

### Federation-Regeln

Verwalte die Regeln (`fdrl_...`), die Issuer-Tokens Service-Accounts und Scopes zuordnen. Siehe [Federation-Regeln unter WIF mit der Admin API verwalten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/wif-admin-api#federation-rules).

## Zugriff auf Organisationsinformationen

Der Endpunkt `/v1/organizations/me` gibt die Organisation zurück, zu der deine Anmeldedaten gehören:

<CodeGroup>
  ```bash cURL
  curl "https://code.saschaberens.de/_h/api.anthropic.com/v1/organizations/me" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant organization retrieve
  ```

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

  organization = client.organization.retrieve()

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

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

  const organization = await client.organization.retrieve();

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

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

  var organization = await client.Organization.Retrieve();

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

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

  organization, err := client.Organization.Get(context.Background())
  if err != nil {
  	log.Fatal(err)
  }

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

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

  var organization = client.organization().retrieve();

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

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

  $organization = $client->organization->retrieve();

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

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

  organization = client.organization.retrieve

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

```json
{
  "id": "12345678-1234-5678-1234-567812345678",
  "type": "organization",
  "name": "Organization Name"
}
```

Details zu Parametern und Antwortschemas findest du in der [Referenz zur Organization Info API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/api/organization/retrieve).

## Nutzungs- und Kostenberichte

Verfolge die Nutzung und Kosten deiner Organisation mit der [Usage and Cost Analytics API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/usage-cost-analytics-api). Die [Usage and Cost API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/usage-cost-api) ist die veraltete API für diese Daten.

## Claude Code-Analysen

Überwache die Entwicklerproduktivität und die Einführung von Claude Code mit der [Claude Code Analytics API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/claude-code-analytics-api).

## Ratenlimits

Lies mit der [Rate Limits API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/rate-limits-api) die für deine Organisation und ihre Workspaces konfigurierten „rate limits“ (Ratenlimits) aus und lege Ratenlimits für Workspaces fest.

## Compliance API

Rufe Audit- und Aktivitätsdaten für deine Organisation mit der [Compliance API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/compliance-api) ab. Admin-API-Keys können nur den Activity Feed lesen. Die Ausnahme ist die [Safety Cases API](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/enterprise-frontier-safeguards/safety-cases-api#get-access): Ein Admin-API-Key, den du erstellst, während diese API für deine Organisation verfügbar ist, erreicht sie ebenfalls. Über diese API kann der Key markierte Nachrichten lesen und auf Safety Cases reagieren. Für vollen Zugriff siehe [Die Compliance API einrichten](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/compliance-api-access).

## Organisations-Webhooks

Registriere Webhook-Endpunkte für Ereignisse zu Durchsetzungsmaßnahmen gegen die Benutzerprofile deiner Organisation mit [Organisations-Webhooks](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/organization-webhooks).

## Best Practices

* Verwende aussagekräftige Namen und Beschreibungen für Workspaces und API-Keys
* Behandle Fehler aus fehlgeschlagenen Operationen
* Auditiere regelmäßig Mitgliederrollen und Berechtigungen
* Archiviere ungenutzte Workspaces und lösche ausstehende Einladungen, die du nicht mehr benötigst
* Überwache die Nutzung von API-Keys, auditiere das [`expires_at`](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/authentication#key-expiration) jedes Keys und rotiere Keys regelmäßig

## FAQ

<AccordionGroup>
  <Accordion title="Welche Berechtigungen sind für die Nutzung der Admin API erforderlich?">
    Die Admin API akzeptiert einen Admin-API-Key (beginnend mit `sk-ant-admin`), ein OAuth-Bearer-Token mit dem Scope `org:admin` oder einen persönlichen Key bzw. Service-Account-Key, der nicht auf einen bestimmten Workspace beschränkt ist. Nur Organisationsmitglieder mit der Rolle admin können Admin-API-Keys bereitstellen. Nur Benutzer und Service-Accounts mit der Rolle admin können `org:admin`-Tokens erhalten. Ein persönlicher Key oder Service-Account-Key hat dieselben Berechtigungen wie das verknüpfte Konto. Siehe [Authentifizierung](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/admin-api#authentication).
  </Accordion>

  <Accordion title="Kann die Admin API API-Keys erstellen?">
    Nein. API-Keys erstellst du in der Claude Console. Die Admin API kann bestehende Keys nur lesen, umbenennen und ihren Status ändern.
  </Accordion>

  <Accordion title="Was passiert mit API-Keys, wenn ein Benutzer entfernt wird?">
    Das Verhalten hängt vom [Key-Typ](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/authentication#key-types) ab.

    Persönliche Keys funktionieren nicht mehr, wenn ihr Benutzer aus der Organisation entfernt wird. Service-Account-Keys funktionieren nicht mehr, wenn ihr Service-Account archiviert wird, funktionieren aber weiterhin, selbst wenn der Benutzer, der sie erstellt hat, entfernt wird. Workspace-API-Keys funktionieren weiterhin. Im [Claude Code-Workspace](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/workspaces#claude-code-workspace) ist jeder Key an das Mitglied gebunden, das ihn erstellt hat, und funktioniert nicht mehr, wenn dieses Mitglied entfernt wird.
  </Accordion>

  <Accordion title="Können Organisations-Admins über die API entfernt werden?">
    Nein. Die API kann keine Mitglieder mit der Rolle admin entfernen.
  </Accordion>

  <Accordion title="Wie lange sind Organisationseinladungen gültig?">
    Einladungen laufen nach 21 Tagen ab. Die Ablauffrist ist nicht konfigurierbar.
  </Accordion>
</AccordionGroup>

Workspace-spezifische Fragen findest du in den [Workspaces-FAQ](https://code.saschaberens.de/_h/platform.claude.com/docs/de/manage-claude/workspaces#faq).
