Claude Platform Docs

Service-Accounts

Service-Account erstellen
$client->beta->organization->serviceAccounts->create(string name, ?string description, ?OrganizationRole organizationRole, ?list<AnthropicBeta> betas): ServiceAccount
POST/v1/organizations/service_accounts

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Service-Accounts auflisten
$client->beta->organization->serviceAccounts->list(?bool includeArchived, ?int limit, ?string page, ?list<AnthropicBeta> betas): PageCursor<ServiceAccount>
GET/v1/organizations/service_accounts

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Service-Account abrufen
$client->beta->organization->serviceAccounts->retrieve(string serviceAccountID, ?list<AnthropicBeta> betas): ServiceAccount
GET/v1/organizations/service_accounts/{service_account_id}

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Service-Account aktualisieren
$client->beta->organization->serviceAccounts->update(string serviceAccountID, ?string description, ?OrganizationRole organizationRole, ?list<AnthropicBeta> betas): ServiceAccount
POST/v1/organizations/service_accounts/{service_account_id}

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Service-Account archivieren
$client->beta->organization->serviceAccounts->archive(string serviceAccountID, ?list<AnthropicBeta> betas): ServiceAccount
POST/v1/organizations/service_accounts/{service_account_id}/archive

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Models
class ServiceAccount { $type = 'service_account'; $id; $archivedAt; /* 8 more */ }
"service_account" type
string id

Tagged ID of the service account.

?\Datetime archivedAt

If set, this service account is archived.

?string archivedByActorID

Tagged ID (user_/svac_) of the actor that archived this service account.

\Datetime createdAt

When this service account was created.

?string createdByActorID

Tagged ID (user_/svac_) of the actor that created this service account.

?string description

Optional free-text description.

string name

Admin-chosen slug identifier.

OrganizationRole organizationRole

Org-level role. A federation rule may only be created or retargeted to grant org:admin scope when this is admin. A rule granting org:admin whose target is later demoted to developer is rejected at token exchange. Rules granting org:admin are managed in the Console.

\Datetime updatedAt

When this service account was last updated.

?string updatedByActorID

Tagged ID (user_/svac_) of the actor that last updated this service account.

class ServiceAccountWorkspaceMember { $type = 'service_account_workspace_member'; $createdByActorID; $implicit; /* 3 more */ }
"service_account_workspace_member" type
?string createdByActorID

Tagged ID (user_.../svac_...) of the actor who created this membership.

?bool implicit

True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role workspace_user and cannot be removed.

string serviceAccountID

Tagged service account ID (svac_...).

string workspaceID

Tagged workspace ID (wrkspc_...).

WorkspaceRole workspaceRole

Role of the service account in this workspace. Service accounts cannot hold the workspace_billing role.

Service-AccountsWorkspaces

Workspace zu Service-Account hinzufügen
$client->beta->organization->serviceAccounts->workspaces->add(string serviceAccountID, string workspaceID, NoBillingWorkspaceRole workspaceRole, ?list<AnthropicBeta> betas): ServiceAccountWorkspaceMember
POST/v1/organizations/service_accounts/{service_account_id}/workspaces

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Workspaces für Service-Account auflisten
$client->beta->organization->serviceAccounts->workspaces->list(string serviceAccountID, ?int limit, ?string page, ?list<AnthropicBeta> betas): PageCursor<ServiceAccountWorkspaceMember>
GET/v1/organizations/service_accounts/{service_account_id}/workspaces

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.

Workspace aus Service-Account entfernen
$client->beta->organization->serviceAccounts->workspaces->remove(string workspaceID, string serviceAccountID, ?list<AnthropicBeta> betas): WorkspaceRemoveResponse
DELETE/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}

Erfordert ein OAuth-Access-Token mit dem Scope org:admin, aus ant auth login --scope org:admin oder einer Workload-Identity-Federation-Regel; Admin-API-Keys werden nicht akzeptiert. Siehe WIF mit der Admin API verwalten.